Tuesday, November 11, 2014

ATtiny85 spectrum analyzer for music to RGB LED with modified FFT


ATtiny85 spectrum analyzer for music to RGB LED with FFT

Excited with the new discovery of FHT library. Yours truly definitely want to give it a try on an ATtiny85. After hours massaging the code to make it to work, sadly, none come to functionality (yet). According to this site http://forum.dev.arduino.cc/index.php?topic=261759.0, ATtiny has as small footprint ""ATtiny85 on-board, 8K of flash, 512 byte of SRAM, 512 bytes of EEPROM"" hence can't work with FHT. However, yours truly beg to differ. He noticed that some code in the FHT.cpp can't compile due to reduced instruction sets on ATtiny85. More about that after some workaround can be found.












Nonetheless, yours truly really want to have some fun with sound to light on Arduino's poor cousin, the ATtiny85. Life is so boring without some LEDs' goodness. Just come to recall that, years ago yours truly have done a DIY spectrum analyzer using a modified FFT that use 8bits only, runs off an arduino and LOL shield http://shin-ajaran.blogspot.sg/2011/07/diy-arduino-vu-spectrum-analyzer.html. This modified 8 bit FFT came for a forum discussion http://forum.arduino.cc/index.php?topic=38153.0 . Reusing the same library but   has to be modified to for Arduino IDE v1.06 and later; reusing the electret amplifier mentioned in an earlier post http://shin-ajaran.blogspot.sg/2014/11/arduino-spectrum-analyzer-for-music-to.html; reusing the MitG PCB which is a breakout board for ATtiny85 made earlier http://shin-ajaran.blogspot.sg/2014/01/setting-up-hardware-for-using-arduino.html to make the contraption in the following diagram. 

















code here:
youtube video here, the light changes according to the tone of the phone.

edit: after some code massaging, the colours appear somewhat according to what yours truly have in mind.


first try: Sadly, the colour changes are too subtle to be captured by a cheapo phone camera

1 comment:

johny radio said...

hi, very exciting project! how can one reduce the frequency resolution from 500 hz to, say, .005 hz?

-does NOT need to be real time-- it's ok if the analysis takes minutes.

(lowest freq needed is 20 hz)

thx!