-
-
Notifications
You must be signed in to change notification settings - Fork 8
Raspberry Pi Wiring
This guide covers the wiring of PWM (3-pin like WS2812) and SPI (4-pin like WS2801) LED strips to an Raspberry Pi or similar single board computer.
The guide is demonstrated using an Raspberry Pi 3B+, WS2812B strip and Apa102 strip. But any other Raspberry Pi or single board computer and any other addressable RGB LED strip can be used.
LED strips that are controlled by PWM usually have only one data pin. But there are also viriants with a backup data line, like the WS2813 and WS2815 (comparison).
It is also important to note the supply voltage of the LEDs. There are quite a few LED strips that work with 5V, but also some that work with 12V (WS2815). So be sure to check the voltage the strip needs.
A GPIO pinout diagram can be found here or on raspberrypi.org
The data pin connects to pin 12 (GPIO 18) on the Raspberry Pi. The +5V (or +12V) pin connects to the (+) of your power supply and the Grnd connects to the (-) of your power supply. Additionally, the Grnd should also be connected to a ground pin on the Raspberry Pi.
Raspberry Pi | strip | power supply |
---|---|---|
GND (Pin 6) | Grnd | (-) |
Pin 12 (GPIO 18) | Data | |
+5V/12V | (+) |
LED strips which are controlled by SPI have a data and clock pin. The separate clock pin allows a higher data frequency and therefore smoother animations - even with over 300 LEDs. As mentioned above you also have to pay attention to the correct operating voltage (5V or 12V).
A GPIO pinout diagram can be found here or on raspberrypi.org
The data pin (Si / DI) connects to pin 19 (GPIO 10) on the Raspberry Pi, and the clock pin (CK / CLK) to pin 23 (GPIO 11). The +5V (or +12V) pin connects to the (+) of your power supply and the Grnd connects to the (-) of your power supply. Additionally, the Grnd should also be connected to a ground pin on the Raspberry Pi.
Raspberry Pi | strip | power supply |
---|---|---|
GND (Pin 6) | Grnd | (-) |
Pin 19 (GPIO 10) | Data (SI/DI) | |
Pin 23 (GPIO 11) | Clock (CK/CLK) | |
+5V/12V | (+) |