martybugs.net Electronics Info
 navigation
. MartyBugs home
. electronics home
. temperature sensors
 
 temp sensors
. overview
. serial hardware interface
. USB hardware interface
. linux software
. windows software
. graphing temps
. mutiple sensors
 
 site search
Custom Search
 
Serial Port Temperature Sensors

These pages describes a low cost temperature sensor which can be connected to a PC via a serial port or USB port, allowing the PC to monitor and record temperatures.


Background Info
Members of the WAFreeNet, a community wireless networking group in Western Australia, have installed PCs in various hot locations, including inside a house roof, and inside closed cabinets.

Heat is the natural enemy PCs, particularly for PCs in hot locations. While most modern PCs have temperature sensors on the CPU and motherboard, and can be monitored under linux with the aid of lm_sensors.
Alternatively, some hard drives contain temperature sensors, and can be monitored with the aid of another linux app called hddtemp.

However, older PC hardware is often used for wireless routers, and may not have temperature sensors on-board. Additionally, on-board temperature sensors are very limiting with regards to what can be monitored, as the temperature sensors are fixed, and designed to measure the temperature of a very specific part of the PC.

Being able to have multiple temperature sensors interfacing to a single PC, with each temperature sensor on a length of wire, would provide a much more flexible alternative, allowing temperature sensors to be easily distributed, ie, one temperature sensor close to the PC motherboard, another outside the cabinet to monitor ambient temperature, etc.

GregM and Martin researched various options for low-cost temperature sensors which could be easily interfaced to a PC, and came across the DS18S20, a 1-wire parasite-power digital thermometer sensor made by Maxim/Dallas.

DS18S20 temperature sensor
DS18S20 temperature sensor (TO-92 package)
with centimetre ruler for scale

It's a very small sensor, in a TO-92 package, with a temperature range of -55 degrees to +125 degrees Celsius (with 0.5 degrees C accuracy between -10 degrees and +85 degrees Celsius), and requires minimal circuitry to interface it to a PC's serial port.
Software for communicating with these temperature sensors is readily available for both linux and Windows.

Multiple DS18S20 temperature sensors can be connected in parallel, as they have unique 64-bit addresses, and can be individually queried on a 1-wire bus.

Note that the DS18S20 temperature sensors have "DS1820" written on them, but they are actually the DS18S20 - for some reason, Maxim haven't updated the details stamped on each sensor.

box of DS18S20 sensors
DS18S20 samples kindly provided by Maxim/Dallas


Sourcing Temperature Sensors
The DS18S20 temperature sensor can be purchased from various sources, including directly from Maxim (~US$2.57 each), or from an electronics component reseller such as RS Australia (~AUD$13.90 each, cheaper if buying 25+).

Note that the DS18S20 temperature sensor can often be found relatively cheaply on eBay. Search eBay for "DS18S20" or "DS1820" to find them.

Many component manufacturers, including Maxim, are normally quite happy to send free sample components.

Update: Apparently many of the DS18S20 and DS18B20 temperature sensors available online are counterfeits. Refer to https://github.com/cpetrich/counterfeit_DS18B20 for more information.


Implementation Details
I have provided detailed information on using these temperature sensors, spread over several pages, with the following major headings:
References
Here's some links that I found useful while researching the DS18S20 temperature sensor.
Credits
Photos and images by Martin.
Thanks to GregM for the initial investigation into temperature sensors, sourcing our first DS18S20 sensors, and experimenting with the hardware and software.

Thanks to Maxim/Dallas for providing some sample DS18S20 temperature sensors, and thanks to Central Semiconductor Corporation for providing some sample 1N5818 Schottky diodes.





last updated 8 Mar 2020
 
.