Measure Temperature with the Pi

Digital sensors have many applications and are easy to use, but in many cases analog sensors have some advantages. For example, most processes in nature are analog, so analog sensors are a better fit for measuring phenomena such as temperature or acceleration.

Analog sensors usually measure a certain parameter and output a voltage that corresponds to the size of their current input signal. For example, a temperature sensor such as the TMP36 outputs a higher voltage for higher temperatures and a lower voltage for lower temperatures.

Although this sounds reasonable and easy, we still have a problem: digital computers like the Raspberry Pi don’t understand analog voltage signals. They can only interpret digital ...

Get Raspberry Pi, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.