Serial Port Temperature Sensors - Using Multiple Sensors
This page describes how to configure and use multiple temperature sensors
using a single serial port interface circuit.
Multiple Sensors
Each DS18S20 temperature sensor has a unique 64-bit address, so multiple sensors
can be connected in parallel to the same interface circuit.
Update digitemp Configuration
If multiple sensors are connected, it's necessary to update the digitemp configuration file:
digitemp -i -q -c /etc/digitemp.conf
and digitemp should detect all the connected sensors and update the configuration file.
Reading Multiple Temperatures
To read the temperature of all the connected sensors, the "-a": parameter
is specified:
digitemp -a -q -c /etc/digitemp.conf
with the following output:
Apr 17 23:16:16 Sensor 0 C: 26.56 F: 79.81
Apr 17 23:16:18 Sensor 1 C: 23.44 F: 74.19
Apr 17 23:16:20 Sensor 2 C: 23.38 F: 74.08
Read Single Temperature
To read the temperature of just one sensor, the sensor number can be specified:
digitemp -t 1 -q -c /etc/digitemp.conf
with the resulting output:
Apr 17 23:18:12 Sensor 1 C: 23.44 F: 74.19
Sensor Order
Note that digitemp sorts the temperature sensors in ascending order of their
64-bit addresses.
This can mean that adding an additional sensor may cause other existing sensors
to be re-numbered by digitemp.
If this is the case, and you want to preserve any existing history in your
RRDTool database files, you may need to rename your RRDTool database files,
as well as modifying the description in the perl script that handles
data collection and graphing.
last updated 25 Sep 2006
|