• 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:


    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 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


    Efficient RF protocol

    Thread Starter: Peter Truman

    Hi All I'm sure this is straight forward but I've been fiddling for a while and not sure I'm on the right track. I'm looking for a really...

    Ioannis Today, 14:34 Go to last post

    Buffered_Hserin and CDC USB

    Thread Starter: wirecut

    First of all a very big thanks to Les for the fab buffer for receiving data from the serial port, while the PIC may perform other functions. I use...

    hadv215 Today, 12:32 Go to last post

    16f1503 AND PWM modules

    Thread Starter: Maxi

    Have any body work with pwm? (hpwm) I cant work any maybe have some trick? ...

    joesaliba Yesterday, 20:24 Go to last post