This experimental project shows how to use ATtiny13 to synchronize live music and lights with only a few additional components required. Project uses single ADC (Analog to Digital Converter) channel for signal acquisition and some DSP (Digital Signal Processing) calculations that in real-time separate three frequency bands and make the LEDs dance in sync with the music. This project also proves that real-time DFT (Discrete Fourier Transformation) is possible on such small MCU like ATtiny13, which offers only 64B of RAM and 1024B of FLASH. Project doesn’t require any specific equipment and the parts costs are below 3$.
Hi, after I read your comment I realized that I made a copy-paste mistake. Of course, this example will work with higher sampling rate, but it result in poor quality. Project has been tested using @1.2MHz internal clock source. ADC division factor is set to 64 so the ADC sampling frequency is 18750Hz (F_CPU/64). Thank you!
NOTE: “copy-paste mistake” has been fixed on both blog and github.
>ADCSRA |= _BV(ADPS2)|_BV(ADPS1); // set ADC division factor 64;
>F_CPU=9600000
Are you sampling ADC with 150kHz ? and if so why ?
A fun twist of your code would be to put it inside a flash-light driver
http://flashlightwiki.com/AVR_Drivers