Path: EDN Asia >> Design Ideas >> Computing/Peripherals >> PSoC-based audio spectrum analyser using NeoPixels
Computing/Peripherals Share print

PSoC-based audio spectrum analyser using NeoPixels

16 Sep 2014  | Sree Harsha Angara

Share this page with your friends

A few weeks ago, I came across the rather attractive NeoPixel Shield for Arduino from Adafruit. This is a brilliant-looking tri-colour LED shield with 40 LEDs requiring only a single pin to drive it. I couldn't help myself. I instantly bought it in a fit of blinky madness.



The Adafruit shield arrived a couple of days later, and I quickly soldered up the headers and fired up my trusty CY8CKIT-042 PSoC 4 Pioneer kit. As you may know, this development board boasts a set of Arduino-compatible headers, thereby allowing Arduino shields to be controlled using the PSoC 4.



It's well known that the timing of the signals used to control a string of NeoPixels can be a little tricky. Fortunately, my colleague Mark Hastings here at Cypress had already created a Universal Digital Block (UDB)-based driver. This component was available to be dragged and dropped into my design. If you are not familiar with the PSoC Creator development environment, "component" refers to something like a library file for Arduino, but in this case it contains a mix of Verilog HDL and firmware-based code.

As you can see in this video, Mark had previously used his UDB to run a massive 960 tri-colour LED billboard with a single -042 kit.

With a bit of twiddling, I managed to adapt Mark's component to work with the code from my original MSGEQ7 emulator. The filters are unchanged except for the fact that I added another frequency band at around 4kHz, so that the whole shield is used. Each LED column represents a different frequency, and the power of blinky exceeded all of my expectations, as you can see in this video.

You may be wondering about the translucent sheet I placed in front of the shield. This is just there because the NeoPixels are so bright that it's hard to take a video of them working if they are fully exposed. As you can see, I added a brightness pulse each time the bass (63Hz) filter crossed a threshold to get a more fun, thumpy feel.


Some nitty-gritty details
The NeoPixel shield is based on WS2812B LEDs, and the datasheet for these devices specifies a very interesting protocol. Each pixel (LED) requires 24 bits of serial data (eight bits each for the red, green, and blue subpixels). Once a pixel has received the data it needs, it simply passes any subsequent 24bit data values on to the following pixel in the chain. There is a nice timing diagram that shows this in the datasheet.




1 • 2 Next Page Last Page


Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.


Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming


News | Products | Design Features | Regional Roundup | Tech Impact