Go Down

Topic: detect AC voltage (Read 15439 times) previous topic - next topic

libhart

I've got a project in mind wherein I need to simply detect if there is 120VAC flowing through a wire that's in a completely separate circuit.  The easiest way I could think to do this was to put a 120VAC coil relay in parallel with the circuit I want to monitor.  I'd put the 5V from the arduino on the contactor side of that relay, then feed that into an input pin.  If the pin is high, then the 120VAC is on.  But there are so many components out there that I don't know about that I thought maybe there'd be a neater way with only one or two components (like I can with a relay).  Anyone have any ideas?  Thanks as always.

libhart

should probably mention I want to do this on the cheap.  I know there are some neato 5V power supply modules out there, that'd be cool beans but they're like $20 each and I need 4.  Too much.  Thanks again.

PlastBox

Not sure of the exact specs to this type of sensor, but I remember reading about a guy who did this by winding insulated wire around the mains-wire and measuring the voltage induced in the coil. Sorta like a transformer..

I guess you could wind a wire around the 120VAC mains wire you want to monitor, and measure the voltage coming off this coil with a multimeter. Building rectifier is pretty simple stuff, using 4 diodes and a capasitor. (you'll need one as the voltage coming off the coil wrapped around the mains wire will also be AC).

trialex

Coming from a different angle, could you use a small power transformer (like a mobile phone charger) to step the voltage down to 5V, then just detect it on a digital pin?

You'd have to hack up the power pack if you don't have a standard outlet, and I guess you'd have to be confident in your ability to work with high voltages.

PlastBox

#4
Dec 14, 2007, 10:10 am Last Edit: Dec 14, 2007, 10:12 am by PlastBox Reason: 1
Quote
Coming from a different angle, could you use a small power transformer (like a mobile phone charger) to step the voltage down to 5V, then just detect it on a digital pin?

You'd have to hack up the power pack if you don't have a standard outlet, and I guess you'd have to be confident in your ability to work with high voltages.


What trialex proposes seems like a better solution. At least you would be sure it worked without all the hassle of figuring out the amound of windings needed to get a readable voltage. :P Just hack open a 120VAC/5VDC transformer and hook the primary coil up in series with the equipment on the power outlet (break one 120V wire and hook the two ends up to the two pins on the primary coil of the transformer).

But like he sais, working with mains voltage isn't the thing for you unless you know what you are doing! It could very well kill you, and if you survive but don't use the correct equipment or thick/robust enough wires it might burn down your house (again as likely killing you as not). To dampen your christmas DIY spirit even more.. if your house burns down due to you tampering with mains wireing, your insurance company will just say "FU asshat, we ain't paying because you just had to hack apart your mains wire!". That would kinda suck... -_-'

Kids, trialex has a great idea, but the moral here is: play with fire (or rather high voltage electricity) and you could get burned! So unless you are confident in your abilities.. just don't. ;)

Cheater

Meh. 120v is nothing compared to our 240v when it comes to killing power. ;D
I've had a number of nasty zaps.

With Trialex's idea you could even use two halves of a rectifier and you'd be able to detect the phase. :)

PlastBox

Quote
Meh. 120v is nothing compared to our 240v when it comes to killing power. ;D
I've had a number of nasty zaps.

With Trialex's idea you could even use two halves of a rectifier and you'd be able to detect the phase. :)


True, true.. 120V is for girliemen! Are you a girliemaaan? 240V for real men! 8-)

Still haven't managed to get zapped by 240V mains, but I did get a good bang off of the flyback transformer in an old CRT-monitor rated at 30-40.000V. Of course, the current in something like that is dissapearingly small, but my vision still vent black for a fraciton of a second there. Scary stuff. ^^

wayoda

Hi,
sometimes the first ideas are the best ones.
Use the relais - job done!

BTW. Take care with all voltages above 24V. 65V can kill a horse (or your dog, cat whatever..)
Got zapped several times, nothing happend?
Wait until you caught a flew! Zapp! Heart goes out of sync, family cashes the life-insurance.

Just a wakeup call from a electrician...

Eberhard


PlastBox

Quote
Hi,
BTW. Take care with all voltages above 24V. 65V can kill a horse (or your dog, cat whatever..)
Got zapped several times, nothing happend?
Wait until you caught a flew! Zapp! Heart goes out of sync, family cashes the life-insurance.


Ahem, don't mean to be a downer, but what kind of insane worst case scenario is this taken from? U=R*I man.. It ain't the voltage that kills, it's the current. 0.06A to be more spesific. 0.06A across the heart will cause instant heartfailure in most all cases.

