Checking status of mains feed to boiler

Hi

I have an old back boiler that apparently uses a mains feed to turn on the boiler and a second feed for the pumps, so I can get Hot water (DHW) or Central Heating (CH).

What I am wanting to do is put a sensor of some type onto these feeds and use them to sense when the boiler is turned on and then secondly when the pump for the Central heating is turned on.

From my understanding of the typical wiring it is very low current, so a CT sensor would not do the job, so what would?

The sensing is of Mains potential so I do not want to use potential dividers or full / part wave rectification to feed into a digital input on the AVR.

I have thought one of the Hall effect sensors would potentially do this, but would this be the best way of doing it.

I guess I could use a relay, but this would require further circuitry, and I want to keep as noninvasive as possible.

Any help / pointers would be welcomed.

Jimmy

Robert Wall's picture

Re: Checking status of mains feed to boiler

If you're happy with designing low voltage analogue circuitry, and all you want is indication that a voltage is present (i.e. you can get at a live wire downstream of any switches), you could try a capacitive voltage pick-up. The basic idea is to wrap foil around a few inches of live wire, and sense the resulting small (microamps) current with an op-amp and rectifier, giving you a digital input to use as you wish.

I proposed a closely related idea as an alternative to the a.c. adapter some while ago - the circuit you'd need would be quite similar to this. It was designed for a linear 1.1 V p-p output, you'd need a higher output (reduce the 12 nF capacitor) and to rectify and smooth it ready for the digital input.

manicmoddin's picture

Re: Checking status of mains feed to boiler

Many thanks for this.

If I read the diagram correctly, the non-inverting input goes to the foil, but do I need to use the caps? If so I am confused as in the diagram you have provided, it looks like the mains is connected to the op-amp.

I know you said it would be simular to the diagram you provided, but this one gets me confused.

As for the output of this a presume its going to be a 1.1 p-p sine wave, so I will amplyfy this up and then feed through a simple half wave rectifier circuit.

This sounds plausible to me, but this side of electronics is a long time ago.

Jimmy

Robert Wall's picture

Re: Checking status of mains feed to boiler

OK, if you're happy with the idea I'll develop it a bit further for you. The upper 15 pF capacitor IS the home-made one made from foil and the cable! The cable is one 'plate', the insulation the dielectric, and the foil the second 'plate'.

Are you running your processor at 3.3 or 5 V?

manicmoddin's picture

Re: Checking status of mains feed to boiler

So in simpleton terms the non inverting input goes to the foil?

Its going to running from 3.3v as a jeenode, but I do have 5v available. From the supply I will be using.

Many thanks fir the help so far.

Jimmy

manicmoddin's picture

Re: Checking status of mains feed to boiler

I have cobbled together some "blocks" from my old A-level notes.

Component values I am not sure of, as these are just pulled from a few notes, but this I can work on and simulate if need be.

Does this make sense?

Jimmy

Robert Wall's picture

Re: Checking status of mains feed to boiler

You don't need anything that complicated. Here's my version. The original circuit I referred to was designed to give an accurate representation of the mains waveform for measurement purposes, therefore both the shape and amplitude had to be accurate and the phase shift minimal. Those concerns don't apply here, so we can have a much simpler arrangement. But the basic idea is still there: a capacitor formed by wrapping some foil around the mains line conductor - properly insulated from it of course - feeds into an op.amp whose sole purpose is to provide buffering for the rectifier.

The output should respond within 1 cycle of voltage being applied, and should go off within 2½ cycles (50 ms) of the voltage disappearing. The op.amp is unfortunately only available as surface mount, but it is a dual package, so you can have the two channels that you require using the one package. You will need to keep the wire from the foil to the input fairly short, but you could easily supply power and take the outputs back to your processor using a reasonable length of 4-core telephone or alarm type cable. The two detectors can share R2 & R4. The input voltage to the op.amp is limited by the internal protection diodes, but as the current is only about 1 µA, that should not be a problem. The 330 kΩ resistor is there to limit the current (hopefully to a non-lethal value) if the foil should contact the live conductor. The processor ground should be solidly earthed, and although in normal circumstances there is no danger, you should still treat this circuit and anything connected to it with a degree of respect.

If you want to simulate it and tweak, you can get a model of the LMV358 from the TI website. The simulation is the free PSpice from Linear Technologies.

manicmoddin's picture

Re: Checking status of mains feed to boiler

First off, let me say thanks for this.

