Wiring an analog temperature sensor
In Chapter 6, Working with Analog Inputs and Local Storage, we used a photoresistor included in a voltage divider and we connected it to an analog input pin. We can use a similar configuration and replace the photoresistor with a thermistor to measure ambient temperature. A thermistor changes its resistance value with temperature, and therefore, we can convert resistance changes into voltage value changes.
We can also work with an analog sensor breakout board that includes a thermistor in the necessary configuration to provide us with voltage levels to an analog pin that represent temperature values. In this case, we will work with an analog temperature sensor supported in the upm
library to measure ambient temperature.
We will use the the analog pin labeled A0 to connect the voltage output of an analog accelerometer breakout board. After we finish the necessary wirings, we will write Python code to measure and display the ambient temperature in both degrees...