Raspberry Pi Wiring

Wiring NeoPixels to work with a Raspberry Pi is quite simple.  The only issue to deal with is converting the Pi's GPIO from 3.3V up to about 5V for the NeoPixel to read. There are two ways you can do this level conversion, either with a simple 1N4001 power diode or with a level converter chip like the 74AHCT125.  

Note that you might be able to get your NeoPixels to work without any level conversion, but it's not really guaranteed because the data line needs to be at least 0.7 * VDD (5 volts), or about 3.5 volts.  Try one of the level conversion options below if you can't directly drive the pixels from your Raspberry Pi.

The diode method is a quick way to reduce the power supply voltage slightly so the NeoPixels can read the Pi's 3.3V output.  However you need to be careful to use a diode that can handle all the current drawn by the NeoPixels.  The diodes Adafruit sells only handle 1 Amp of continuous current so they're good for driving up to about 16 NeoPixels at full 100% bright white - and about 50 NeoPixels if they're all lit with various colors.  Also because the NeoPixels aren't running at 5 volts they might be a little dimmer than normal.

A level converter chip like the 74AHCT125 is a better method because it will convert the Pi's 3.3V output up to 5V without limiting the power drawn by the NeoPixels.  You'll get full NeoPixel brightness that's only limited by the current capability of the power supply.

NeoPixels must be connected to GPIO10, GPIO12, GPIO18 or GPIO21 to work! GPIO18 is the standard pin.

Be aware, you can only create one strip at a time! If you have more than one, connect them together and then wire them to your Raspberry Pi using a single connection.

You can use the following wiring diagrams to connect your NeoPixels to your Raspberry Pi.

Raspberry Pi Wiring with Level Shifting Chip

If you're using the 74AHCT125 level converter chip, wire up your Raspberry Pi as follows:

  • Pi GPIO18 to 74AHCT125 pin 1A
  • 74AHCT125 pin 1Y to NeoPixel DIN
  • Power supply ground to 74AHCT125 ground
  • Power supply ground to 74AHCT125 pin 1OE
  • Power supply ground to Pi GND
  • Power supply ground to NeoPixel GND
  • Power supply 5V to 74AHCT125 VCC
  • Power supply 5V to NeoPixel 5V.

Raspberry Pi Wiring with Diode

If you're using a 1N4001 diode wire up your hardware as follows:

  • Pi pin 18 to NeoPixel DIN.
  • 1N4001 diode cathode (side with the stripe) to NeoPixel 5V.
  • Power supply ground to Pi ground.
  • Power supply ground to NeoPixel GND.
  • Power supply 5V to 1N4001 diode anode (side without the stripe).

Make sure to get the orientation of the diode correct, with the cathode (side with the stripe) going to the NeoPixel!

Powering NeoPixels from Raspberry Pi Without Level Shifting

Remember, your NeoPixels may not work connected directly to the Raspberry Pi without a level shifter. If you run into issues, try adding a level shifter to your project.

Do not power more than a few NeoPixels from the Raspberry Pi's 5V output! The Pi cannot source enough current to light many pixels and will be damaged. Use a good quality external 5V power supply that can handle the current demands of all the pixels.

If you're only powering a few pixels, you can power them from the Raspberry Pi 5V pin.

  • Pi 5V to NeoPixel 5V
  • Pi GND to NeoPixel GND
  • Pi GPIO18 to NeoPixel Din

Using External Power Source Without Level Shifting

If you're going to be using more than a few pixels, it's a good idea to connect an external power source. Remember each pixel can draw up to 60mA so don't skimp on the power supply!

Remember, your NeoPixels may not work connected directly to the Raspberry Pi without a level shifter. If you run into issues, try adding a level shifter to your project.

  • Pi GND to NeoPixel GND
  • Pi GPIO18 to NeoPixel Din
  • Power supply ground to NeoPixel GND
  • Power supply 5V to NeoPixel 5V
This guide was first published on Sep 12, 2014. It was last updated on Sep 12, 2014. This page (Raspberry Pi Wiring) was last updated on Oct 20, 2019.