Project tutorial
Clap Controlled DC Motor

Clap Controlled DC Motor © GPL3+

You can use different appliances. This project will turn the DC motor on or off by clapping.

  • 853 views
  • 0 comments
  • 4 respects

Components and supplies

Apps and online services

About this project

This is a basic project. I have not used very complex programming as it is helpful for beginners.

Code

CodeC/C++
/*For this project you will have to connect external power supply of 9V or 5V to the 12V pin of driver.*/
int soundSensor=2; //This is the input pin connected to digital output of sound sensor
int LED=4; //This pin is connected to led for indication and input to motor driver
int stat = 5; //This pin is used as input to verify that LED pin is on or off
void setup() {
 pinMode(soundSensor,INPUT);
 pinMode(LED,OUTPUT);
 pinMode(stat,INPUT);
}

void loop() {
 stat = digitalRead(5);
  int SensorData=digitalRead(soundSensor); 
  //Now to turn on
  if(SensorData==1) //If the sensor detected any sound
  {
     if(stat==false) //And if Led pin is false or off
     {
       
        digitalWrite(LED,HIGH);//We will turn onn the input pin for H-Bridge driver and LED
       
digitalWrite(8, LOW);//This is to ensure that our DC motor rotates in one direction
     }
    }
  
   
  //Now to turn off
   if(SensorData==1) //If the sensor detected any sound
   {

    if(stat==true) //And if Led pin is true or on
    {
     
        digitalWrite(LED,LOW); //Now the dc motor won't work as there is no input to the driver
       
    
   
    }
  
 } 
}
  

Schematics

Schematics for clap switch
Clap motor gofy2jnerm

Comments

Similar projects you might like

Control the Speed of Brushless DC Motor Using Bluetooth

Project tutorial by mohitmehlawat

  • 5,456 views
  • 1 comment
  • 13 respects

ESP8266 + L298N Motor Drive + Smartphone

by luciorocha

  • 19,341 views
  • 11 comments
  • 30 respects

Control Speed and Direction of Motor

Project in progress by ahmed soliman

  • 15,403 views
  • 4 comments
  • 22 respects

RC Rover Controlled by Gest

Project showcase by Salim Khazem

  • 1,436 views
  • 1 comment
  • 14 respects

Motor Controlled with Arduino

by Benjamin Larralde

  • 21,545 views
  • 20 comments
  • 61 respects
Add projectSign up / Login