I'm using my pi to power several relays. A total of ~20 relays (a 8-relay board and three 4-relay boards)
I'm also running home-assistant

Yesterday i noticed that when i try to power them all up, some don't work. If i switch some off, then switch others on they work.

I am powering all the relay boards out of one 5v pin. Could that be the issue?

Mainly the question is, are the two 5v pin on the same rail? should i switch some relays over to the other 5v pin to balance them out or is something else the issue?

  • 2
    the current requirements for the 4 relay boards is probably more than is available from the Pi (regardless of which pin you use) - power the relays directly from a power supply instead Commented Dec 13, 2018 at 11:00
  • This creates a huge workload for me, the boards are already installed and enclosed in boxes. Thing is that they used to work perfectly for 1y+. Then i redid my center console where the rpi is and redid the cable configuration there. I did this a month ago and i realised the issue yesterday, so that might be it.
    – krasatos
    Commented Dec 13, 2018 at 12:26

3 Answers 3


Check the voltage on the RPi 5V pin while the relays are off, then while they are on. If the voltage drops significantly below 5V when the relays are driven, you should get a beefier power supply. If you already have a power supply capable of delivering 2A or more, get a separate power supply for the relays, as the micro-USB connector is rated for currents less than 2A.

If the voltage on the RPi 5V pin remains above 5V at all times, your problem is likely in the wiring between the RPi and the relays. You need to get thicker and shorter wires which are able to deliver more current.

  • Could you please walk me through to connecting a separate power supply to the relay boards? All the relay-boards are wired to a breadboard that's near my Pi and that's the only thing connected there. Ill disconnect the 5v power from pi to the breadboard and get a usb charger to power the 5v to the breadboard. What about the new usb gnd? do i just ignore it or should i connect it to the same line as the pi's gnd? Also, ill have the move the jumper on each separate breadboard? ( i think they have a jumper to decide vcc or external power or something) - Excuse my ignorance :)
    – krasatos
    Commented Dec 19, 2018 at 21:23
  • 1
    @krasatos For starters, I would get rid of the breadboard: these are for prototyping, not for long-term reliable operation. And yes, you need to connect GND of all devices that are working together. Commented Dec 24, 2018 at 14:37

The 5V pins at the GPIO header are connected to the same rail. The max amperage of header pins (such as are used as the GPIO header) is listed with 1 through 3 A (depending on which product you look at). Using just one of them or both will not improve the situation; the header itself is not the limiting factor - assuming 50 mA per relay which will add up to 1 A in total. So again, using one or both pins will not change much. I will also assume that the board is designed that way that the width of the traces (or power plane) to support a current of that magnitude. I would hope beside that the micro USB receptacle has a sufficient current rating - a quick search show products ranging from 1 A to 5 A. Cables connecting the power supply with the Pi are also known to be of limited current rating, same goes for the cable connecting the Pi and the relay board... not to mention the power supply itself (I assume all are selected accordingly).

Bottom line: best shot is to pick a proper power supply and connect both the Pi and the relay board with direct wiring to it.

  • I'm using the official rpi3 power supply that i bought it with but i have a small extention cable (~20cm) microusb 2 microusb near the rpi to avoid plugging in and out on the rpi port. Thing is that everything used to work great until last month that i did some cable management on my rpi. I am actually distributing power through a breadboard, could the breadboard be the issue?
    – krasatos
    Commented Dec 14, 2018 at 15:38

Your relay board had a higher power requirement than that Raspberry can supply on pin#2/pin#4 and GND. That's a common thing if all eight relay coils are energised. You really need to power the relays with an external 5V supply. The only connections needed to the RPi are GPIO signals and GND.

  • So i would connect GPIO and GND to the pi and just give 5v+ on the relay? What do i do with the new power supply's gnd?
    – krasatos
    Commented Dec 14, 2018 at 15:41
  • You CAN NOT use the Raspberry power supply to drive the relay coils. There's not enough amps on the GPIO header pins that run at 5V.
    – Dougie
    Commented Dec 14, 2018 at 20:49

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.