Arduino Forum

Using Arduino => General Electronics => Topic started by: WPD64 on Dec 10, 2015, 11:38 pm

Title: 230V AC -> 5V DC
Post by: WPD64 on Dec 10, 2015, 11:38 pm
Hello Everybody

I have very limited skills in electronics and would appreciate some support for this little problem.
How do I turn 230V AC into a +5V DC voltage to trigger a digital-in on my arduino.

It will take a capacitor to flatten the AC and a voltage divider - that much I know.
But I have no clue what capacitances and resistances should be.


In the end I would like to trigger on the fuel pump of my central heating system and record up-time of the burner.

Thanks so much
Sebastian
Title: Re: 230V AC -> 5V DC
Post by: mauried on Dec 11, 2015, 12:33 am
Simplest way is to buy a small 5V plugpak.
Will be cheaper than any alternative which is safe.
Title: Answering the wrong question!
Post by: Paul__B on Dec 11, 2015, 11:08 am
OK guys, he didn't want a power supply, he wants an indication to an input on the Arduino.

When you get the question correct, the answer is an AC optocoupler (PC814 (http://pdf1.alldatasheet.com/datasheet-pdf/view/43364/SHARP/PC814/+33_75UO.vRPbSGwBz+/datasheet.pdf)) (readily available on eBay).
(http://i.ebayimg.com/images/g/jYQAAOSwAHZUNchI/s-l1600.jpg) (http://www.ebay.com/itm/5PCS-PC814-EL814-SHARP-PHOTO-COUPLER-DIP-4-NEW-GOOD-QUALITY-D9-/291572602691)


This (its LEDs) needs to be connected in series with an AC rated capacitor and resistor and the photo-transistor between ground and the Arduino input using INPUT_PULLUP.  The code will detect the pulsating logic level - it can be either de-bounced, or used to synchronise with the AC peaks.

If deemed too risky to construct, "reverse" SSR modules are readily available to perform this function.
Title: Re: 230V AC -> 5V DC
Post by: septillion on Dec 11, 2015, 11:25 am
Yeay, a opto is indeed the way I would use if I really had to use 230V AC as an input. But as the topic starter is not that skilled (otherwise a power supply was easy for him) I would say a simple wall wart or just a USB charger is way saver. And to stop it from feeding the Arduino when that's powered off, just use a 100k or so resistor in line (aka, in series) with that charger. It's a simple plug and go solution :)
Title: Re: 230V AC -> 5V DC
Post by: Watcher on Dec 11, 2015, 01:02 pm
All solutions that involve direct access to mains voltage should only be adopted by qualified and experienced users. In that respect, may be a simple plugpack is safer..
Title: Re: 230V AC -> 5V DC
Post by: WPD64 on Dec 11, 2015, 07:35 pm
Thanks for your suggestions so far!

To be more clear:
I need to detect the ON-state of a 230V driven pump. And the OFF-state. Typical ON/OFF times are 10 minutes. I do not care for nor do I want to even sense the 50Hz.

I'm regularly working on our electrical system and I'm familiar with the hazards of 230V.
Plus I have a physics background so I should know theoretically;-)

The optocouplers appear to be the most elegant solution. If they can be driven by 230V - perfect!

What exactly are those reverse SSR modules? Do they down-convert 230V AC to a low voltage (AC or DC)?

Cheers
Sebastian

 
Title: Re: 230V AC -> 5V DC
Post by: zoomkat on Dec 11, 2015, 07:45 pm
Quote
In the end I would like to trigger on the fuel pump of my central heating system and record up-time of the burner.
A 220 usb wall charger could supply a 5v output when 220vac is present and 0v output when 220vac is not present.

http://www.ebay.com/sch/i.html?_odkw=usb+wall+charger+230&_sop=15&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xusb+wall+charger+220.TRS1&_nkw=usb+wall+charger+220&_sacat=0 (http://www.ebay.com/sch/i.html?_odkw=usb+wall+charger+230&_sop=15&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xusb+wall+charger+220.TRS1&_nkw=usb+wall+charger+220&_sacat=0)
Title: Re: 230V AC -> 5V DC
Post by: WPD64 on Dec 11, 2015, 09:07 pm
A 220 usb wall charger could supply a 5v output when 220vac is present and 0v output when 220vac is not present.

http://www.ebay.com/sch/i.html?_odkw=usb+wall+charger+230&_sop=15&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xusb+wall+charger+220.TRS1&_nkw=usb+wall+charger+220&_sacat=0 (http://www.ebay.com/sch/i.html?_odkw=usb+wall+charger+230&_sop=15&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xusb+wall+charger+220.TRS1&_nkw=usb+wall+charger+220&_sacat=0)
Yes - maybe that's actually the easiest and cheapest way to go - Thanks
Title: Re: 230V AC -> 5V DC
Post by: raschemmel on Dec 12, 2015, 01:40 am
From Reply#1

Quote
Simplest way is to buy a small 5V plugpak.
Will be cheaper than any alternative which is safe.
Title: Re: 230V AC -> 5V DC
Post by: WPD64 on Dec 12, 2015, 10:00 am
From Reply#1

OK - I get it :-)
Thanks to all!
Title: Re: 230V AC -> 5V DC
Post by: Paul__B on Dec 12, 2015, 11:40 am
Hmmm.  Seems my replay was not #2 when I wrote it, else I would not have refereed to "guys".  Apparently some were retracted.

Anyway, I stand by my answer as the neatest way to do it - for an experienced engineer.

If you are fussy about working with mains, then yes, a plug pack is the way to go.

Of course, it must be a reputable brand, as the "cheapies" from China have a bad reputation.  I acquire what appear to be genuine ones (that came with the phone) at Garage Sales, never for more than $1.

And - this (https://www.sparkfun.com/news/1986) was recently posted on another thread.