Connect Multiple Temperature Sensors with Raspberry Pi
Connect Multiple Temperature Sensors With Raspberry Pi
Measure temperatures with a 1-wire DS18B20 sensor and Raspberry Pihome > raspberry pi | electronics | education
In our article DS18B20 Temperature Sensor with Raspberry Pi we detailed how the Raspberry Pi can be used to take temperature readings from a ds18b20 temperature sensor via the i2c protocol. Here we will expand that article to explain how multiple temperature sensors can be copnnected to the Raspberry Pi - particularly useful for example in solar water heating pump controllers and other differential temperature applications where two or more temperature sensors are required.
The above schematic shows how three ds18b20 temperature sensors are connected to the GPIO pins of the Raspberry Pi. Note that although there are now multiple temperature sensors to be read, we still only have three connections to the Raspberry Pi: +3.3V and 0V connections to power the sensors, and the single data wire which returns the temperature readings from all the sensors.
Reading temperature readings from multiple sensors down one wire is possible because each ds18b20 sensor has a unique serial number coded into it at manufacture which the Raspberry Pi can be used to identify them by.
When using multiple sensors the first thing to do is get the serial number for each sensor and physically label them so that you know which is which when you come to install them in different locations around a system.
Follow the steps in the article on connecting a single sensor to get everything set up on your Raspberry Pi and use the ls -l sys/bus/w1/devices command to find the serial number for this first sensor. Then add the second sensor and identify it when you relist the connected devices noting its serial number. Repeat this process until you have connected and identified all of the sensors.
To confirm that everything is working as it should, take the temperature reading of each of the sensors in turn with the command:
cat /sys/bus/w1/devices/28-00000xxxxxxx/w1_slave...replacing the xxxxxxx with the correct serial number for each sensor.
You are now ready to make use of your temperature sensors in your Raspberry Pi project - e.g. Raspberry Pi Temperature Datalogging.
Article Last Modified: 22:21, 24th Sep 2014
Comment on this ArticleIf you have any comments on this article, please email them to firstname.lastname@example.org.
Related Articles and ProductsMore from the REUK.co.uk website:
|Power over Ethernet|
Find out how to power your networked microcontroller projects directly via the ethernet cable
|Publish Temperature Sensor Readings to Twitter Raspberry Pi|
Find out how to publish DS18B20 temperature sensor readings to Twitter from Raspberry Pi
|Beaglebone Black Credit Card Sized Computer|
Find out about the Beaglebone Black - tiny, low cost, low power use computer
|Mount USB Memory Stick on Raspberry Pi|
Find out how to mount a USB flash drive on your Raspberry Pi
|DS18B20 Temperature Sensor with Raspberry Pi|
Measure temperatures with a 1-wire DS18B20 sensor and Raspberry Pi
|Connecting to Raspberry Pi from PC via SSH|
Find out how to operate a Raspberry Pi directly from a Windows PC using SSH
|Raspberry Pi Temperature Logger with Xively|
Make a Raspberry Pi temperature data logger accessible online with Xively
|Simple Raspberry Pi Relay Control over the Internet|
Take your first steps in Raspberry Pi home automation - controlling a relay
raspberry pi, electronics, education.