MLOG - Utility to read/log up to 20 temperature sensors.

by Geoff Hitchcox Christchurch, New Zealand.


Background:

My first project with a temperature sensor was TLOG, which could only read one sensor. Many people requested that I expand the TLOG concept to more sensors. So MLOG ("M" for multi or many) came about, which can read/log up to 20 DS1820 sensors, connected in parallel along a 3 wire cable.

The TLOG project is very simple, you just direct connect a DS1820 to a DB25 and plug it into the printer port on the PC - no other components required. I would have liked to use the same concept for MLOG, HOWEVER my experiments with other 1Wire devices showed a problem with this simple approach. The problem is that parallel ports are made to a "sort of" logic standard, but not to an electrical one. So the pullup resistors vary (10K, 5K, 1K). I found that when parallel ports with 1K pullup resistors were used, "some" 1Wire devices could not sink enough current to create a logic LO. So I decided to make the interface a little more complicated as follows: [MLOG to DS1820 Interface]
The 2K2 (2,200 ohm) resistor sets a minimum resistance for the DS1820 to "pull down", which meets the 1Wire requirement. The 47K and transistor are used to detect when the DS1820 pulls the DQ line LO. I have found this circuit reliable on all my various parallel ports, so I have chosen this approach for MLOG. You can mount the 2 resistors and transistor inside the DB25. Pin 6 of the parallel port is used to supply 5 Volts to the DS1820 sensor(s). Just be aware that if many sensors are to be used, PIN 6 may not supply enough current - so a better 5 Volt supply may be required.

I have made MLOG available as FREEWARE on this page for anyone wanting a quick temperature logging system (to 0.06 degree resolution) for hobby or science experiments. My concept is to use old junk DOS PC's to gather the data, and not tie up a larger Windows machine - which (as we all know ;-) can have reliability issues long term.

The DS1820 is a small 3 terminal device that looks like a transistor. It contains a calibrated temperature sensor, an analogue to digital converter and a serial "one wire" protocol for communication. The cost of the DS1820 bought locally in Christchurch, New Zealand was US$7. For the electronic experimenter it is an absolute delight to "play" with.

Interface software for the DS1820 made available on the "net", tends to use the PC serial port (plus many additional components). However I wanted to use the parallel port with only 3 additional components. Careful attention to timing issues in the software makes the "wiring" much simpler for the user.

Here are some sample screens from the MLOG software.
The following is what the screen shows, when MLOG is first
started. It detects all the 1 Wire devices on the network, then
lists the DS1820 sensors. You can see in the following example,
I had 2 DS1820 sensors and a Bray/Jennings barometer attached
to the network. The long number is the unique serial number that
is coded into each device to identify it.

1 Wire Devices connected to PC:
10AA7914000800B6  Family Code = 10
10DE8014000800A7  Family Code = 10
26E23F2B00000029  Family Code = 26

DS1820 devices found:
10AA7914000800B6  Family Code = 10
10DE8014000800A7  Family Code = 10

Any key for the MENU

The following is the menu choices of MLOG


             MLOG - Multiple DS1820 Monitor/Logger              Ver 0.1

     Logging Data is saved to MLOG.CSV to allow direct input to EXCEL

1 - Printer Port Testing Function

2 - Metric, Centigrade, continuous sampling, NO logging
3 - US/UK,  Fahrenheit, continuous sampling, NO logging

4 - Log in Centigrade, every minute
5 - Log in Centigrade, every hour

6 - Log in Fahrenheit, every minute
7 - Log in Fahrenheit, every hour

8 - Do ROM Search

ENTER number for function required or ESC key to quit.

The following shows over a half million readings (option #2),
with no CRC errors, indicating that the "network" of sensors was
not picking up interference, and the software was working as per
design.


1Wire Data (degrees Centigrade)                               ESC key for Menu

Samples = 303464  CRC Errors = 0

     MIN       AVG       MAX     Current
    11.81     15.37     19.88     11.81   s/n 10AA7914000800B6
    12.06     15.53     20.31     12.06   s/n 10DE8014000800A7

The following is a (brief) example of option #4, showing the
contents of the MLOG.CSV file. This can be loaded straight into 
EXCEL for graphing etc.


,"s/n 10AA7914000800B6","s/n 10DE8014000800A7"
21-09-2003 09:00:00, 11.56, 11.81
21-09-2003 09:01:00, 11.62, 11.81
21-09-2003 09:02:00, 11.62, 11.81
21-09-2003 09:03:00, 11.56, 11.81
21-09-2003 09:04:00, 11.69, 12.00
21-09-2003 09:05:00, 11.69, 12.00


The data from the DS1820 has a Cyclic Redundant Check made on each byte transmitted, MLOG does the CRC check on the received data and reports any errors, it will not log faulty data.

Requirements: MLOG was compiled as a 16bit DOS application, requiring DOS 3.0 or above. The PC does not have to be state of the art, any old pc/laptop AT and above is okay, even a 20 MHz '286' 15 year old AT can easily meet spec. MLOG can make that old "junk" PC suddenly have a purpose in life!

The program should not be run from a W9x/ME DOS window because the program auto calibrates its timing based on the CPU clock speed. This process is "ruined" by the W9x/ME operating system time sharing the CPU. To use the program from W9x, you must click on "Start" and "Shut Down" to "restart in MSDOS Mode".


Installation:

Copy MLOG.ZIP (Version 0.1) to a new (any name) directory on your PC.

Source Code:

I get many requests for the source code for MLOG. However, because it uses some of my commercial code, I do not release the source code under any circumstance.

Support and Additional Information:

MLOG written by Geoff Hitchcox, Christchurch, New Zealand, South Pacific.

Sensor Types:

Currently the program only handles DS1820 sensors. I would have made it more flexible, but DALLAS chose not to send me any sensors!

Windows Users:

Many readers of this page are wanting to measure multiple temperatures with a WINDOWS box. So if this is your requirement, then may I suggest you have a look at this Windows Thermometer from Finland. I have personally not used it, however it appears to be a well done project. It uses the serial port hardware to do the critical timing, which is why it can be run on a Windows box.
Sensor Information:

Dallas DS1820 information Page

Complete DS1820 Data Sheet (PDF format)
[DS1820 Package Styles]
Hosted by www.Geocities.ws

1