I want to control 5m of WS2812 LED Strip with my Raspberry Pi, which will be placed around two Ikea Billy shelves. I read some articles and tutorials regarding this topic:

I understood that I need a maximum of 9A for 150 LEDS, because one LED consumes a maximum of 60mA. In the first link above, the current runs through the breadboard, which seems to be a bad idea when using 9A. In the third link the LED strip is powered directly using a separate power supply. Only ground and data is connected to Raspberry Pi (and clock, because he uses a WS2801 strip). Furthermore it seems to be good practice to connect a capacitor between the led strip and the power in order to smooth the initial onrush of current and a resistor between the DIN and the GPIO in order to prevent spikes on the data line. Also I need a level shifter, because the outgoing data signal of the RPI is 3.3V and the LED Strip expects 5V. Interestingly, the guy in the third tutorial doesn't use a level shifter, but maybe this is because he uses a WS2801 strip, I don't know.

Up to now I end up with this: I have a 5V 10A power supply (https://www.amazon.de/Schaltnetzteil-LED-Netzteil-50W-MeanWell-RS-50-5/dp/B00MWQDH00/ref=sr_1_2?ie=UTF8&qid=1470574958&sr=8-2&keywords=5V+10A) which separately powers the LED strip + a capacitor. The led strip has to be connected with a ground pin (e.g. pin 6) and GPIO18 (pin 12) for data + a resistor. The problem is, I don't really know how to put this together with the level shifter on the breadboard. Is there anything what I need on top of the already mentioned stuff.

Would be really nice, if someone could tell me how to wire this up. :) I have no problems regarding the software side, but I'm really new to this hardware stuff...

Thanks in advance :D

1 Answer 1


I'd use a couple of terminal blocks to make the higher amperage connections, and pin headers for everything else.

Pi/WS2812b hookup diagram

As you're using a switched mode power supply which has both high and low voltage terminals, I'd recommend using separate enclosures for the power supply and everything else. Should anything cataclysmic happen this should help to isolate REALLY BIG PROBLEMS from normal-sized ones. When I last made my own PSU, I used a fused kettle/IEC plug on the power enclosure and ran a cable to it from the wall.

If it's impractical to put things in separate boxes, you should at least make sure that any high voltage wiring is kept a minimum of 10mm clear of any low voltage wiring. Avoid having metal elements (bolts, screws, etc.) which run completely through the (non-conductive) enclosure, so that if the live wire should ever work loose you're not in mortal danger from touching the case.

You'll need something suitable to connect to the screw terminals on the supply. That's going to mean crimp ring terminals. Make sure you use the right gauge of wire at each stage, and that your terminals have an internal ring diameter large enough to fit over the screws, and an external diameter narrow enough that you can fit the terminals into the gaps on the supply.

At the output side of the power supply, the 5V DC cables will terminate at the terminal blocks and don't strictly speaking need connectors. You can gussy it up with some suitable panel mount connectors if you like - something like a barrel jack, rated for at least 10-12 amps.

For the terminals, I'd use something like these nifty Wago terminal blocks:

Wago 222 series terminals

They lack mounting holes but they glue down pretty invincibly. Not to belabour the point of terminals, but basically there's just a lump of brass inside it. Anything you feed in one hole comes out all the rest.

If your logic level converter looks anything like mine it'll have two rows of 0.1" pitch holes, and hopefully some pre-supplied male pin headers. Solder the male headers to the converter. What you're aiming to achieve is HV to +5V from the power supply, LV to the Pi's 3.3V pin, and both GNDs to the ground of the power supply (which is also connected to the Pi). You'll need female connectors to hook to that board. I'd make these myself from crimp terminals and suitable housings - these should really be crimped (per the name), but they're not too terrible to solder. I screwed up several times my first time out with them, but it's do-able with a little practice. They fit reasonably snugly to male pins and can be hot-glued for a little more permanence.

All connections to the Pi should be made using the same terminals/housings as the logic level converter. You should be able to find housings that'll allow you to span the necessary pins on the Pi.

As a general rule of thumb, if you can screw it down without piercing the enclosure insulation then do so, otherwise cable ties and hot glue are your friends. Remain appropriately terrified of any high voltage elements throughout and make really sure that everything dangerous is at least physically secure.

  • Thank you very much indeed. I highly appreciate your detailed answer. Would it be possible to use a 74HCT125 Level Shifter ? Is it right, that using a solderless breadboard is inappropriate for this project, because of the high amperage or would it be ok ?
    – appcodix
    Aug 9, 2016 at 13:14
  • Passing 9A through a breadboard is reasonably likely to result in melting or a small fire. Not a good idea! Use some properly rated terminal blocks instead. For your 74HCT125, take a look at this tutorial from Adafruit. It shows the appropriate connections - mainly a direct swap-in for mine above, minus a connection to the Pi's 3.3V pin. You can either 'dead bug' solder that chip (solder straight to its legs), or use a socket and some perfboard.
    – goobering
    Aug 9, 2016 at 13:28
  • Allright. For the moment I have two more little questions: Is it ok to power the pi from the same power supply, using this ? And would it be ok to use simple male/female jumper wires to connect to gpio18 and ground of the pi ?
    – appcodix
    Aug 11, 2016 at 15:58
  • There shouldn't be a problem powering the pi from the same supply provided you're not blasting all the LEDs at full white - there has to be enough current left over to supply the pi with. That connector would do fine, or you could just cut an existing cable which may be cheaper. Using jumper wire for GPIOs should be fine - I use something like 22AWG wire most of the time.
    – goobering
    Aug 11, 2016 at 16:19
  • Would 18AWG wire do fine for the rest of the setup ?
    – appcodix
    Aug 16, 2016 at 22:17

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.