Hardware Reference
In-Depth Information
The world around you is analog. Even though you might hear that the world
is “going digital,” the majority of observable features in your environment
will always be analog in nature. The world can assume an infinite number of
potential states, whether you are considering the color of sunlight, the tempera-
ture of the ocean, or the concentration of contaminants in the air. This chapter
focuses on developing techniques for discretizing these infinite possibilities
into palatable digital values that can be analyzed with a microcontroller system
like the Arduino.
In this chapter, you will learn about the differences between analog and
digital signals and how to convert between the two, as well as a handful of the
analog sensors that you can interface with your Arduino. Using skills that you
acquired in the preceding chapter, you will add light sensors for automatically
adjusting your nightlight. You will also learn how to send analog data from
your Arduino to your computer via a USB-to-serial connection, which opens up
enormous possibilities for developing more complex systems that can transmit
environmental data to your computer.
NOTE YoucanfollowalongwithavideoasIteachyouaboutreadingfromanalog
inputs: www.jeremyblum.com/2011/01/24/arduino-tutorial-4-analog-
inputs/ .YoucanalsofindthisvideoontheWileywebsiteshownatthebeginning
ofthischapter.
Ifyouwanttolearnmoreaboutthedifferencesbetweenanaloganddigitalsig-
nals,checkoutthisvideothatexplainseachindepth: www.jeremyblum.com/
2010/06/20/lets-get-digital-or-analog/ .Youcanalsofindthisvideoonthe
Wileywebsiteshownatthebeginningofthischapter.
UnderstandingAnalogandDigitalSignals
If you want your devices to interface with the world, they will inevitably be
interfacing with analog data. Consider the projects you completed in the preced-
ing chapter. You used a switch to control an LED. A switch is a digital input—it
has only two possible states: on or off, high or low, 1 or 0, and so on. Digital
information (what your computer or the Arduino processes) is a series of binary
(or digital) data. Each bit has only has one of two values.
The world around you, however, rarely expresses information in only two
ways. Take a look out the window. What do you see? If it's daytime, you prob-
ably see sunlight, trees moving in the breeze, and maybe cars passing or people
walking around. All these things that you perceive cannot readily be classified
as binary data. Sunlight is not on or off; its brightness varies over the course of
a day. Similarly, wind does not just have two states; it gusts at different speeds
all the time.
 
Search WWH ::




Custom Search