I have order a sample of the Opamp (well a few of them to give me chance to blow them up / or use them further around the house / solder badly.

The only bit that is getting me now is the earthing:

"The processor ground should be solidly earthed, and although in normal circumstances there is no danger, you should still treat this circuit and anything connected to it with a degree of respect."

By this are you meaning tie the negative supply of the power supply to the earth bonding point on the boiler?

This seems a little unorthodox to me.

After pondering for a little while and googling "mains sensing", I found the link below:

http://www.brighthubengineering.com/diy-electronics-devices/71915-make-a...

This mentions battery use and tells only to never touch the "antenna" for the risk of a false positive.

Think I should order components for both and give both a whirl as if I can get it for a through hole I would prefer this, but I have done SSOP / TSSOP soldering before, but I try to avoid it when possible. - Just getting used to RFM12B.

Many thanks so far and further any feedback would be appreciated.

Jimmy

Robert Wall's picture

Re: Checking status of mains feed to boiler

I can't quite see how that other article is relevant. It is going to rely on the capacitance of the body that's holding the unit to ensure that there is some current in the "antenna", so unless you want to sit in the cupboard holding it...

I don't understand what your concern is with earthing your processor, can you elaborate?

manicmoddin's picture

Re: Checking status of mains feed to boiler

From my primitive training of mains circuitry (keep as far away from as possible) in my infantry, I was always taught to respect mains and leave it well alone. However now I am an adult (big kid) I still try to live by this rule wherever practical.

The same trainer that gave me this life saving advice also taught me the basics of electronics at an early age and encouraged my enthusiasm. In my early teens he taught me the basics of repairing VCRs, Satellite boxes, but would not let me touch a CRT at all due to the large voltage contained within, but the golden bits of information I still cling onto is as follows:

Discharge the caps before working, there is potential for them to contain lethal amounts of charge.
If the casing is metal , always make sure there is continuity between Earth pin and the casing, unless there is a double insulated symbol on it.

A few years ago we had a spectacular fault in a washing machine that sent live to neutral which resulted in a large flash, bang, and a length of burnt cable behind the machine to the fused spur.

After getting out the friendly electrician to check the full circuit he explained the RCD which apparently had to be changed as it was faulty, and detects a current on the earth line and trips, this is why I am confused with the notion, There would be a potential difference between the Earth line and the positive so there would be current flow on the line surely?

If not this is fine, when it comes to mains AC theory, there is more than meets the eye and my "survival training" is a good basic, but is not the be all and end all.

Robert Wall's picture

Re: Checking status of mains feed to boiler

Most of what you say is correct. (But the RCD doesn't detect current in the earth cable, it infers that current is flowing to earth because it detects the imbalance between line and neutral currents. So in your case the RCD would not detect the line-neutral fault, but it may well have been damaged as a consequence of the fault current passing through it.)

It's a matter of the magnitude of the earth current. The usual RCD is guaranteed to trip in under 30 ms with 30 mA of current (more and less sensitive versions can be found), the current required to operate your detector will be, as I wrote above (you obviously missed it!) about 1 µA.  I'd guess that's well less than one thousandth of the current the most sensitive RCD could ever detect.

The purpose of earthing the processor ground is so that you DO get an earth fault if anything goes seriously wrong on the input side! An earth fault through a piece of wire is much preferred to one through you - that's what "always make sure there is continuity between Earth pin and the casing" means.

manicmoddin's picture

Re: Checking status of mains feed to boiler

Perfect, I did miss that.

Many thanks for all of the above, I will await my samples and the Conversion board for the op amps and will let you know the outcome.

Do we have a reward / thanks system on here? I would say if you need anything from Maplin, give me a shout and I'll see what I can do.

Jimmy

Robert Wall's picture

Re: Checking status of mains feed to boiler

"Do we have a reward / thanks system on here?"

Generally, people just say "thank you" - but if you support the Shop, that will help to maintain this site and keep emoncms.org free.  If you're really keen, I think you need to get in touch with G&T to see if a token donation would be accepted.

Avontech's picture

Re: Checking status of mains feed to boiler

These guys: http://www.eco-eye.com/products-smartPV.html use precisely the same principle of wrapping foil around the cable in their commercial monitoring system to get a 'real' power value combined with their CT's.  They get reasonably accurate, so Robert's proposal to use it in lieu of the AC-AC adaptor is absolutely valid.

 

Robert Wall's picture

Re: Checking status of mains feed to boiler

Avontech

The most recent proposal above, "Voltage Detector", is not suitable as a replacement for the ac adapter - there is no attempt at preserving either phase or amplitude accuracy and the output is rectified anyway - it is purely intended to detect a live wire and feed into a digital input.

The first proposal "Capacitive P.T" does give an accurate representation of the ac signal and is a replacement for the ac adapter. The principle is valid as it is common practice - indeed the only viable way - in H.V. (>70 kV) systems, where the capacitor is usually part of the transformer or switchgear bushing.

manicmoddin's picture

Re: Checking status of mains feed to boiler

I do use the shop, and will continue to do so as the Emontx and the RFM12Pi I ordered that were out of stock, but still made there way here before they were due in, so customer service and value for money is above all expectations there.

Thanks for all the help, it has been appreciated, I would not have got a desired result without the help, even if this does not work, its a good pointer in the right direction. Also leant a new software program to play with.

To all concerned with this, site and the emoncms very well done, it is so nice to get get help when needed and to provide all this open source and free.

Jimmy

Avontech's picture

Re: Checking status of mains feed to boiler

Thanks Robert, I now understand the differences!  (A little knowledge is a dangerous thing :) )

I need to do something similar here, I've currently got both a Pi and an OKG running as as emonbase well as the GLCD and 5 emonTX's monitoring different energy comsumptions (and three PV generators ) and one of the things I want to do is to monitor the boiler cycling - i.e. how often do the h/w and c/h pumps and boiler go on and off so your help here is much appreciated. - Boiler cycling is one of the key issues to energy efficency - some you want to, so you don't!

 

Robert Wall's picture

Re: Checking status of mains feed to boiler

"(A little knowledge is a dangerous thing :) )"

If only that were not true! A while ago, we had on these forums a requirement for using a single supply to both power the emonTx and supply the voltage input. A proposed solution? Obtain a 5 V supply from a transformer and bridge rectifier, and simply connect the emonTx voltage divider across the transformer. The proposer asserted it "works fine" because it gave a steady output on the GLCD, but admitted that he'd needed to include a potentiometer to calibrate it. If you sit down and analyse (and simulate) the circuit, you find ¼ of the bridge rectifier is shorted out by the de-coupling capacitor on the a.c. input bias, and the a.c. wave is unsurprisingly nothing like the original sine wave. At least two of us tried to tell him, but to no avail. At least two others picked up the idea and had to be advised of the shortcomings - I've since used moderator's privilege to plaster a warning over his posts and diagram so that hopefully that idea will sink into oblivion. I didn't want you going down a similar route to wonder why the wrong circuit didn't work "properly".

You need to understand how the emonTx and its library obtains the numbers for rms voltage and current and average power to know why an accurate representation of both voltage and current waves is important.

 

manicmoddin's picture

Re: Checking status of mains feed to boiler

Sorry to drag this back up, but the samples and the adaptor boards (SOIC to DIP) arrived from China.

Foolishly I jumped straight in and build this on Strip board (Lesson 1 learnt). Unfortunately it did not work out of the box when connected to the live only of the power lead feeding the power brick to the laptop.

I have downloaded Spice IV and I am unable to figure out how to add the .MOD file to the simulation software.

Tonight, I think A breadboard version of the circuit is to be made to allow the change of the values of the resistors etc where the comparator is.

 

Robert Wall's picture

Re: Checking status of mains feed to boiler

The .MOD file needs to go in with the .lib and .sub files in the directory below the executable - in my case .../SwCADIII/lib/sub

There is of course no direct galvanic connection to the line cable - the part marked "Foil capacitor" is aluminium (or copper) foil wrapped around the sheath of the line cable. My first thought is if there isn't enough voltage to detect, you need to increase the value of that pickup capacitor, i.e. make the foil wrapped around the line cable a bit longer.

Don't expect to read anywhere near the correct voltage at the op-amp non-inverting input with an ordinary digital multimeter - the presence of the meter will significantly lower the voltage, as will any flux and for that reason you need wash all the flux etc off the board.

 

richmc's picture

Re: Checking status of mains feed to boiler

If you just want an indicator to tell you if the pump and (mains) stat are operating why not use a couple of mains neons? if you want to send the signal elsewhere, then an LDR or photo transistor would give total isolation.

richmc's picture

Re: Checking status of mains feed to boiler

"These guys (smart PV) use precisely the same principle of wrapping foil around the cable in their commercial monitoring system to get a 'real' power value combined with their CT's.  They get reasonably accurate, so Robert's proposal to use it in lieu of the AC-AC adaptor is absolutely valid."

The eco eye foil only gives a phase reference for their device, you have to program in what you think the mains voltage is. I have one of these and can say it's useful as an indicator no more. It cannot give you real power and is is not even reasonably accurate, showing that I'm importing power when using Robins Mk2 whilst the consumer meter says I'm not. I pointed this out to the manufacturer but never got a satisfactory answer.

Robert Wall's picture

Re: Checking status of mains feed to boiler

Rich, all that was wanted in this case was a 'live' indication. Originally, it had to be totally non-contact, so that ruled out even a neon.

And I'm not surprised you never got a satisfactory answer. Remember Nanny knows best, AKA the Not Invented Here syndrome.

The capacitive voltage 'transformer' - not the detector version - when screened and calibrated might even be more accurate, in terms of phase shift and linearity, than a wound transformer. As I've pointed out previously, the technique is absolutely standard at high voltages where a resistive dropper is totally impractical, and a transformer prohibitively expensive.

Eco Eye are probably using the foil pickup only for the phase because of the difficulty of instructing Joe Public in how to screen and calibrate it, and my guess is all they get and all they're interested in after minimal processing is a square wave with zero crossings moderately accurately aligned with the mains voltage.  In your case, it seems they might not be. If you've a high enough impedance 'scope probe ( x 100 ?) then you might be able to check that.

richmc's picture

Re: Checking status of mains feed to boiler

"And I'm not surprised you never got a satisfactory answer. Remember Nanny knows best, AKA the Not Invented Here syndrome".

Eh? not sure what you are trying to say here Robert, My contact with them was on the lines of the eco eye constantly shows I'm importing energy (when using the Mk2) so it doesn't "mimic" the action of the meter and was there any way to do so. It seems there are many posts on this site striving for that. I appreciate you get what you pay for and for £80 it's a useful enough indicator.

Robert Wall's picture

Re: Checking status of mains feed to boiler

I mean they (Eco Eye) won't do anything about it because in their eye (ouch!) it's good enough. And indeed for most purposes it probably is. Here we're striving for picopence perfection. The average Joe Public probably isn't concerned to that extent, and that's where their market is.

manicmoddin's picture

Re: Checking status of mains feed to boiler

Once again, many thanks Robert, learnt another lesson today... Check the components before, and after soldering, I mixed up the resistors forming the potential divider prior to going into the non inverting input.

Feel a little silly now, but its all good to learn and admit ones mistakes.

Its all working now and here is the code I have used to test the system, as you can see there is a minimum of 1 second anyway in this, but in testing the LED lights up quicker than I can notice it after putting power to the testing wire.

const int ledPin = 13;
const int tstPin = 3;
const int samples = 5;

int sample;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
  pinMode(tstPin, INPUT);
}

