Powering Arduino from 120VAC mains

I am currently drawing plans for my new project which I call "The Renters Home Automation System". This is a home automation setup that can be installed in a house/apartment simply and easily without having to remove or replace any light switches or receptacles. It is for a friend who rents an apartment.

I want to make a plug-in multi-plug power strip (complete with GFCI outlet) that is controlled by relays which is controlled via Bluetooth module from a pc or home network (the network is a future project). The problem is that I don't want one of my outlets taken up by an ac adaptor to power the arduino.

I have found many different potential solutions online, from building an AC-DC converter to buying a converter module. What do you guys think would be the best solution? What would you do if you needed to power an Arduino straight from a 120VAC main power source?

Any advise would be greatly appreciated. Thanks for your time.

Use a cheap USB power supply.

lg, couka

That would work if the power strips were close enough to the pc, but I'm making 3 power strips for different rooms of the house. None of them are close enough to the pc which is why I want them controlled wirelessly. I would just use an ac adaptor before I run USBs all over the house. What I am looking for is advise or resources for converting 120VAC to 5VDC safely.

What I am looking for is advise or resources for converting 120VAC to 5VDC safely.

If you are having to ask then you do not have the skills to make a power supply. Please buy one.

I'd also suggest a wallwart/cell phone charger/USB supply. You're mounting all this stuff in an outlet box or something, yes? http://www.homedepot.com/b/N-5yc1v/Ntk-All/Ntt-outlet%2Bbox?NCNI-5 Put your relays and wallwart in one of those.

d_rhoades: That would work if the power strips were close enough to the pc

He is taking about a USB power adapter like the ones that come with phones. Apart from that, stay with the recommendations of the other guys.

CrossRoads: I'd also suggest a wallwart/cell phone charger/USB supply. You're mounting all this stuff in an outlet box or something, yes? http://www.homedepot.com/b/N-5yc1v/Ntk-All/Ntt-outlet%2Bbox?NCNI-5 Put your relays and wallwart in one of those.

Thanks CrossRoads. I am a carpenter by trade and have many outlets and boxes laying around. My idea is to put all mains power and relays in an outlet box and use my 3D printer to make the housing for the arduino and bluetooth module. Your idea will work nicely. I will try to find as small of a wall wart as possible. I want the wall wart to be inside the unit so it will not be seen. I found some 120VAC to 5VDC converter modules on eBay but I don't know how reliable they are. I can get this thing to work, but because I build many projects, I would like to start learning how to build my own "project specific" power supplies. Do you know of any good resources for me to start learning this? Thanks for the input.

Grumpy_Mike: If you are having to ask then you do not have the skills to make a power supply. Please buy one.

Maybe I don't have the skills yet, but I will learn. Noone ever learned how to do anything by just sitting around wishing they could. If I don't try, then I never will have the skills.

d_rhoades: Maybe I don't have the skills yet, but I will learn. Noone ever learned how to do anything by just sitting around wishing they could. If I don't try, then I never will have the skills.

In the old days we used to build linear supplies. These days it is cheaper to buy a converter module.

Building these is not trivial even for experienced people.

They make power strips with USB ports. If you have hopes and dreams of relying on this product being used long term by another person, you better familiarize yourself with the word 'liability'.

For $5, it's not worth it d_rhoades. http://www.dipmicro.com/store/DCA-07510 Plug into the barrel jack on your Arduino. Or if using a Promini, get a 5V adapter and connect to Vcc and Gnd.

If all the components are mounted inside something like a small breaker box that will pass electrical inspection, I think you'd be in good shape.

This is a home automation setup that can be installed in a house/apartment simply and easily without having to remove or replace any light switches or receptacles. It is for a friend who rents an apartment....

...I am a carpenter by trade and have many outlets and boxes laying around.

In that case, I wouldn't be worried about replacing switches/receptacles. It's completely reversible. Or, you can get plug-in and wireless home automation components that don't require any electrical work.

I found some 120VAC to 5VDC converter modules on eBay but but I don't know how reliable they are. I imagine most of them are safe & reliable, but if you want to be smart buy from a reputable supplier and look for UL approval. Anything sold by a legitimate US retailer or distributor should be good. (I do know someone who had a house fire caused by a charger... I don't know where it came from.)

d_rhoades: ....installed in a house/apartment simply and easily without having to remove or replace any light switches or receptacles.

