This project requires CircuitPython 6.2.0 or later

The new RP2040 microcontroller from Raspberry Pi Foundation has a powerful feature: the PIO module, a sort of accelerated I/O processor.

In this guide, you will learn how you can use CircuitPython and PIO together to drive 8 separate NeoPixel LED strands using just 3 GPIO pins and a 74HC595 Shift Register.

One advantage of driving your NeoPixel LEDs this way is that less time is spent actually sending the pixel data to the LEDs—It is about 7.5x faster to show() your NeoPixels with the parallel method. Depending on your project, having parallel strips as opposed to chained strips can also make for better wiring.

Mostly, this guide is just a cool way to show off some of the capabilities of PIO itself.

Benchmark

The numbers below compare the speed of the two methods of refreshing NeoPixels, the traditional with a single 960-pixel chain, or 8 independent 120-pixel strands thanks to using PIO. It excludes the time to actually update animations on the strips, so it is a "best case" scenario.

960 pixels, 100 refreshes
Neopixel show():  34.1 FPS,  32757 pixels/second
NeoPIO   show(): 232.7 FPS, 223418 pixels/second

Check out the following pages to learn more about PIO and how to use it in CircuitPython.

Parts

Raspberry Pi Pico RP2040
The Raspberry Pi foundation changed single-board computing when they released the Raspberry Pi computer, now they're ready to...
Out of Stock
Raspberry Pi Pico RP2040 with Loose Unsoldered Headers
The Raspberry Pi foundation changed single-board computing when they released the Raspberry Pi computer, now they're...
Out of Stock
Adafruit NeoPixel LED Strip with 3-pin JST PH Connector
Plug in and glow, this Adafruit NeoPixel LED Strip with JST PH Connector has 30 total LEDs in a "60 LED per meter" spacing,...
$12.50
In Stock

You can make this project with anywhere from 2 to 8 NeoPixel LED strands. Each strand should be the same length.

74HC595 Shift Register - 3 pack
Add lots more outputs to a microcontroller system with chainable shift registers. These chips take a serial input (SPI) of 1 byte (8 bits) and then output those digital bits onto 8...
$2.75
In Stock
5V 2A (2000mA) switching power supply - UL Listed
This is a FCC/CE certified and UL listed power supply. Need a lot of 5V power? This switching supply gives a clean regulated 5V output at up to 2000mA. 110 or 240 input, so it works in...
$7.95
In Stock
Premium Male/Male Jumper Wires - 40 x 3" (75mm)
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 3" (75mm) long and come in a 'strip' of 40 (4 pieces of each of ten rainbow...
$3.95
In Stock
Female DC Power adapter - 2.1mm jack to screw terminal block
If you need to connect a DC power wall wart to a board that doesn't have a DC jack - this adapter will come in very handy! There is a 2.1mm DC jack on one end, and a screw terminal...
$2.00
In Stock

This guide was first published on Feb 23, 2021. It was last updated on 2021-02-23 12:32:27 -0500.

This page (Overview) was last updated on May 16, 2021.

Text editor powered by tinymce.