Linkit ONE Sound Reactive LED
by apoorvtr in Circuits > Microcontrollers
569 Views, 0 Favorites, 0 Comments
Linkit ONE Sound Reactive LED

The following instructable presents a sound reactive LED. The intensity of LED is increased as the intensity of sound falling increases.
Materials






- Linkit ONE
- Battery
- Sound Sensor
- Transistor
- LED
- Jumper wires
- Breadboard
Connect the Sensor



- Connect the Vcc pin of sensor to linkit one 5v.
- Connect the gnd pin of sensor to linkit one gnd.
- Connect the output pin of sensor to linkit one A0.
Connect the LED


- Connect positive terminal of LED to transistor Collector.
- Connect negative terminal of LED to transistor Gnd linkit
- Connect base of transistor to linkit D9
- Connect emitter of transistor to linkit 5v
Upload the Code

The code is:
void setup()
{
pinMode(9, OUPUT);
}
void loop()
{
int a = map(analogRead(A0), 400, 600, 50, 255)
analogWrite(2, a)
delay(100);
}
Test


After uploading the code, connect the battery and switch it on. Tap on the mic and you will see the LED glowing.