hey there... i was looking to get four high brightness LED's that light up according to different frequency ranges of music.
what do i need to do to start?
hey there... i was looking to get four high brightness LED's that light up according to different frequency ranges of music.
what do i need to do to start?
Check on this link, if you like it:
http://fftarduino.blogspot.com/2011/02/color-organ-spectrum-analyzer-on.html
Look into msgeq7 its an ic that does all the hard work, and u need suitable transistors and constant current supply if your leds are the kind that draw about > 100ma
any more than 30ma you definetly need a transistor
Also look into analog reads and pwm to read and display levels of brightness
I just finished the majority of a similiar project, all I need is to wire some leds to my speakers, but I used a msgeq7 and a custom pcb with my arduino uno and it works great
pretty cheap too
And in case you wanna go that way here's my code you can try it out if you want,
int strobepin = 2;
int resetpin = 3;
int freqval[7];
int ledpwm[7];
int ledchannel[3];
void setup(){
Serial.begin(9600);
pinMode(A0, 0);
pinMode(strobepin, 1);
pinMode(resetpin, 1);
}
void loop(){
getfreq();
for(int i = 0; i <7 ; i++)ledpwm[i] = map(freqval[i],0,1023,0,255);
ledchannel[0] = ledpwm[0];
ledchannel[1] = ledpwm[3];
ledchannel[2] = (ledpwm[6] + ledpwm[5]) / 2;
if(ledchannel[0] > 25)analogWrite(9,ledchannel[0]);
if(ledchannel[0] < 25)analogWrite(9,0);
if(ledchannel[1] > 25)analogWrite(10,ledchannel[1]);
if(ledchannel[1] < 25)analogWrite(10,0);
if(ledchannel[2] > 25)analogWrite(11,ledchannel[2]);
if(ledchannel[2] < 25)analogWrite(11,0);
}
void getfreq(){
digitalWrite(resetpin, 1);
delayMicroseconds(30);
digitalWrite(resetpin, 0);
for(int i = 0; i <= 7; i++){
digitalWrite(strobepin, 0);
analogRead(A0);
freqval[i] = analogRead(A0);
digitalWrite(strobepin, 1);
}
}
.
winner10920:
Look into msgeq7 its an ic that does all the hard work, and u need suitable transistors and constant current supply if your leds are the kind that draw about > 100ma
any more than 30ma you definetly need a transistor
Also look into analog reads and pwm to read and display levels of brightness
I will look into the msgeq7 IC... but what transistors would I need? i have a bunch of NPN transistors...
also, i have 3 high brightness LEDS that say its FW current is 20mA, and one that says 70mA...
I'd like to get all four of them to be controlled by different frequency bandwidths of sound...
I'm familiar with analog reads and PWM... I'd like more info on how to utilize it with high brightness LEDS though...
You don't need any current regulation just some current limiting resistors
you would have the base of an npn transistor go through a resistor of maybe 1k, the emitter to ground and the collector to the anode of the led. The cathode would go to the positive of the power supply
the pwm will control the transistor which controls the larger current of the led
for the leds with 20ma you can directly hook it up to the arduino pins with a resistor of like 220 ohms
is there anywhere i could see a schematic of it?
Just follow the digram it gives you on page 3 or 4 I think in this attached pdf,
I used the exact components they specify and it works great, and in my code you can specify the strobe and reset pin, the pin that reads the output from the msgeq7 is A0
as for the 20 ma leds just have the positive side goto an arduino pwm pin, and a 220-1k resistor to ground from the negative side of the led
the 70 ma led's postive thru a 80ohm resistor to the 5v pin on the board, the negative to the collector of a general switching npn transistor, the emitter of that transistor to ground, the base of the transistor goes thru a 1k resistor to an arduino pwm pin
winner10920:
Just follow the digram it gives you on page 3 or 4 I think in this attached pdf,
where is the attached pdf?
Srry im doing this on my phone, must not have uploaded right
I guess i cant upload a pdf, heres a link to sparkfun where you can get the datasheet