1

I'm currently playing around with the RaspberryPi 4 and a couple of sensors, each of them using a 5V pin.

I was wondering if I could plug another 2 sensors - could I output 5V from any other GPIO pin?

If that's not possible, would you suggest using a secondary board to plug the 5V wire while I keep connecting the ground and GPIO wires to the RaspberryPi?

Sensors are E18-D80NK

1
  • 1
    If your sensor is feeding 5V into a GPIO pin you may kill your Pi. You need additional circuitry to reduce 5V to 3.3V. You can have multiple feeds from the 5V power pins.
    – CoderMike
    Commented May 22, 2020 at 10:07

3 Answers 3

2

You appear (from Comments) to be under the misapprehension that the 5V pins are discrete. They are all connected together. There are only multiple pins for convenience.

You can power multiple devices from a single pin (provided you don't exceed the total current, which depends on your power supply).

2
  • 1
    Thanks for clarifying that out - so if I have 4 sensors that requires 5V each, and I solder them in groups of 2 so I can use the 2 pins available to feed the 4 sensors, I will be using a total of 10V. That would require to connect a 10V power supply to the raspberry (i.e. via usbc) - am I rights? Then, what's preventing me from plugging a motor that requires 12V directly to the raspberry? I thought that wasn't possible
    – Inigo EC
    Commented May 22, 2020 at 10:30
  • @InigoEC You can use as many wires and/or pins as you want - the voltage will remain 5V (unless you overload the Pi). You need to learn some basic physics. WHATEVER you do DO NOT apply more than 5.25V to the Pi - if you do it will be an ex-Pi.
    – Milliways
    Commented May 22, 2020 at 12:54
1

No.

All the GPIO are 3V3.

Each GPIO can source or sink about 16 milliamps (with an overall total of say 50 milliamps for all the GPIO).

9
  • The 50mA limit is an urban myth. It may have been true for the original Pi which had a linear regulator.
    – Milliways
    Commented May 22, 2020 at 9:54
  • What would be the item I would need to buy in order to be able to supply power to the extra sensors? I can imagine somekind of small secondary board?
    – Inigo EC
    Commented May 22, 2020 at 9:56
  • @InigoEC solder 2 wires together
    – Milliways
    Commented May 22, 2020 at 9:58
  • 1
    @InigoEC: Sure. The power supply that provides the 5V has a voltage regulator that ensures the 5V remain 5V, regardless of how much power is drawn - up to a certain limit, which for the default Raspi power supply is 3 Amperes, which is a lot for just simple sensors. If it's just simple temperature or similar sensors, you could probably connect hundreds, till you overload it.
    – PMF
    Commented May 22, 2020 at 15:32
  • 1
    @InigoEC I don't know. I use breadboards to connect everything together. Avoids welding as well.
    – PMF
    Commented May 23, 2020 at 14:35
1

Note power supply is not GPIO. Two 5v pins are physically in the "gpio header" but they are not themselves a GPIO and no, you cannot set up a GPIO pin to "output +5V supply" in fact they'll fry at +5V.

I would encourage in not even using the GPIO pins at 3.3V as a power supply.

It seems you are powering the rPi using the official AC adapter, which is reasonable for prototyping. So you think about 'outputting' a +5V from the pins.

In production I would encourage the use of the +5V pins as "inputs" to the rPi, and then branch off your +5V directly from the power supply. As your question:

If that's not possible, would you suggest using a secondary board to plug the 5V wire while I keep connecting the ground and GPIO wires to the RaspberryPi?

I'm not sure what do you have in mind but in the lab I just plug the +5 pins with their own cables branched off from the power supply. For prototyping, the pi is just another devices. In production we generally end up with some PCB to keep the thing tidy. I guess that could qualify as your 'secondary board' but I'm not quite on the same idea.

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.