1

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.

schmop
  • 159
  • 7

2 Answers2

2

Question

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)?

Solution

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.

Example

(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

References

PSU

Raspberry Pi Zero W solar power setup

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

https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=230984&p=1417095&hilit=psu#p1416984

https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=230984&p=1417095&hilit=psu#p1417087

https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=230984&p=1417095&hilit=psu#p1417090

https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=230984&p=1417095&hilit=psu#p1416937

https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=230984&p=1417095&hilit=psu#p1416951

Cut power on a remote Raspberry Pi 3 via another raspi

https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&p=1400274&hilit=PSU#p1400163

Is my GPS module fried?

tlfong01
  • 4,384
  • 3
  • 9
  • 23
  • 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 Sep 01 '19 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 Sep 02 '19 at 00: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 Sep 02 '19 at 03:39
2

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.
Botspot
  • 1,674
  • 5
  • 25
  • Powering with the 5V does not eliminate the dip in my case – schmop Sep 04 '19 at 15:01
  • Powering directly to the 5v pin still has a noticeable voltage drop? What power supply are you using? – Botspot Sep 04 '19 at 17:47
  • A 5V 4A supply going into a X735 module (http://www.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 Sep 05 '19 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 Sep 05 '19 at 21:26
  • @schmop, Probably overkill for your use, but I use a [5v 20A power supply](https://www.ebay.com/itm/352657328504). The voltage is adjustable, and the voltage doesn't fluctuate at all - even when I run an electric drill motor on it! – Botspot Sep 14 '19 at 13:05