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.

  • 1,694 views
  • 1 comment
  • 7 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

Bluetooth Controlled Bot (Using Adafruit L293D Motor Driver)

Project showcase by Chandran N

  • 2,630 views
  • 0 comments
  • 14 respects

Control the Speed of Brushless DC Motor Using Bluetooth

Project tutorial by mohitmehlawat

  • 8,039 views
  • 3 comments
  • 17 respects

Motor Controlled with Arduino

by Benjamin Larralde

  • 26,023 views
  • 22 comments
  • 74 respects

ESP8266 + L298N Motor Drive + Smartphone

by luciorocha

  • 24,434 views
  • 11 comments
  • 33 respects

Control Speed and Direction of Motor

Project in progress by ahmed soliman

  • 18,298 views
  • 5 comments
  • 25 respects
Add projectSign up / Login