U=65V, I=0.06A

R=65V/0.06A

R=1084Ohm.

Correct me if I'm wrong, but to fint a path for the current going throught the heart that has an electrical resistance of only 1KOhm, would you not have to pretty much stab a person in the heart with 2 electrodes?

Again, I might just be an asshat, and I am not trying to be a know-it-all but advicing against working with anything above 24V 'cause it can kill a horse seems a bit like Christian fanatics screaming that you should shun Marylin Manson and Ozzy Osbourne 'cause going to a concert with one of them will surely land you a private reservation in the inner circles of Hell. ;)

wayoda

Hi,
Quote

Ahem, don't mean to be a downer, but what kind of insane worst case scenario is this taken from?

It's from the german laws that where made to prevent severe accidents caused by electrical appliances.

Wikipedia says : http://en.wikipedia.org/wiki/Electric_shock
Quote

It is sometimes suggested that human lethality is most common with alternating current at 100-250 volts, however death has occurred from supplies as low as 32 volts and supplies at over 250 volts frequently cause fatalities.

Worst case? Yes.

Don't miss the next question in our series :
Do I really have to wear a seatbelt when driving slowly?

Eberhard

PlastBox

Ok, so I guess I'm an asshat then.. ::) Heh..

However, what we learned in school (that 0.065A is the border between lethal/nonlethal) and what my multimeter tells me is my hand-to-hand electrical resistance (Mega-ohms, if I'm not mistaken) leads me to think playing with 24V is pretty safe. I=24V/1MOhm = 0,000024A That's 24microamps.. 2700x less current than what might be lethal to a healthy human.

But I might be wrong, and die from playing with a 12V transformer. Then again, I might slip and fall down some stairs, get hit by a car or quite simply try to eat the transformer whole, choke and die. Should any of the above occur, my tombstone will say "Darwinism at work. One less retard in the gene-pool." ;)

Cheater

Best not to tempt fate with mains.
I wouldnt worry about 24v at all though.

The odd thing is that every single time I've been zapped, I've never been deliberately doing anything with mains.
Heck. One time was a 300v discharge from a camera flash which ran off 4 AAs.

libhart

Thanks for all the replies....the voltage discussion was a welcome piece of humor to my morning :)

I'm comfortable around 120VAC, no worries there.  I've been tickled enough to know how to be safe, and yes, it's for girliemen, and I'm a girlieman when it comes to voltage, I'll admit it.  120VAC is as high as I go.  I've been wanting to build a nixie clock for a long time and the voltage is keeping me away.  Something about 180V and DC that doesn't sit well with me.  

And you know, I thought of that charger power supply idea and I wouldn't have to hack up the power supply.  The current here is tiny, so I could just get a female plug at the hardware store, put it on a piece of lamp cord, and attach the other end of the lamp cord to what I want to monitor.  Then when that 120VAC is on, so's the plug.  Then I just plug in the 5V wall wart and attach the other end (I'd chop that off, but's 5V) to my pin.

That windings idea is neat though, and virtually free.  I'll have to check that out :)  THANKS!

kg4wsv

I'd suggest staying away from messing with the 120VAC directly if you've not had some basic electrical (not electronic) training.  If you make a mistake with the Arduino, you fry a $4 ATmega or a $34 board.  Make a mistake with 120/240, you can kill someone, burn your house down, etc.

Not sure where you're getting your power supplies (for $20 each I'm guessing Radio Shack), but in about a minute I found several different 5V regulated wall warts for less than $6 at my favorite surplus places, All Electronics and BG Micro.  For less than $2, you can get an unregulated supply that, combined with a regulator or maybe just a diode, would do the trick.

You do have a junk box, right?  The box/drawer/closet/spare bedroom where you stash all the electronics that don't quite work, but you're not ready to throw out?  Look at the power supplies there.  An oddball 4.3V cell phone charger will be enough to trigger the 5VTTL input on the Arduino.

Go to your favorite discount store, look at off-brand cell phone/iPod chargers.  If it's got a USB jack type connector, that's regulated 5V ready to go.

If I were going to try and do this with 120VAC directly, I'd look at using direct rectification of the AC, add a capacitor to filter it a bit, and interface that with an appropriate optoisolator.  And fuses.  And insulation. And testing.  Lots of testing.

-j


follower

Quote
Don't miss the next question in our series :
Do I really have to wear a seatbelt when driving slowly?

LOL... :-D

--Phil.

Go Up