This project is based on a sound based servo control, where the user can create sounds between the range of the sensor to make a servo move.
This is a kind of fun project so if anyone is using this to make a automated lock in their own house then JB electronics is not at all responsible as warning is already being given that this adds another and a easy way for the intruders to break in their house.
The working of this project is very simple. Whenever the sensor hears any sound under its range, it make the servo rotate at about an degree of 180. This in turns turn on a LED to make the user sure about the direction of the servo. When a similar sound is produced again, then, it brings the servo to its original place, turning the LED off.
For this, you will need:
1) Arduino UNO board
2) Sound sensing module
3) Servo
4) LED
5) Breadboard
6) A 1k ohm resistor
7) Jumper wires
Here is the code:
#include <Servo.h>
Servo myservo;
int pos = 0;
int soundSensor=2;
int LED=4;
boolean LEDStatus=false;
void setup() {
myservo.attach(9);
pinMode(soundSensor, INPUT);
pinMode(LED, OUTPUT);
}
void loop() {
int SensorData=digitalRead(soundSensor);
if(SensorData==1){
if(LEDStatus==false){
LEDStatus=true;
digitalWrite(LED, HIGH);
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
else{
LEDStatus=false;
digitalWrite(LED, LOW);
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
}
}

EXPANDED TECHNICAL DETAILS
Acoustic Impulse Automation
This project demonstrates how to control mechanical movement using high-speed acoustic event detection.
- Acoustic Envelope Mapping: The Arduino captures analog signals from a high-gain microphone module. The firmware looks for a specific "Peak and Decay" signature that matches a human clap, ignoring steady background noise.
- State-Toggle Servo Logic: On every successful "Clap," the Arduino toggles a servo motor's position (e.g., 0° to 90°). This can be used to open curtains, turn a switch, or trigger a pet feeder without physical contact.
Performance
- Timed Sensitivity Window: Includes a 500ms "Quiet Period" after every detected clap to prevent double-triggering caused by echoes or the sound of the servo's own mechanical movement.