loading

This is my first attempt at a light organ. The idea has always been very cool and interesting to me but I had never been given the chance to build one. Although it doesn't work as I intended it too I still ended up with a pretty cool result in the end, and i believe I'm very close to actually building a proper light organ.

Step 1: The Parts

1 x Audio Jack

3 x BUZ11 MOSFET

1 x 200kΩ resistor

2 x 100knF capacitor

1 x 10nF capacitor

1 x 33pF capacitor

1 x Power supply (5V, 2A)

1 x Arduino Uno

3 x High power LED (green, red, and blue)

Jumper wires

1 x Breadboard

1 x MSGEQ7

A form of containment for the lights. In my case I used three glass mugs.

Step 2: Build It!

Once you have all of the parts you can use my images as a reference to build it, but once everything is in place the arduino gets plugged into a power supply and it should light up and flicker a little bit. Depending on your container it will be extremely bright it might even be a good idea to use something that has frosted glass or some kind of thin glaze over it in order to dim the brightness, or you could change the code that I will show in the next step in order to dim it.

Step 3: Code

int analogPin=0; //connects to the Output of the MSGEQ7, Measures the voltage value for each frequency band (0V-5V)

int strobePin=2; //connects to the Strobe Pin of the MSGEQ7, controls the Multiplexer and thus switches between the frequency bands

int resetPin=3; //connects to the Reset Pin of the MSGEQ7, controls the Multiplexer and let's it restart with the lowest frequency band

int ledred=9; //connects to the Gate of the BUZ11 MOSFET of the RED LED (Bass) and creates a PWM signal with variable duty cycle which depends of the peak value of the low frequencies to control the brightness of the RED LED

int ledgreen=10; //connects to the Gate of the BUZ11 MOSFET of the GREEN LED (Middle) and creates a PWM signal with variable duty cycle which depends of the peak value of the middle frequencies to control the brightness of the GREEN LED

int ledblue=11; //connects to the Gate of the BUZ11 MOSFET of the BLUE LED (High) and creates a PWM signal with variable duty cycle which depends of the peak value of the high frequencies to control the brightness of the BLUE LED int spectrumValue[7]; //Integer variable to store the 10bit values of the frequency bands

int filter=80; //There will always be some noises which the analogpin will receive. With this filter value we can ignore the very low peaks of the output of the MSGEQ7. Fell free to adjust this value to your liking

void setup(){

Serial.begin(9600); //needed to output the values of the frequencies bands on the serial monitor pinMode(analogPin, INPUT); //defines analog pin A0 as an Input

pinMode(strobePin, OUTPUT); //defines strobe pin 2 as Output

pinMode(resetPin, OUTPUT); //defines reset pin 3 as Output

pinMode(ledred, OUTPUT); //defines ledred pin 9 as Output

pinMode(ledblue, OUTPUT); //defines ledblue pin 10 as Output

pinMode(ledgreen, OUTPUT); //defines ledgreen pin 11 as Output

digitalWrite(resetPin, LOW);

digitalWrite(strobePin, HIGH); }

void loop(){

digitalWrite(resetPin, HIGH);

digitalWrite(resetPin, LOW); //change from high to low starts the output of the mutliplexer from the beginning for (int i=0;i<7;i++){ //for loop goes through this cycle 7 times to get the values for each frequency band digitalWrite(strobePin, LOW); //puts strobe pin low to output the frequency band

delayMicroseconds(30); //wait until output value of MSGEQ7 can be measured (see timing diagram in the datasheet) spectrumValue[i]=analogRead(analogPin); //put analog DC value in the spectrumValue variable if (spectrumValue[i]

<p>Im building one of these right now, </p><p>I had a question about your int filter= 80</p><p>Im having the same problem where I get noise no matter the input, where does this Filter come into play in the actual code? I see you define it but dont apply it. Is there any code missing to this?</p>
<p>Im building one of these right now, </p><p>I had a question about your int filter= 80</p><p>Im having the same problem where I get noise no matter the input, where does this Filter come into play in the actual code? I see you define it but dont apply it. Is there any code missing to this?</p>
<p>Im building one of these right now, </p><p>I had a question about your int filter= 80</p><p>Im having the same problem where I get noise no matter the input, where does this Filter come into play in the actual code? I see you define it but dont apply it. Is there any code missing to this?</p>
<p>Cool LED project.</p>

About This Instructable

546views

0favorites

License:

More by jla135:Light Organ Attempt 
Add instructable to: