In this example fleXYlog and fleXYcad help solve a problem with a new boiler.

April 2006, a new-fangled, modern electronic gas-fired boiler was installed in my kitchen. The boiler heats water for washing and for the central-heating system. It replaced a much older 'mechanical' gas-boiler fitted inside a fireplace in the living-room, similar to this model here.
The new boiler is more energy-efficient than the old boiler  -  and it is much more complicated to understand. The instruction handbook looks like maintenance-manual for a B24 Liberator.


After seeing the new boiler in action for several weeks it became apparent that the gas burner was firing regularly during the middle of the night, for some strange reason. The boiler certainly didn't need to heat any water for radiators (the room thermostat was not calling for heat after 11pm) and no-one was washing dishes at 4am in the morning.

I decided to find out just how often the gas burner was starting up. But how to monitor its activity ?

Choosing a sensor:

When the boiler fires and the pump is running, there is a small increase in noise. Not having a microphone, I tried using a small loud-speaker from an old headphone as a sensor, but the noise seemed not loud enough for my simple interface circuit. Next I tried a 2-cms piezo-ceramic disc to pick up vibrations on the side of the boiler panels. Neither sensor worked properly.

Apart from finding a large stray magnetic pulse, probably from the boiler-pump power-surge, the only other indication I could see that showed the boiler was firing was a green light from a recessed LED inside the control panel.

    Gas-burner LED is next to the flame symbol.

The green LED seemed to stay lit all the time the gas was burning.
All I needed was an opto-sensor + PIC-chip circuit to detect when the light turned on and off, send this signal to fleXYlog running on a Newton PDA, and record the activity over several days.

An old opto-sensor from a piece of discarded circuit-board provided a handy light-sensitive component. The OPB825B made by Optek is a slotted optical switch, consisting of an emitting diode and a photo-transistor detector. I only needed the photo-detector half, and the plastic surround trimmed easily. Long wires were soldered to the detector component.


This opto-detector is tuned for 800nm Infra-Red wavelength, but it does react over the visible spectrum too.

Making a circuit:

Here's a rough diagram of my working circuit drawn on a Newton OMP (turned sideways !).
The 5-volt supply is provided by a 100mA LM78L05A regulator (or equivalent) fed by a 9-volt battery or a 12-volt mains adaptor. The PIC chip is programmed to use its internal A/D converter on pin 6.

The capacitor (100nF) helps stabilize the analog signal and eliminate mains-borne interference.

Serial data is output (in TTL logic levels) on PIC pin 2 to a Newton.

Getting the opto-detector to sense the low-intensity green light from the boiler LED needed some experiment.
What worked nicely was a 1-Meg resistor, 'R' as indicated in the sketch, rather than a 10k or 100k resistor  - these low values will work for bright-light conditions but not for a dim LED.

With no light falling on the sensor, the PIC A/D outputs 0. With room daylight falling on the opto-sensor the PIC A/D outputs around 1016 units. 1 unit is equivalent to 1023 / 5 volts = 0.0049 or 4.9 milliVolts, roughly.

The opto-sensor held against the green LED generates a max analog voltage around 700 units, or 3.43 volts.

The mechanical switch from PIC-pin 7 to ground provides an option to extend the sensing period to 6.5 minutes after the green LED has triggered the circuit  i.e. the ON window stays open long enough for fleXYlog to register the changed condition if the event itself is only of short duration. This ensures a Newton OMP/100/120 can record (or log) all trigger events when its screen-width represents 24-hours and the fleXYlog sampling period is set to 371 seconds, around 6 minutes. So, even a short boiler-burn of a minute or so can be detected and logged.

FleXYcad version of the PIC circuit:

         Lower, solder view: 

The 9-way serial-connector is the rectangle shape on the LHS.
The DC power-connector socket is the square shape located at top (the 2 solder points for + and - are in the middle).
The transistor shape is the LM78L05 voltage regulator.
Components can be easily shuffled around using fleXYcad, aiming to minimise cuts or links.
This simple PIC A/D opto-sensor circuit for stripboard can be seen as a fleXYcad text-file here: cct text.

PIC-chip program in Basic language is here: program

The working circuit:

The opto-sensor is wired using twin-core screened cable.

A later development using fleXYcad(v2.2) allows a proper circuit-board to be made. Details are here.
The fleXYcad version of the circuit for making a pcb is here: optocct.txt.

Opto-Sensor shown attached to the boiler LED with BlueTack :



Serial data from the PIC circuit was transmitted to a Newton at 1200 baud.

FleXYlog running on an MP120 collected data for 24-hours from 9pm:

The gas burner seems to be starting-up every 3 hours, more or less.

fleXYlog settings:
 - speed  = 1200 baud
 - Turbo setting is set to [1] to capture all data samples sent by the PIC chip
 - Y-axis: min  = 1, max  = 1000
 - X-Division  = 8
 - sample period  = 371 secs.
 - Lower plot auto-saved

An earlier prototype-circuit, logging on another day, showed a more regular trigger event:


It took some discussion with a colleague at work before I realised why the boiler was burning gas so often.
Mostly my misunderstanding - I had thought the large numerical display inside the boiler control-panel was the temperature of the water inside the radiators. But it isn't, it's the temperature of the water inside a little reservoir tank inside the boiler that feeds the hot-water taps. I did notice that the gas burner fired-up when the numerical display dropped to around 40, but I didn't connect it with the tap water  -  I thought there was a problem with the radiator circuit.

Anyway, when I pressed a button marked 'Eco' that fixed the problem !

The boiler now only fires-up when it needs to supply hot-water for the taps on demand, instead of heating water for the little reservoir tank that feeds the hot-water taps. The reservoir tank was taking around 3 hours to cool down, before the boiler automatically heated it up again.