I want to power a Raspberry Pi with 54 LEDs (24 white, 24 warm white, 6 RGB - probably all at 20mA or something like that) from one wall socket. I'm planning to use the Pi to control the LEDs via transistors and maybe shift registers, so the GPIO pins don't catch fire if something goes wrong.

My question would be the following: What kind of circuit do I need to get the 5V for the USB of the RapsberryPI while powering the LEDs which can be turned on and off from one power supply (e.g. a 9V 2A wall adapter) ?

2 Answers 2


A Switched Mode Power Supply (SMPS), also called switching DC/DC converter is probably the best approach to convert the 9 V system supply voltage to 5 V for powering the Pi. Joan's suggested UBECs are typically SMPS. As linear voltage regulator could at best achieve a conversion efficency of about 55% (meaning 45% turned into heat), whereas a switching mode regulator should easily achieve 80+x %. Some examples suitable for the Pi:

Mind the total power consumption / current drawn when selecting the power supply. In this case it's at least 1.1 A for the LEDs plus the consumption of the Pi and additional peripherals. See here for some numbers of the Pi's power consumption.


If you have a 9V supply you can use a UBEC to convert the 9V supply to 5V for the Pi.

If convenient you can power via the P1 pins rather than the microUSB.


Search for UBEC on eBay, you can get them for a few UK £.

  • 1
    @Yasu11 While true that you can power the Pi via P1 pins, it's not the safest nor most efficient, as it isn't connected through the power circuit. Both methods are acceptable but powering via GPIO, unless necessary for the project. Commented Jul 20, 2014 at 22:43
  • Efficient: yes - Safe: no - it is more efficient because you are not wasting a little power from I x I x R losses in the infamous main "Polyfuse" - less safe because you are not using aforesaid "Polyfuse" to protect against some types of circuit fault...!
    – SlySven
    Commented Jan 7, 2016 at 0:02

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.