Converting 220 AC to 5 DC

hi
you know where I can buy a transformer with an output voltage proportional to the input?220 to 12

All transformers have output proportional to the input, that's how they work.
Power In = Power Out (less some losses due to wiring).
So 120VAC, 5Amp In (600VA) = 12V, 50Amp out for example.

If you want AC to DC, that's a wallwart or an adapter supply like one of these:
220VAC to 5V DC
http://www.mpja.com/5-Volt-Adapter-Power-Supply-4A-Phihong/productinfo/30335+PS/
120VAC to 5V DC
http://www.mpja.com/5-Volt-DC-Plug-Power-Supply-4A-Regulated/productinfo/18520+PS/

Check the ratings of what you're buying and also the plug type for your country.

You can also get board-mountable AC/DC converters
http://www.digikey.com/product-search/en/power-supplies-board-mount/ac-dc-converters/4325929?k=recom&k=&pkeyword=recom&pv87=2&pv1525=62&FV=fff40042%2Cfff80229&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25

so, if the input varies then the output varies even it or remains constant at 5V?

With the 5VDC output parts, the output stays at 5V, while the input can vary as noted:

100-240 VAC 50/60Hz
or
90-132 VAC 60Hz

This can happen because the input is converted to DC, chopped up into a square wave at very high speed, and filtered to become the DC output. If not much current is being drawn, the square may have low duty cycle (high vs low time) to keep the output filtered and level at 5V. If more current is being drawn, the duty cycle increases to keep the output at 5V. If more current is drawn than the circuit can supply, the output voltage may drop, or the output may be shut off to prevent damage from overcurrent until the current demand is decreased.

thanks
if I don't convert in dc,it is possible to obtain a voltage output that varies to vary the input?
if yes, where can I buy it?
Thanks a lot

if I don't convert in dc,it is possible to obtain a voltage output that varies to vary the input?

You are failing to understand. Even if you convert it to DC ALL transformers and UNREGULATING converters to DC change when the input changes. That is the way they work.

So ANY transformer will do that.

If you have a transformer that gives 5V out for 120V it must have a step down ratio of 5:120 or 1:24. So if you put 100V into it you get 4.166V out. If you put in 200V you get 8.33V out. If you put 5V into the 5V winding you get 120V out.

You're confusing the poor OP - so far as I understand he's very inexperienced and just wants to power an arduino...

So while all this discussion is helpul and accurate he'll need to learn a lot to interpret it...

see my post #21

regards

Allan

I am wondering if what he needs is a 9 V supply to go in the power socket.

Hi,
I know it is really old topic, but in my humble opinion it was not fully answered or at least no consensus was reached. :stuck_out_tongue:

I think, that there might have been slight language gap, but point of the question was probably in terms of "how can I power my Adruino from mains cables dangling from the ceiling going to my ceiling lamp".

As this is a question which I am facing right now and the main problem is space as it would be quite a challenge to fit "high" transformer with other components under lamp cover. :frowning:

Of course safety is also concern, as hooking up just four diodes and a resistor between mains and Arduino can possibly produce "mixed" results. :wink:

So is there some small, safe solution to convert 220AC to 5DC?

Thanks,
Libor

LiborVojtek:
So is there some small, safe solution to convert 220AC to 5DC?

Absolutely, they look something like this.

LiborVojtek:
So is there some small, safe solution to convert 220AC to 5DC?

Yes, go to a certified electrician and ask him what can be done, and do not do that yourself, besides that the quality of the DC may be lacking, you may cause a fire in your house or kill yourself. And even if it costs a couple of hundred €, your life is still worth more.

LiborVojtek:
I think, that there might have been slight language gap, but point of the question was probably in terms of "how can I power my Adruino from mains cables dangling from the ceiling going to my ceiling lamp".

Buy a replacement extension cord socket end, attach it to the dangling wires (which are generally a bad thing to have about anyway!), and plug a cell phone charger into that socket

allanhurst:
Good grief!

  • well it might - I haven't flogged through the sums.. and it would be terribly inefficient even if it did. If ( a quick glance ) it needed to supply 300mA, your resistors would be dissipating 80 + watts to deliver only 1.5 watts into the 5v load!

BUT it means there's live mains all over the place, with serious safety issues.

Please buy for a couple of quid/euros etc a standard plug-mounted device from ebay or any hobby shop.

Be sure to get a regulated one.

regards

Allan

Having seen the inside of an unbranded wall-wart that came with an expensive small monitor recently,
I would advise against ever using any mains power supply from eBay unless you have destructively
examined it for safety... You literally risk death with these cheap PSUs.

My supply had only the enamel on the enamelled copper wire separating 240V mains from the low
voltage side in the (tiny) transformer. The interwinding insulation didn't quite reach the edge of
the primary, and was inadequate thickness anyway. Shocking.

BJHenry:
Absolutely, they look something like this.

I honestly never saw such a small adapter, it might be the solution after getting rid of those pesky plug sticks. :wink:

dochawk:
Buy a replacement extension cord socket end, attach it to the dangling wires (which are generally a bad thing to have about anyway!), and plug a cell phone charger into that socket

Well, the problem is, that I want that ceiling lamp, too. So a socket and phone charger would not do and also I want to pack everything under the round cover of that lamp (10x4cm).
(The cables are not actually dangling around, they are currently connected to said lamp. :wink: )

Sacharja:
Yes, go to a certified electrician and ask him what can be done, and do not do that yourself, besides that the quality of the DC may be lacking, you may cause a fire in your house or kill yourself. And even if it costs a couple of hundred €, your life is still worth more.

I have intermediate understanding of electricity so killing myself is quite unlikely.
(Always turn off Your breakers before You start sticking screwdrivers to cables.)

Also fire should not be a great risk as there would not be so much of flammable stuff around.
(Always turn on Your breakers after You stop sticking screwdrivers to cables.)

Also also couple hundred € for essentially USB charger adapter is quite high.
(Never allow a car dealer or car mechanic talk You to something You do not want or need.)

I have intermediate understanding of electricity

I don’t think so. Those things are an elementary understanding at best.

Grumpy_Mike:
I don’t think so. Those things are an elementary understanding at best.

At the one hand, I do not think, that product awareness is part of understanding of something.
At the other hand, I do not think that there is so much to electricity other than VIR and PIV.

Nevertheless, BJHenrys answer probably concludes my question with a small problem of Australia been quite few kilometers out of reach for me. :wink:
So I will have to find some other seller.

Sure, that was just an example. You should be able to find that sort of thing in whatever country you're in.

LiborVojtek:
(The cables are not actually dangling around, they are currently connected to said lamp. :wink: )

It just occurred to me . . . there are socket extenders for lamps that screw in, have an AC outlet on their side, and then provide a bulb socket.

I haven't seen one in years, but that could be a clean solution.