void loop() {
  sample = 0;
  for(int x=0; x<samples; x++){
    sample = sample + digitalRead(tstPin);
  }
 
  //decide if on or off
  int output = sample/samples;
  digitalWrite(ledPin, output);
  Serial.println(output);
 
  delay(1000);
}

I hope that this will come in useful to anyone else wanting to do the same sort of thing, just got to make the circuit smaller now, and then interface to boiler and pump.

Many thanks

Jimmy

 

 

Robert Wall's picture

Re: Checking status of mains feed to boiler

Out of interest, what was the problem that made you read the input pin 5 times in succession in order to decide that it was on or off?

manicmoddin's picture

Re: Checking status of mains feed to boiler

When done in a loop with no delaysI would sometimes get a digital 0 instead of  digital 1 and it seemed to form a pattern of 11110
11110
11100
11110.

This is why I read it 5 times to give a good average and go with that, when I find a suitable place to interface with the wireing for the boiler and pump ( looks like I need to lift floor boards or use the controls in the kitchen) I will play once again.

I would imagine that a larger smoothing cap would also cure the problem, but this as easier (due to not having any spare caps) and as a proof of concept I was happy with the result.

Also as a red herring, I noticed through testing this evening that there does not need to be a load on the wire, so is perfect for other monitoring too. How long does the sticky on electricians tape last?

I can see this getting tied into lights and all sorts to give various options within the field of home automation. Ooh the mrs will love me wanting to take all the floors up hahaha.

Jimmy

 

Robert Wall's picture

Re: Checking status of mains feed to boiler

I'm not sure what's going on there - it might be as you say that the dips on each cycle are going low enough to register a zero. The voltage should stay above 2 V (the 0 - 1 transition) so if it's going back to a zero, it means the voltage has dipped below the 1 - 0 transition at 1 V. That in turn means that something isn't right - have you cleaned all the flux off around the pickup input R1, R3 and the NI input of the op amp? that's fairly important with the very high impedances here. You may also need to increase your pickup capacitor - the foil needs extending a bit.

You're right, there doesn't need to be a load on the wire because this is picking up voltage, not current.

Tape sticky - it seems to depend on whether you get any traces of grease from your fingers on it when putting it on. Try cable ties instead, or maybe self-amalgamating tape (though I've never used any).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.