A simple sound activated bot, turn On when there is a sound and turn off if it hear sound again, It don't have any specific purpose just a toy with minimum intelligence lol.
This robot uses sound detecting sensor, which actually produces vibration whenever there is a noise, it cannot measure the db of the sound that producing, all it can do is to produce a signal when there is a sound .
int Tomotor = 8; // signal to motor driver
int soundsensor = 7; // input from sound sensor
boolean state = false;
void setup()
{
pinMode(Tomotor, OUTPUT);
pinMode(soundsensor, INPUT);
}
void loop()
{
if (digitalRead(soundsensor) == LOW)
{
delay(100);
state = !state;
digitalWrite(Tomotor, state);
}
}
--------------------------------------------------------------------------------------------------------------------------
This robot uses sound detecting sensor, which actually produces vibration whenever there is a noise, it cannot measure the db of the sound that producing, all it can do is to produce a signal when there is a sound .
sound sensor
Arduino Program:
--------------------------------------------------------------------------------------------------------------------------
int soundsensor = 7; // input from sound sensor
boolean state = false;
void setup()
{
pinMode(Tomotor, OUTPUT);
pinMode(soundsensor, INPUT);
}
void loop()
{
if (digitalRead(soundsensor) == LOW)
{
delay(100);
state = !state;
digitalWrite(Tomotor, state);
}
}
--------------------------------------------------------------------------------------------------------------------------