3

I'm going to be using an Pi-3B+ to switch an AC and a DC device using one of the popular relay modules. This whole project is going to go in a custom screw-together project box that will have AC input and output sockets Like this:

AC In AC Out

My question is how to power the Pi? I'll have AC inside the box and I guess I could wire up a standard AC receptacle and plug in one of Pi USB PSUs. But, that'll take up a lot of space and just feels wrong.

So I'm thinking about either:

  • Using a generic 5V DC PSU like the Meanwell RS-5-15 (3A). From another project I already have a few micro-USB pigtails so I would power thru the USB port.
  • Cracking open the "wall wart" USB PSU I'm current using to power and wire it directly to the AC lines inside my project box? Is this a horrible idea?

Both options would be powering thru the micro-USB on the Pi. I don't currently have the MeanWell, but it's going to be more than about $10 shipped.

4
  • I don't understand how the links you gave relate to your comment "use a switcher, no pig tails". Actually, I don't really understand that comment either. If I use the small switch-mode PSU, why can't I use a bare-wire to micro usb connection (I'm calling this a pigtail) to the Pi?
    – kbyrd
    Commented Jul 22, 2019 at 1:56
  • 1
    sorry answer too brief. I use switching PSU, eg 200VAC to 5V 3A PSU for Rpi. Usually I use DC/DC short cct proof voltage regulator to step down output of a 200VC/12VDC 3A switching PSU to 5V, for Rpi. This way I can adjust the voltage to 5.25V and monitor voltage with the LED display - raspberrypi.stackexchange.com/questions/98715/…
    – tlfong01
    Commented Jul 22, 2019 at 2:24
  • The voltage regulator is shown in the middle picture of the link above. I have not shown the Meanwell 200VAC to 12V DC switching PSU. I use 12V input to DC/DC step down to 5V, because 12V input can be replaced by LiPo 11.1 votlage power bank, or UPS with 12V output. My other links are examples of how I use well grounded metal cases to house the relays for safety of avoiding electric shock
    – tlfong01
    Commented Jul 22, 2019 at 2:31

2 Answers 2

3

You've asked a reasonable question, though it might be considered a bit "off topic" for Raspberry PI. The question is more along the lines of "construction techniques" for electrically powered devices, but you'll get some answers here anyway. You should also understand this:

Many of the answers to questions on wiring AC mains circuitry that you'll see here will "factor in" the individual author's concern over directing an inexperienced contributor in working with potentially lethal AC mains voltages.

If you have experience working with AC voltages, you may find these safety warnings pedantic, or overly tutorial. Absent professional credentials or certifications, you could help us by simply stating your experience: "I've worked with 220 VAC circuits and devices for years, and consider myself knowledgeable in all aspects of safety."... or words to that effect. If you're not experienced, please heed the warnings & do some reading on your own.

If you want a quick read on some of the fundamentals of working with AC mains voltages, there's a 2-part tutorial offered here.

All of that said, I'll offer a few thoughts on your questions below:

  • Using a modular PS like your "Meanwell" unit is a reasonable choice. The "pigtails" will connect to the AC input on one side, and your USB connector on the other. Make sure you get a unit that conforms to USB specs (for voltage, line and load regulation), and has sufficient current capacity to power your RPi. Some over-capacity on the PS current output is fine; RPi will draw only what it needs.

  • Opening a wall wart may be a bit less expensive, but may be a crapshoot because you won't know what you have to work with until you've broken it open. At that point, it may not be useful for anything else. But it's certainly worth a try if you don't mind a sacrifice in the quest for knowledge! Again, verify the wall wart is spec'd sufficiently to support your RPi.

  • Power (current) requirements for the various RPi models are listed here.

  • Shop carefully for your electrical hardware. The AC input and output blocks you've pictured in your question look reasonable, but you may have a choice of screw terminals vs solder terminals vs strip-and-insert for the wiring connections. These little things can make a difference in your project. I always favor 'ring lugs' for terminating AC mains wiring to devices like these; I feel the risk of a hot wire coming loose inside the box is lower, but this is strictly my personal opinion.

And that's it. Good luck & let us know if you have further detailed questions.

1
  • Good point about the experience with mains power. I've worked some with AC voltages before and am comfortable with a lot of the safety concerns, but given some of the responses on here, I think not all of them. I've got some reading to do. I may choose to "give up" and go with a wireless (like 433mhz, not IoT) solution. Those pictures were just samples I found quickly, not the actual hardware. I have yet to pick that, but agree about being conscious of connector types. Ring terminals are awesome, I don't worry they'll slip out when getting pinched!
    – kbyrd
    Commented Jul 22, 2019 at 12:55
1

Breaking open one of these devices eliminates one of the safety isolation components.

Why not just but a professionally designed wireless power switch. These are relatively inexpensive and far safer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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