Go Down

Topic: Arduino sound sensor to control brightness of LED ? (Read 110 times) previous topic - next topic

firashelou

hello guys,
what i need to know is:
is it possible to control the brightness of an LED with arduino audio sensor or the sensor just make the LED goes on and off when it detect sounds ?

this is the sensor i have : http://www.ekt2.com/products/productdetails?ProductId=3e78811a-d831-4aac-a3d0-e417e44d10bf

and i wonder why is there a digital D0 pin ? it's not used in any of the tutorials i checked  :o 
Aiming for the unreachable !

JimboZA

is it possible to control the brightness of an LED with arduino audio sensor or the sensor just make the LED goes on and off when it detect sounds ?
Well that's what an analog output would be for: output voltage depends on the volume of sound, use that to set the led brightness

Quote
and i wonder why is there a digital D0 pin ?
Did you read the datasheet?

Quote
2, DO, when the sound intensity reaches a certain threshold, the output high and low signal, [threshold -
adjustment by potentiometer]
No PMs for help please.
Arduino with e'net at http://jimboza.gotdns.com:8085/
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

firashelou

#2
Jan 30, 2015, 11:04 am Last Edit: Jan 30, 2015, 01:47 pm by firashelou
Well that's what an analog output would be for: output voltage depends on the volume of sound, use that to set the led brightness
but how to set the brightness if the LED are connected to digital pins ? i mean what method related to the input from the microphone should be used here ? i want the LEDs goes in a very smooth way when music is playing


Did you read the datasheet?

yes but i didn't understand what do that mean ?  :-[
Aiming for the unreachable !

JimboZA

Connect the LED to PWM digital pins, then you can use analogWrite() to give the LED a brightness between 0 and 255, with the brigtness being based on your analog input. Have a look at this.
No PMs for help please.
Arduino with e'net at http://jimboza.gotdns.com:8085/
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

firashelou

Connect the LED to PWM digital pins, then you can use analogWrite() to give the LED a brightness between 0 and 255, with the brigtness being based on your analog input. Have a look at this.

ah k so i remap the analog input from the microphone to get a value between 0-255

i will be using a shift register so i guess i have to analogWrite the enable pin
Aiming for the unreachable !

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy