This program will read from any number of DS18B20 temperature sensors connected to a Raspberry Pi using the Dallas 1-Wire protocol. What my program does differently than others, is dynamic detection and configuration of all connected devices.
This is a modification of another program that hard-coded each sensor. That project had a lot of repetitious code, and had to be modified each time a sensor was added or removed.
The original hard-coded project can be found here.
I suspect that project was derived from the Adafruit project located here.
- The Raspberry Pi must have the Dallas 1-wire protocol enabled in the Interfaces tab of the Raspberry Pi Configuration utility.
- Once that interface is enabled and the Pi rebooted, the 1-wire devices will appear on the Raspberry Pi filesystem.
- A Fritzing project showing how to wire up these sensors can be found here.