Reading 1-Wire Temperature Devices

We get a lot of requests for a simple test program to read 1-Wire temperature sensing devices, so here it is. This program finds the first family code 10 device on the default one wire adapter. Family code 10 devices include the DS1920 iButton and the DS1820 chips. The default adapter on TINI is the external one wire network on serial1, which uses the DS2480 serial-to-1Wire converter chip.
ow10.zip (25 KB ZIP file) ZIP file with JBuilder project file, BuildOneWireProgram batch file, and a pre-built .tini file. This program was built with TINI 1.02p1 and the OneWireAPI 000.

Here is some sample output:

Test Program to Read DS1820/1920 Rev 2000 Dec 03 bab Systronix
Output is elapsed msec, msec since last sample, temp in C and F
9080/4370: temp= 26.5 C / 79.7 F
13340/4260: temp= 26.5 C / 79.7 F
17610/4270: temp= 26.5 C / 79.7 F
21890/4280: temp= 26.5 C / 79.7 F
26170/4280: temp= 26.5 C / 79.7 F


End of Lesson

Previous Lesson

Tutorial Home