Chapter 5. Reading from Analog Sensors
We have dealt with digital components up to now. They have only two possible states: ON or OFF. Not all electronics components are digital. Many electronic components are analog. These types of components can have any value among the possible infinite values. Dealing with analog components is different to dealing with digital components. Most of the electronic sensors available are analog. In this chapter, we will write programs to deal with analog components: temperature sensor and light sensor.
In this chapter, we are going to cover these topics:
Analog I/O
Reading from analog components
TMP36 temperature sensor circuit setup
Program to print temperature
LDR circuit setup
Program to check light intensity