working out when mains power is active

craigcurtin

Senior Member
Guys, We use Off peak electric here for our hot water. I want to know when the power comes on and goes off and use it to cycle a pump on and off on a timed basis.

I already have a 40x with RTC and 24LC256 up and running and have a 240v relay through an opto isolator board. All works fine.

I have been reading some of the threads re mains current sensing etc and not being an electronics hardware guy my eyes glaze over a little.

Anyway it struck me (and this must be too simple to be right), if i put a regulated wal wart (say 3V DC) onto the same main circuit and then hooked its +ve output into an input on the 40x, i should be able to sense when that goes high, once the mains turns on - am i missing something here or will this just let out the magic smoke of the 40x ?

regards

Craig
 

Dippy

Moderator
You could do that (assuming I understand correctly).. via a resistor maybe?
I would use an opto-coupler which would give me more peace of mind.

There are other methods but some might not be appropriate for inexperienced users who should avoid mains like the plague.

You could also use inductive methods.
 

MFB

Senior Member
Charger/mains drop-out detector

The wallwart sounds ideal for non-harware types. After all, you probably use one to charge your cellphone etc without coming to any harm. You could use one to charge a battery supply for your PICAXE logger and detect the status of the incoming supply via a potential divider. Let me know if you need more details and I'll try and figure out how to post a schematic.
 

Michael 2727

Senior Member
Not exactly sure what you are trying to achieve here
but the Hot Water and some Heat Bank type heaters
are the only thing that should be running from the
OFF Peak circuit. ( and the discounted KWh rate )
Thats why they have their own KWh Meter.
There may be a few other things that are allowed
to use the OFF Peak system, I would be checking
the regs first. The Util suppliers can get very nasty
and have huge fines/jail if you go against the regs they set out.
 

craigcurtin

Senior Member
Why i am doing this

We have a heat pump hot water system that is super efficient to run. We have a 2nd hot water tank to provide extra capacity. Basically when the heat pump starts up i want to run a circulating pump for two hours - this will take the hot water already in the top of the Heat pump tank, and circulate it into the 2nd tank. It only takes about 2 hours to bring everything back up to 55 degrees C - eventually i will monitor the temp and turn it off when it reaches this mark. In the meantime i want to be able to run the pump for the first two hours when off-peak kicks in

I have checked and this is within the regs for off-peak with my supplier.

So is it possible to just run (say 3v) from the +v on a regulated wall wart into a picaxe input pin or do i need something more fancy ?

regards

Craig
 

Michael 2727

Senior Member
A wallwart or similar setup would be the simplest way
to go, I'd use that and an 08M to monitor water levels
or whatever and an SSR (solid state relay 40A to 60A or
so to turn the pump on) Always over rate the SSR, saves
failure/replacement costs in the long run.
And Zero crossing/switching types work better with motors etc.
An LED output is all you need to drive the SSR input, 10mA
to 15mA should be plenty.
Good luck :p
 

Dippy

Moderator
Here are 3 suggestions using the wart.

My pref (if using Wart) is op 3 usng o/coupler. Low power and keeps PICAXE isolated from the Wart. Better check pin numbers as I did this in a rush.

Version 1 which you suggest might also need res to ground (say 10k) on the wart side to discharge the wart's caps to make the 'off' a bit more solid. (I forgot to include in drawing).

You can fiddle with component values as they are just a guesstimate.


How experienced are you with mains stuff?
I'm only asking as there is a way to use an optocoupler +diode + cap + res direct. Component types ARE VEY important however, so no crappy old stuff out of the dusty drawer and it's not to be taken lightly. Usual safety caveats etc. MMm.. maybe stick to wart method after all, but it potentially wastes a socket.
 

Attachments

hippy

Technical Support
Staff member
For 'cheap and cheerful' I'd go with option one. A diode and a cap would also allow an AC walwart to be used. I'd add a pull-down R to help discharge the cap ( or any in the PSU ) when voltage goes and it helps avoid problems should the walwart be unplugged or fail. With the right R any voltage PSU can be used.

Option 3 is my prefered design.

Option 2 is practical but draws unnecessary current. Admittedly not a lot. You could with the usual caveats use a mains powered relay and skip the walwart.

Direct mains monitoring ( relay or opto ) I'd not recommend but entirely possible and practical if you know what you're doing and know about isolation circuits and layout.

I'd start with Option 1 to prove it works, then move to option 3.
 

Technical

Technical Support
Staff member
Options 2 and 3 should not have their 0V rails linked - they are supposed to be isolation circuits!

A bulb/LED and LDR at either end of a tube can also make a cheap and cheerful optoisolator for this type of use.
 

Dippy

Moderator
I was wondering when someone would spot my deliberate mistake :)
Got to keep you on your toes.

... but little optocouplers look so much more pro.
 

hippy

Technical Support
Staff member
... and what if the bulb gets hot and the tube catches fire and the world ends and ...

:)
 

Dippy

Moderator
... if you can't afford 30p for an opto.

Mind you if Craig is fully qualified in cardboard tube technical assembly then his home insurance will be OK.
 

craigcurtin

Senior Member
Thanks for all the replies guys !!!

Much appreciated. As my electronics skills are basic, i will go with Option 1 to start with, i have to get into some LDR stuff for another project so may then modify it further down the track

Will report back on the progress after the weekend.

regards

Craig
 

andrew_qld

Senior Member
A bulb/LED and LDR at either end of a tube can also make a cheap and cheerful optoisolator for this type of use.
We used this arrangement at work to sense when a 2MBit data link dialed up. The equipment had a green indicator LED in it and my Chief Engineer tried a number of LDR's until he found the one that wokrd best. This was run to a transistor and dial out alarm.
 
Top