Solar Heated Water

Controller Designs...

Version 0 - Just to get something working...

Version 1 - Something more respectable.

These are Moore State Machine transition diagrams. (If you've played snakes and ladders you'll know how to read them - even better if you've played the version where you start at square 100, count backwards, climb snakes and slide down ladders...)

Try a simulation. (Click on the transitions to play...)

The full design of the controller will appear here. Build up the temperature logger hardware and you'll be 95% of the way there! 
Essentially the changes are: the RTS interface is removed. The freed pin 1 drives a NPN common emitter relay driver which drives the pump.

Pin 3 (open collector) drives optional alarm active during State 3. Entered if Manifold is > 75C. reverts to State 2 when < 70C.

State 5 test feature. Turns on pump, alarm, and poll LED for 10 seconds.  Then state 0 is entered - start of normal operation.

State 5 only entered at power on. 3 probes must be connected - else only the flashing led will operate.

A PC may be connected via the serial link for logging purposes. It is not needed for running.

Here's the source for the controller. This has been running since November 1999. This version (2.08) has been running since May 2000.

Why the delay in releasing the source? Well, I wanted to merge the common source into a common library. The library  would be used with the specific source for the actual product: logger or controller. This may happen one day!


The controller has been tested with the original DS1820 devices, and works fine.

Some changes need to be made for operation with the new DS18B20 devices. The fix is required that either sets the temperature sensors to a low resolution mode, or reads the 12 bit temperature correctly. 

I will update the source when I have tested with some DS18B20's.


Connect one probe per pin.

Pin 6 Manifold
Pin 7 Upper coil
Pin 8 Lower coil

Remaining pins on Port B leave open. (Although any extra sensors on these ports will be scanned. They will be ignored by the controller logic.)

Status frame

Uses VT52 cursor positioning!

State (0..5)
Seconds Timer
2 * Manifold Temp
2 * Upper Temp
2 * Lower Temp
State 2 Cooling Count
State 4 Manifold Threshold

The serial data is "19k2, 8 none and 1".

Example Set of Frames

Using HyperTerminal to monitor the serial data:


The manifold probe reads 0x0b (5.5C) 
The upper probe reads 0x36 (27.0C) 
The lower probe reads 0x34 (26.0C)

There may be other characters after the first frame - ignore these: they are remnants of previous long frames that have scrolled to the top. (May be I should add a "clear to end of screen" escape sequence after the "home cursor.") 


A reader writes...

Join the forum.

This page was last updated on the 14th May 2002.

Back to Therm Home page