There are a lot of methods to power an Arduino from a large range of voltages:
- USB cable from PC or from a phone charger or an USB hub
- step down converters
- step up converters
- switching power supply
- batteries (connected to the power jack or USB or to Vin)
What I can't seem to find is a small 220V-5V converter. I'd like to put an Arduino in the wall, under a light switch, so size matters.
The last resort option is to open a 5V phone charger and replace the metal prongs that go in a socket with two wires, and replace the USB socket with another pair of wires that go the Arduino board, but still, an Arduino Pro Mini or an Arduino Nano is smaller than the phone charger.
-
5Check your insurance if you are covered in case of fire caused by your construction.jippie– jippie2014年03月19日 19:13:52 +00:00Commented Mar 19, 2014 at 19:13
-
@Josef Your comment looks like a question. If you have a new question please post it as such.Nick Gammon– Nick Gammon ♦2018年07月03日 12:19:56 +00:00Commented Jul 3, 2018 at 12:19
14 Answers 14
The last resort option is to open a 5v phone charger and replace the metal prongs that go in a socket with two wires, and replace the usb socket with another pair of wires that go the arduino board, but still, an Arduino Pro Mini or an Arduino Nano is smaller than the phone charger.
You will probably have to do something like that.
Because of the nature of conversion between AC and DC, there has to be some large parts.* I'm not going to go into the specifics here. There is usually a diode bridge (because AC waveforms reverse the current ~60 times a second) and a transformer (to lower the voltage for the diode bridge). They almost always include a regulator and a capacitor to make sure voltage is exact and it outputs a "clean" power supply.
*Switching power supplies, although considerably more expensive, are a lot smaller and more power efficient.
This adapter seems to be the most compact adapter I can find for 220V. You'll never get something near the size you are desiring, even with a switching power supply. I don't know the size of the Amazon adapter I gave a link for, but in the US (120V), iPhone chargers are very small and they should fit in a standard depth outlet box (with a little room left over for relays and such). If you really need to get everything smaller, I recommend using a ATtiny chip.
How I recommend connecting this:
I would avoid ripping this apart at all costs from a safety perspective. It would be really easy to send 220V to your Arduino if you're not careful. If you absolutely have to, you might want to coat it with some non-conductive epoxy or other coding. Note: this may act as a thermal insulator, therefore reducing the lifespan of the part. You should just coil some wire around the prongs, and then melt a little solder onto each of the terminals. Then, cover that with electrical tape and pigtail (with a wire nut) into a source power line. Note: you probably are doing wiring that could be illegal in your area. Check your local building codes before attempting this.
After that, attach a USB cord to the socket and to the Arduino or the ATtiny/ATmega328 chip 5V/GND input (of coarse, after cutting and stripping one end of the USB cord). I would also, after finalizing all the code and circuitry, seal that with some epoxy or somehow add it to an enclosure to make sure you don't fry your Arduino if a loose wire touches the Arduino circuitry.
If you don't feel safe doing any of the above, don't do it. You can live without a Arduino light switch.
That being said, happy hacking! :P
-
I don't think you can get much smaller than this for a mains -> 5V converter that is isolated from the mains. There are tricks to get non-isolated low voltages, but they are not generally safe.Cybergibbons– Cybergibbons2014年03月19日 16:15:03 +00:00Commented Mar 19, 2014 at 16:15
-
Thank you, I will order a few of these adapters and post here with the results.vlad b.– vlad b.2014年03月19日 18:49:01 +00:00Commented Mar 19, 2014 at 18:49
-
@Vladb If you haven't ordered them already I would suggest asking a question on Amazon for the dimensions. Editing my post to suggest how to connect those to the wiring and your Arduino.Anonymous Penguin– Anonymous Penguin2014年03月19日 18:58:25 +00:00Commented Mar 19, 2014 at 18:58
-
@Vlad Updated post.Anonymous Penguin– Anonymous Penguin2014年03月19日 19:13:13 +00:00Commented Mar 19, 2014 at 19:13
-
No. This is big because it is a linear power supply where the transformer operates at line frequency and so must by physically larger. It's also unregulated and poorly filtered. Switching power supplies as have largely taken over in the past few years are much smaller, because their transformers are operated at the higher switching frequency.Chris Stratton– Chris Stratton2014年08月05日 16:25:45 +00:00Commented Aug 5, 2014 at 16:25
I can suggest you to try this : AC DC Step Down Converter
It is as small as the Apple's tiny cube, and it can be placed inside of a wall easily. (I'm personally using this with an arduino micro)
-
Thank you for the information, i have ordered a few of these too.vlad b.– vlad b.2014年04月04日 06:11:37 +00:00Commented Apr 4, 2014 at 6:11
-
2Im not quite about things that go to the mains from aliexpress. Anyone used that thing?Matze Strawberrymaker– Matze Strawberrymaker2015年07月19日 23:46:40 +00:00Commented Jul 19, 2015 at 23:46
Nowadays, most smartphones come with a charger that is linked to the USB plug of the phone.
The charger for my HTC says: 5V, 1A, I guess this voltage must be regulated (but I haven't checked it has the charger is sealed).
enter image description here
The charger itself has a female USB socket on which you can plug any USB cord to link to your Arduino.
IMPORTANT! I have never tried it myself! I would not bet my life on it! It would be wise to check the output voltage is well regulated.
-
1It's regulated. I've cracked those units open to use the circuit inside in other projects. It's amazingly compact.futurebird– futurebird2015年08月26日 08:18:52 +00:00Commented Aug 26, 2015 at 8:18
-
Simplest and cheapest solution...if it's good enough for Samsung et al then it's...luke_mclachlan– luke_mclachlan2018年07月21日 19:33:38 +00:00Commented Jul 21, 2018 at 19:33
I use this one, 5V, 3W, very small, and only 3ドル on Aliexpress. http://www.hlktech.net/product_detail.php?ProId=54
-
Using this, following safety tips at skippy.org.uk/quick-look-at-the-hlk-pm01Colin– Colin2018年12月27日 08:29:33 +00:00Commented Dec 27, 2018 at 8:29
-
It's 34mm x 20mm x 15mm, which is very small.Colin– Colin2018年12月27日 08:35:52 +00:00Commented Dec 27, 2018 at 8:35
The smallest is probably a plug-in USB charger such as Apple's tiny cube. The cheapest is bound to be a ~9v (output) wall-wart scrounged from the lost and found in a tourist's/traveller's hotel.
There are small board-mount AC/DC converters like this one http://www.digikey.com/product-detail/en/BP5063-5/BP5063-5-ND/658569
-
The website says it only works for 120VAC, but the OP says they want a 220V adapter. I guess the title is a little misleading... and there might be another model for 220V.Anonymous Penguin– Anonymous Penguin2014年08月05日 16:07:57 +00:00Commented Aug 5, 2014 at 16:07
-
true. i don't know how much power OP needs but one of these similar ones might work. digikey.com/product-detail/en/BP5041A5/BP5041A5-ND/658559 , digikey.com/product-detail/en/PBK-3-5/102-3106-ND/4332643 , digikey.com/product-detail/en/PBK-1-5/102-3101-ND/4332638DrewTM– DrewTM2014年08月05日 17:17:06 +00:00Commented Aug 5, 2014 at 17:17
-
1Any good idea is worth investigating. It might be for 110V but now I can look for the 220 version, if there is such a thing. Thank You! DrewTM - you posted right before I did. Thank you again for the links!vlad b.– vlad b.2014年08月05日 17:17:16 +00:00Commented Aug 5, 2014 at 17:17
An obvious answer has been omitted which is: transformerless power supply. If your average power requirements are low (<10mA) then this is the most compact way to achieve the desired voltage.
For an in-depth study see: http://ww1.microchip.com/downloads/en/AppNotes/00954A.pdf
Another solution: jeelabs.org /2011/11/27/ultra-low-power-supply/
Some limitations:
- safety - NONE - your circuit might now be floating at line voltage
- heat dissipation - calculate here: www. daycounter.com/Circuits/Transformerless-Power-Supplies/Transformerless-Power-Supplies.phtml
- low current - no servos or relays
- voltage fluctuations on the line might affect the circuit
-
Best answer, much smaller than other options.bigjosh– bigjosh2015年07月20日 04:31:23 +00:00Commented Jul 20, 2015 at 4:31
wanted to do a similar thing and I found and just ordered these:
http://uk.farnell.com/recom-power/rac03-05scr-277/conv-ac-dc-3w-90-305v-in-5v-out/dp/2289701
A fully sealed power supply, disk-shaped, 5cm diameter and 11mm thick. THey are available in 3.3V, 5V, and 12V. They are designed to be put inside walls or behind switches.
-
That's pretty neat. The product is discontinued anyway. Is there a version around that can output 2A instead of 600ma?Codebeat– Codebeat2016年09月06日 20:27:40 +00:00Commented Sep 6, 2016 at 20:27
Try an LED driver. Their typical output is 11.8V DC, which is in perfect specs for the Arduino. You can find them nowadays in all shapes and sizes, round or square, low profile or boxy. A 500ma version (6W) is more than enough for your needs.
What if you replace the nearest outlet with some kind of USB Wall Socket and attach to that (either through a standard USB plug, or inside the wall) ?
This looks like the smallest and cheapest one from all of the above mentioned: http://www.ebay.co.uk/itm/AC-DC-Power-Supply-Buck-Converter-Step-Down-Module-5V-700mA-for-Arduino-U-/121355318138
-
1It would be helpful if you mentioned some of the details of that converter in your answer.The Guy with The Hat– The Guy with The Hat2014年10月28日 16:18:40 +00:00Commented Oct 28, 2014 at 16:18
-
Ordered a few of these, will add comment with the results when I get them.vlad b.– vlad b.2014年11月10日 18:07:43 +00:00Commented Nov 10, 2014 at 18:07
Nov 2016 Here is a list of compact PCB mounted power supplies that are small (~50mmx25mmx20mm) from Mouser:
These all take in 120-240VAC and provide outputs in the range of 3 - 5 vdc with varying options for current.
The 5V 1A from Meanwell (IRM-05-5) looks like a good deal at 8ドル.52 each. http://www.mouser.com/ProductDetail/Mean-Well/IRM-05-5/?qs=sGAEpiMZZMuWiaalG5TUgH52QN1%252bIKAVmGC9ENLDVf688EuOMfqROg%3d%3d
Paul.
-
Wow, that's a nice one. Does it have output galvanically isolated from input (i.e. "can I touch the board powered by this thingie")? The datasheet mentions resistance between input and output and also has a couple of coils on schematics, but I'm still not sure.Equidamoid– Equidamoid2017年07月01日 21:09:00 +00:00Commented Jul 1, 2017 at 21:09
-
1The datasheet quotes "Isolation Class II". See: en.wikipedia.org/wiki/Appliance_classes#Class_IIPaul Carew– Paul Carew2017年07月02日 07:11:41 +00:00Commented Jul 2, 2017 at 7:11
It's entirely dependent on whether or not you want to isolate the circuit from the mains. You could use a drop resistor a rectifier and a 5v zener diode but I do not recommend this if you are a hobbyist, in fact I don't recommend this at all, but it is done by some manufacturers with appropriate circuit protection.
Explore related questions
See similar questions with these tags.