Reading Analog Sensors
Chapter Summary
This chapter covered the following concepts:
- The differences between analog and digital signals
- How to convert analog signals to digital signals
- How to read an analog signal from a potentiometer
- How to display data using the serial monitor
- How to interface with packaged analog sensors
- How to create your own analog sensors
- How to map and constrain analog readings to drive analog outputs
Parts List
- Arduino Uno
- USB A-B Cable
- Small Breadboard
- Jumper Wires
- 10kΩ potentiometer
- 10kΩ resistor (x2)
- 220Ω resistor (x3)
- Photoresistor
- TMP36 Temperature Sensor
- Common-cathode RGB LED (make sure it isn’t common-anode!)
Optional Parts:
Useful Links
- Arduino Analog Input Pin Reference Page
- Arduino analogReference() Command Page
- Arduino analogRead() Command Page
- SudoGlove Gesture Controller
- TMP36 Datasheet (PDF)
Color Wiring Diagrams
- Chapter 3, Figure 3
- Chapter 3, Figure 8
- Chapter 3, Figure 11
Videos
Follow along with a video to learn about reading analog inputs with your Arduino
This video explains the basic differences between analog and digital signals:
Code
All code is licensed via the GNU GPL v3. Code is maintained and updated on GitHub. The download zip linked above always contains the most recent version of the code examples that have been pushed to the GitHub Code Repository.