Author Topic: LED strip spectrum analyzer  (Read 4857 times)

dougal

  • Sr. Member
  • ****
  • Posts: 289
LED strip spectrum analyzer
« on: June 20, 2013, 01:28:14 pm »
I was thinking about using an LED strip as a spectrum analyzer type of display.


My basic idea at the moment is to pass audio through simple RC low/high/bandpass filters, and reading the analog values on three pins of the DigiSpark (ADC0-2?). I would use those values to light up three different regions of the strip, based on the strength of the value I read.


Then I just need to use two more pins to drive the strip, right?


The fun part will be algorithms for lighting the sections the way I want. I'm picturing the strip broken into three equal-sized pieces. The low frequency signal will drive the left end, which will light from left-to-right. High frequences will light the other end from right to left. Mid-range frequences will light the middle section starting at the center, and spreading out towards the ends (yes, this will give half the resolution).



Sound feasible, or is there something I'm missing?


Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: LED strip spectrum analyzer
« Reply #1 on: June 21, 2013, 06:46:39 pm »
This would work, though I'd actually recommend you check out the ws2812 strips available on aliexpress or from adafruit (rebranded as NeoPixel). They use a single wire for data instead of a pair. This is a rather neat feature for Digisparks where pins are few. They're also really neat because they run their PWM independently of the data line - where on some strips you have to keep clocking the SPI interface to advance their PWM clocks - these will just keep working while you go and busy yourself doing analog reads and stuff.


In theory it's even possible to do Fast Fourier Transforms on the avr like this https://github.com/adafruit/piccolo however the piccolo ffft library uses assembly with many multiplication-related instructions unsupported on attiny85 so it does not compile for digispark. If you managed to get a fast fourier library working you would be able to omit the low/mid/high pass filters and do that processing on the device with many more channels.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: LED strip spectrum analyzer
« Reply #2 on: June 23, 2013, 08:38:10 pm »
I had seen the FFT libs, but for this first attempt, I wanted to keep the software side as simple as possible. I'll have to double-check my LED strips and see if they are a 1-wire or 2-wire interface.