0

I've found a lot of tutorials about how to use an Arduino to control power supplies to lamps and things like that using a relay. However, I also need to power the Arduino with the same power that is going through the relay.

In other words, I'd like to be able to plug my device into the wall. The device would use the 110VAC to power the Arduino. My device would also have some outlets that I could plug something into. The Arduino would be connected to a relay and would decide when to enable electricity to the outlet. The important part being that I would like everything to be on one power source.

Do I need to have a step down converter to transform the power, in addition to the relay? Is there some sort of break out board that has both of these functionalities in one board? What is the best way to do this?

3

In these cases where power must come from mains, my preferred solution is to buy a cheap phone charger+usb cable from ebay. They are sealed and safer than do-it-yourself solutions. The power adapter is barely larger than a normal plug for mains.

If you absolutely need to reach the arduino with only one cable, you can still use the solution i gave, only use a power cord to reach the contraption, then use a socket expander for mains and very short usb cable.

  • I hope I'm not misunderstanding this. I think that would be a great solution to just power the arduino and I do that already. However, I also need to use the power from the mains to also run through the relays so that it can power anything that is plugged into it. One cable going in to power the arduino and one outlet going out that a regular plug can be plugged into. – sncrmck Oct 20 '15 at 20:34
  • My proposal is the following. Use a box for the contraption - it deals with voltage levels that can be fatal, so it should be boxed anyway. Have a power cord going inside the box. Inside the box have a socket splitter (I don't know about where you leave, but at least in several countries in Europe they are pretty common). In one of the 2 sockets plug the phone charger, to power the arduino over usb. Use a relay shield on the Arduino. In the other mains socket, plug a power cord, going out of the box, through the relay. I't not optimized for space, but it should be pretty safe and sturdy. – Igor Stoppa Oct 20 '15 at 20:57
  • And relatively cheap. I am not aware of shields that would be both power supplier and relay. – Igor Stoppa Oct 20 '15 at 20:57
  • That's perfect!! Thank you so much for the help! – sncrmck Oct 20 '15 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.