As we learned in Chapter 2, Know Your Raspberry Pi, Raspberry Pi doesn't have analog inputs, so we will use digital sensors that are easy to use and low on cost as well.
Sensors
Temperature sensor DS18B20
DS18B20 is a digital temperature sensor manufactured by the Dallas Semiconductor Company. It gives 9-to 12-bit temperature readings.
DS18B20 has three pins, ground (GND), Data line (DQ), and power supply (VDD), as shown in the following diagram:
There is one more package available for these sensors, shown in the following figure, which is a waterproof version of DS18B20:
DS18B20 communicates with Raspberry Pi or any other controller device using the Dallas one-wire communication protocol. Raspberry Pi has provisions...