Chapter 5. Adding Sensors

In Chapter 4, Controlling DC Motors, you learned how to use the Galileo to control DC motors. In this chapter, you'll learn how to add sensors to your projects. Sensors are important because you can use them to find, or avoid, objects. You can use them to sense your direction and speed, and also temperature. You can also use them to sense acoustic and electromagnetic waves, pressure, and many other physical phenomena. One of the challenges of using the Galileo is that it uses the Linux operating system at its core, so there are challenges if a sensor needs to do real— time processing of signals with tight timing. Linux is not a real-time operating system, and might be doing other things when you need to make something specific happen. This will limit some of the sensors you can use on your project. For a complete list of sensors and other hardware that are currently supported by the Galileo, see https://communities.intel.com/docs/DOC-23423. The goal of this chapter is to walk you through a few of the examples from this list to show you how to connect sensors to the Galileo.

Sensing distance

There are two basic sensors that will return information on the distance to an object: sonar and infrared. In the case of sonar, the sensor uses ultrasonic sound to calculate the distance to an object. The sensor consists of a transmitter and receiver, the transmitter creates a sound wave that travels out from the sensor, as illustrated here:

Sensing distance

The device is triggered by an electronic signal to send out a sound wave. If an object is in the path of these waves, then the waves reflect off the object, sending waves that return to the sensor, as shown here:

Sensing distance

The basic sensor then measures the received sound wave and sends out an electronic signal. The user can then calculate the time difference between when the sound wave was sent out and when it returns to measure the distance to the object. Unfortunately, the return time must be measured with precision for this type of sensor to work. This is challenging for a processor such as the Galileo, that runs Linux as the base operating system. There are ways to make this work, but it is not simple. Please see the shield compatibility guide at https://communities.intel.com/docs/DOC-23423 for details.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset