Reader small image

You're reading from  Mastering Beaglebone Robotics

Product typeBook
Published inDec 2014
Reading LevelBeginner
Publisher
ISBN-139781783988907
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Richard Grimmett
Richard Grimmett
author image
Richard Grimmett

Richard Grimmett has more fun that should be allowed working on robotics projects while teaching Computer Science and Electrical Engineering at Brigham Young University Idaho. He has a Bachelors and Masters degree in Electrical Engineering and a PhD in Leadership Studies. He also has 26 years of experience in the Radar and Telecommunications industries, and even has one of the original brick phones. He has written books on the basics of using the BeagleBone Black for robotics projects, and another for the Raspberry PI and yet another for the Arduino.
Read more about Richard Grimmett

Right arrow

Chapter 8. Measuring Wind Speed – Integrating Analog Sensors

Now your sailboat knows where it is, and you can control the rudder and sail; you'll now want to do some actual sailing. But because you don't have an onboard power source, you're going to rely on the wind for your power. To do this, you'll need some way of sensing both the direction as well as the strength of the wind.

In this chapter, you'll learn the following things:

  • Connecting an analog wind sensor to the BeagleBone Black

  • Using the BeagleBone Black analog-to-digital converter to read the value of the wind speed

  • Some of the basics of sailing so that you can sail in almost any direction

Connecting an analog wind speed sensor


Since you are going to use wind as your power source, you'll need to know both the direction and strength of the wind. You can do this with an analog wind sensor. Here is an image of a wind sensor that is fairly inexpensive, from www.moderndevices.com:

You can mount it to the mast if you'd like. You can perhaps use a small piece of heavy-duty tape and mount it to the top of the mast. However, as you'll see a bit later, it will be useful to be able to turn the sensor in order to do a complete sensing of the wind, so it is useful to mount the sensor to a servo.

In order for the BeagleBone Black to talk with this device, you'll need to connect it to the GPIO pins. Here is a close-up of the connections that the wind sensor requires:

You'll need a GND and +V connection. The +V pin will be connected to the 5-volt connection of the BeagleBone Black, P9_5 of the GPIO set, and the GND pin will be connected to the ground connection of the BeagleBone Black ADC...

Getting sensor data from the wind speed sensor


You'll use the same Adafruit library that you used in the previous chapters. If you have not installed this library, then install it and follow the instructions in Chapter 6, A Robot that Can Sail. Then create the following program:

When you run the program, you will see the output of the wind sensor in volts. You can put the wind sensor near a fan and you should see the value change, as shown in the following screenshot:

Note

Note that this will give you an indication of the strength of the wind, but the reading is not calibrated.

In this case, you won't need a calibrated reading but just a relative indication of strength; you'll then use it to gauge the direction of the wind. As noted earlier, you'll want to mount the wind sensor on a servo. This can give you a better indication of the direction of the wind with respect to the sailboat. To do this, connect the servo as noted in Chapter 6, A Robot that Can Sail. Connect the control wire connection...

Some basics of sailing


Now that you have set up everything, pack up your electronics in any sort of water-resistant plastic case, and your sailboat should be ready to sail.

Note

One word of caution

Electronics and water normally do not mix well. Make sure that your BeagleBone Black and all the associated circuitry is well buttoned up in as watertight a container as possible. Use a silicon sealant or some other waterproof sealant from where your wires enter or leave the enclosure.

Your sailboat can now sense wind, control the rudder and sail, know where it is and what speed and angle it is moving at, and calculate the bearing and distance to a new destination. In order to complete your robot, you'll need a bit of information on how to sail. First, as a word of caution, this is not coming from an expert sailor, but there are many excellent tutorials on sailing. Try www.simpleeditions.com/61001/how-to-sail for more information on the details of sailing. Also, you'll find a very interesting interactive...

Summary


Now you have all the tools to create a program to sail your boat autonomously. It knows where it is and where it is going, and can sense the wind to use that to sail towards a specific destination. The next few chapters will introduce an entirely new application of the BeagleBone Black—and underwater ROV to explore things under the surface of water.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mastering Beaglebone Robotics
Published in: Dec 2014Publisher: ISBN-13: 9781783988907
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Richard Grimmett

Richard Grimmett has more fun that should be allowed working on robotics projects while teaching Computer Science and Electrical Engineering at Brigham Young University Idaho. He has a Bachelors and Masters degree in Electrical Engineering and a PhD in Leadership Studies. He also has 26 years of experience in the Radar and Telecommunications industries, and even has one of the original brick phones. He has written books on the basics of using the BeagleBone Black for robotics projects, and another for the Raspberry PI and yet another for the Arduino.
Read more about Richard Grimmett