Adding An External Temperature Sensor


The Pi In The Sky boards include an onboard temperature sensor, but can be expanded by a adding a second, external, DS18B20 temperature sensor.

To do this, you first need to obtain a DS18B20 preferably in the TO92 package style, like this:

To connect to the Pi In The Sky board, you need to solder on 3 flexible wires.  We suggest that you use coloured wire like so:

YELLOW - DQ - Data
RED - Vdd - +3.3V

Using separate colours makes a mistake much, much less likely.  Red and Black are standard colours for "+" and "0V"; the others can be anything you have to hand.  If you have some, use heat-shrink tubing to protect the bare wires; otherwise use some insulating tape.

All 3wires connect to the Pi In The Sky board, and not the Pi itself:

Take care to connect the correct pins on the DS18B20 to the correct holes on the PITS+ board.  If your board does not look like the one above, check with us for advice.

The PITS software does not need to be told about the extra device - it will find it automatically.  However, because the external sensor shares the same bus with the internal one, the software will not know which is which.  We can tell the software which is the external sensor by adding this line to the /boot/pisky.txt file:


Where "0" means the first sensor that it finds, and 1 is the second.  Default is "1", so you only need to add this line if you find that the external and internal temperature values are swapped in the telemetry (normally the internal one should come before the external one in the telemetry string).

Note:  Support for an external DS18B20 was added to the software on 1st July 2015 so if you have an older version then you need to update (see "Updating Your Software")

Published on