• PicŪ Basic


  • Colour Organ using a fast 8-bit FFT routine

    A colour organ is a sound to light unit that splits the audio signal into bands of frequencies and illuminates a number of differently coloured lights, LEDs in our case, accordingly. This simple implementation of a colour organ uses only a microcontroller, a potentiometer and eight LEDs.

    I presented a fast fixed point 8-bit FFT routine in this article: Fast 8-bit FFT , in which the display was mainly on an alphanumeric LCD. This application of the FFT uses the audio bands to adjust the brightness of eight LEDs using a software, interrupt driven, PWM (Pulse Width Modulation) routine. Each LED is illuminated according to what frequency band it sees. i.e. Low frequencies, mid frequencies and high frequencies. It also illustrates a special event interrupt to continually sample the audio signal being fed into its ADC (Analogue to Digital Converter).

    Here's a video of the colour organ in action, remember, this has no pre-amp or filter, just the audio signal from a PC's headphone socket going into the device's ADC. The results for such a simple design are quite interesting:

    http://youtu.be/n1s1-yhgnb4

    If youtube lose the video for whatever reason, it can be downloaded from here: Proton Colour Organ Video

    The colour organ was built using an Amicus18 development board, which contains an 18F25K20 microcontroller running at 16mips (Million Instructions Per Second). The LED and audio circuit for it is shown below:

    Attachment 1388














    Click on this link for a larger image of the above circuit: Large circuit image

    The source code for the colour organ can be downloaded from here: Proton_Colour_Organ_Source

    The code is for use with the proton compiler version 3.5.3.1 onwards. Earlier versions of the compiler will not compile correctly with this implementation.

    Using the colour organ
    Connect the output from the PC's earphone socket to the AN0 pin of the microcontroller (PORTA.0). Set the music playing at a reasonable volume level, and adjust the potentiometer connected to the ADC's Vref+ pin so that the signal level does not overload its input. Some tweaking may be required, but once set, it usually does not require changing, and could even be replaced by a couple of fixed resistors.

    The response could be dramatically improved by the inclusion of a low pass filter and pre-amplifier preceding the ADC's input, and an Automatic Volume Control (AVC) would make it even better.
  • Recent Activity

    Mitesh shah-16021

    Gps Data Logger

    Thread Starter: ohararp

    Steven, a spinoff from your sd_file_system is this gps data logger that I designed just recently. I just got the first one assembled. The EM406 gps...

    Mitesh shah Today, 12:26 Go to last post
    Mellbreak-21950

    8 bit 16x2 LCD Code for 16F84A

    Thread Starter: Jessica

    Hello I've been trying to experiment with a 16F84A board, I'm using a standard Hitachi LCD 16x2 and while I've been successful in the 4bit version,...

    Mellbreak Yesterday, 17:51 Go to last post
    hadv215-2509

    macros including assembler directives

    Thread Starter: hadv215

    In Proton 8bit I wrote a number of macros including assembler directives like this: aMacro Macro aParameter #if (Prm_1 == BYTE) Byte_byte...

    hadv215 Today, 12:28 Go to last post