I have my raspberry pi set up to do two main things:

  • control 16 LEDs via 16 transistors each connected to an out pin. The LEDs are collectively fed the 5V from the GPIO.

  • power a chip also on the 5V line

The chip itself is not important (its a DAC) beyond the fact that it is very sensitive to the 5V going in that must remain perfectly constant.

My problem is that when the LEDs are off I measure 4.99V on the GPIO 5V line, and 4.97V when they are on. The fact that it isn't exactly 5V is annoying but not nearly as important for my purpose as the slight shift in value between the two states. And I suspect there is a similar dip in voltage when the CPU/GPU are busy compared to when they are (mostly) idle, although I have not measured this precisely.

So my question is what can I do to keep the 5V line as constant as possible?

Someone mentioned to me the idea of taking a 12V power supply and converting it into two 5V supplies, one for the pi and one for the LEDs, but I was unable to find this explained online (might just be that I couldn't formulate it right, I'm no expert in electronics).

In case it matters, I am currently using a 5V 3A power supply for the pi.

2 Answers 2



How to keep (1) 5V DC power supply for Rpi and (2) 5V DC power supply for external circuits, eg, LEDs, relays etc as steady as possible, say, less than 0.02V fluctuation (ie, "slight dip" in Rpi 40 pin connector 5V power, when switching on LEDs)?


Use two separate 5V regulated power supplies, one for Rpi, another for external circuit such as LED, relays etc.

There are many ways to avoid the "slight dip" when switching on/off LEDs (or motors and servos) at the same time. One way is to use PCA9685 PMW controller to switch on/off LEDs etc with slightly different, human eyes unnoticeable, start times (say, 0.1% of period of 50Hz). This is also to prevent the EMI when switch off (not on) many serovs/motors at the same time.


(1) Use a 200VAC to 12VDC 3A~5A switching regulated power supply to get a stable 12VDC power supply.

(2) Use Two DC12V to DC5V 3A step down switching regulated power supplies, one for Rpi, another for external circuits such as LED, motor, servo, or relays.

(3) I use 200VAC to 12VDC as the main DC source to step down to two more more 5V sources for Rpi and other circuits. I select 12V rather than 9V, 18V for the following reasons.

(a) Many devices actually use 12V rather than 5V. For example 12V relays are more efficient than 5V relays, 12V RS233 go loner distance that 5V UART, ...

(b) It is easy to find replacement for 12V DC sources, such as car battery, lead acid battery, 3.71 volt LiPo cell x 3 = 11.7V ~= 12V. BTW Batteries are almost noise free, and for applications where you need noise free power, see GPS example in the references below. For low noise low power applications, I only use 200VAC to 12V 1A switching power supplies, ...

rpi4 psu



Raspberry Pi Zero W solar power setup

Connecting Pi-Zero W to Adafruit Powerboost 1000 through Extension Header or USB






Cut power on a remote Raspberry Pi 3 via another raspi


Is my GPS module fried?

  • I'll have to investigate this a little, I'm not too familiar with this conversion hardware. Is there a single connection to the power outlet? It seems so on the photo but it's hard to tell and its kind of important for my needs.
    – schmop
    Commented Sep 1, 2019 at 15:19
  • Yes, orange cable is to 200VAC, yellow/black is 12VDC/Ground, red/black is 5VDC, white/black is 3V3. Your question titled "Slight Dip on 5V Line". I am using PCA9685 PWM controller to control LED/Servo/Motor on/off/light intensity.speed. This PWM controller has an unique feature to "AVOID POWER FLUCTUATION/EMI" by switch on/off devices with very little start times.
    – tlfong01
    Commented Sep 2, 2019 at 0:52
  • @schmop, I have included at the bottom of my answer some reference links on the PSUs I have been using. You might like to check them out and then ask me more questions.
    – tlfong01
    Commented Sep 2, 2019 at 3:39

The voltage will fluctuate slightly on the 5v pin due to the protection circuitry built-in to the Raspberry Pi. Mainly the polyfuse, which has a resistance of about 0.2 ohms. When the load increases (LEDs, CPU usage, hard drive spinning), the voltage will drop slightly on the GPIO 5v pin. If that voltage drop is undesirable, you can:

  • Run the chip on a dedicated power supply/regulator to isolate it from voltage fluctuations.
  • Or if the chip must be powered by the Pi's 5v pin, you could power the whole Pi directly through the 5v pin, effectively bypassing all protection. This is risky and has less tolerance for mistakes, but the risk can be minimized if you use a good-quality power supply with regulation and protection.
  • Powering with the 5V does not eliminate the dip in my case
    – schmop
    Commented Sep 4, 2019 at 15:01
  • Powering directly to the 5v pin still has a noticeable voltage drop? What power supply are you using?
    – Botspot
    Commented Sep 4, 2019 at 17:47
  • A 5V 4A supply going into a X735 module (raspberrypiwiki.com/index.php/X735) which, per the documentation, supplies the pi via the 5V pin. But I suppose that module might have similar protections to those you describe in your post. When I get a chance I should try feeding the 5V pin directly.
    – schmop
    Commented Sep 5, 2019 at 18:40
  • Before feeding directly into the 5v pin, MAKE SURE the power supply's output is exactly 5v. I failed to do this, and fried a Pi on 5.1v.
    – Botspot
    Commented Sep 5, 2019 at 21:26
  • @schmop, Probably overkill for your use, but I use a 5v 20A power supply. The voltage is adjustable, and the voltage doesn't fluctuate at all - even when I run an electric drill motor on it!
    – Botspot
    Commented Sep 14, 2019 at 13:05

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.