....What would you do if you needed to power an Arduino straight from a 120VAC main power source?

Literally and logically impossible, unless this apartment has bare mains wires exposed.

With your declared restrictions, you won't be able to control installed light fixtures. Your plan will only work on plug-in lamps. So at best, some relay-controlled power strips.

They make both a receptacle with an integral USB plug as well as plug in adapters that will offer 6 outlets and just plugs into a standard duplex outlet. there is room inside to put your power supply and wifi. AliExpress offers wifi enabled plug in modules.

you should be able to just buy what you are looking for.

CrossRoads: For $5, it's not worth it d_rhoades. http://www.dipmicro.com/store/DCA-07510 Plug into the barrel jack on your Arduino. Or if using a Promini, get a 5V adapter and connect to Vcc and Gnd.

If all the components are mounted inside something like a small breaker box that will pass electrical inspection, I think you'd be in good shape.

Thanks for the input. These are basically what I am making: http://www.thingiverse.com/thing:522610 http://www.thingiverse.com/thing:752330

I want it to be plugged into any outlet in the house ( I am using 4 feet of a good drop cord for the plug) and be controlled by the pc. The reason I am asking about the power supply is that I want the whole thing to be as small as possible. And I was hoping that I could run everything off of the drop cord that is powering the receptacles. Since noone thinks this is a good idea, I will just run a wall wart for the arduino and plug it in above the drop cord.

dave-in-nj: AliExpress offers wifi enabled plug in modules.

you should be able to just buy what you are looking for.

You are missing the WHOLE point. ALL the things I make can be bought from somewhere. I am doing this because I want to. I enjoy it. Whether its wood or metal, houses or electronics, I love to build things. Isn't that the point of life? To do what makes you happy?

Having the wallwart inside the a ganged box and powered from the same hot line going thru the relays would be fine.
Like so:
Relay controlled outlet box.jpg
If you wanted to add USB power-only outlets you could do that too.
http://www.homedepot.com/s/usb%20%20outlets?NCNI-5
I don’t know what powers the USB in these, but it’d be handy to eliminate having to plug in cellphone wallwarts for folks.
Course, for $13 for the cheapest compared $4.50 for a standard outlet, you’d have to decide if that was worth it.

CrossRoads:
Having the wallwart inside the a ganged box and powered from the same hot line going thru the relays would be fine.
Like so:
Relay controlled outlet box.jpg
If you wanted to add USB power-only outlets you could do that too.
http://www.homedepot.com/s/usb%20%20outlets?NCNI-5
I don’t know what powers the USB in these, but it’d be handy to eliminate having to plug in cellphone wallwarts for folks.
Course, for $13 for the cheapest compared $4.50 for a standard outlet, you’d have to decide if that was worth it.

I like the way you think! That’s exactly what I had in mind. Thanks a ton CrossRoads.

Do to time and cost restrictions, I will first try this project with the outlets I have on hand. Having a USB outlet would be great. I might try one on the second power relay box

I have one more question. Although I am using 5V relay modules that I have for this project, I also have 100 or so 12V relay modules that I got from a friend who installs low-voltage systems. My question is, what is the best way to control a 12V relay from arduino? I was thinking, maybe using transistors wired inline on a 12V power supply ran to the 12V relays. When the transistors open/close it would in turn open/close the relays. Is this how you would do it?

Thanks again for all the advise. You da man!

what is the best way to control a 12V relay from arduino?

Yes like this, the relay and motor are the same thing. Note you need the diode.

From http://www.thebox.myzen.co.uk/Workshop/Motors_1

CrossRoads: For $5, it's not worth it d_rhoades. http://www.dipmicro.com/store/DCA-07510 Plug into the barrel jack on your Arduino. Or if using a Promini, get a 5V adapter and connect to Vcc and Gnd.

If all the components are mounted inside something like a small breaker box that will pass electrical inspection, I think you'd be in good shape.

Here in the states, you cannot have your low voltage inside of the same box as your mains. that means if you have under 50 volts, it cannot be in the same box as your 120 volts without separation.

does not mean it will not work, just that it will not pass inspection.

lots of options on the market, and adding the second (or third) box means you need a cover plate but have a lot of room.

http://www.newtechindustries.com/dvfr2-dual-gang-indoor-recessed-box-power-or-low-voltage/