- Raspberry Pi Model A or B
- The following parts are available through the PrivateEyePi Store:
- Purchase a DS18B20 digital thermometer
- Purchase a 4.7k Ω (ohm) resistor
- As per Figure 1 put the resistor between pins 2 and 3 as in the diagram
- Connect Pin 3 of the temperature gauge to 3.3v GPIO Pin
- Connect Pin 2 of the temperature gauge to GPIO4 (Pin 7)
- Connect Pin 1 of the temperature gauge to ground (Pin 6)
f you want to add multiple sensors daisy chain the middle pin of the sensors. This will work because every DS18B20 sensor has a unique ID that is used to differentiate the signals coming from the sensors
sudo modprobe w1-therm
cd /sys/bus/w1/devices/
ls
You will see a listing of the current directory. There should be a directory that is the serial number of your temperature gauge. The serial number of my thermometer 28-0000040be5b6, but every one will be unique. Make a note of yours as you will need it later in step 4. If you have multiple sensors there will be multiple directories listed.
- Check your circuit wiring.
- Make sure you have the correct resistor (this is very important – yellow, violet, red, gold).
- Feel the temperature gauge with your finger. If it feels hot then you have it wired back to front.