Introduction: 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.
Step 1: Materials
- Linkit ONE
- Battery
- Sound Sensor
- Transistor
- LED
- Jumper wires
- Breadboard
Step 2: 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.
Step 3: 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
Step 4: 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);
}
Step 5: Test
After uploading the code, connect the battery and switch it on. Tap on the mic and you will see the LED glowing.