Introduction: Ardunio Controlled Sound Sensor

Building a Arduino Sound Sensor Controller

-Soldering iron
-7in of wire
-screw driver
-shrink tube
-needle nose pliers
-cutter pliers

- a relay   (
-a sound sensor (
-arduino board
-A bread board/solder board
-extension cord


So to start gather all required tools and parts.

Now lets load the code on our board.


//SOUND Sensor

int sensorPin = 4;    //Microphone Sensor Pin on analog 4
int YellowLED = 1; 
int RedLED = 4; 
int sensorValue = 0;

void setup() {
  pinMode(YellowLED, OUTPUT);
pinMode(RedLED, OUTPUT);

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin); 

/* If you feel that the sensor values on the serial monitor
are going by too quickly for you to read, you can make it
so that the values only show up on the serial monitor
if you make a noise.  You can replace
if (sensorValue < 509){


  digitalWrite(YellowLED, HIGH);  //Yellow is always on.

  if (sensorValue>25){  //The 'silence' sensor value is 509-511
    delay(15 );            // The red LEDs stay on for 2 seconds
} else {

you can adjust the values under sensorValue for the sensitive.

So after loading the code we can proceed.

Plave the relay and the resistor on the board, the two parallel pins are going to connect to the arduino and the two off slat pins are being connected to one side of the extension cord.

Solder the resistor to one side of the relay's parallel pins and then solder a wire to it and connect said wire to DIGITAL 4 on the arduino.

Now Solder two more wires to the other parallel pin and these are going to be GND wires. Connect one to the middle pin on the sound sensor ( its black) and the second wire connects to the GND on the DIGITAL row of the arduino board.

Sound Sensor Connections
The red wire pin connects to the 5V pin on the arduino board under POWER.
The blue wire pin connects to the ANALOG 4 pin on the arduino board.

Now cut the extension cord in half and cut one side of the two sided cord in half and this will be connected to the uneven sides of the relay.

Now with everything connected, check for bridging and make sure everything is a solid connection.

Plug the extension cord into a wall outlet and then connect a lamp/ light source to it and then power the arduino board and when you snap your fingers the light should flicker on.