Welcome to circuitspedia.com

bird tone sound generator using arduino

Bird Sound Generator Circuit Using Arduino

Bird Sound Generator Circuit using Arduino

This is the schematic diagram of the birds sound generator. Connect 1 NPN transistor BC547, emitter pin of this transistor is conned with the 5V supply and a 10K resistor is connected with Ground to pin no 2 of Arduino. Connect A push button switch between the pin no 2 and 5v VCC supply. A speaker is connected with the collector of BC547 and Ground. 

bird tone sound generator using arduino

Arduino Program for Birds Sound Generator

int buzzer = 12;
int butt = 3;
int count = 10;
int count2 = 5;
int i;
void setup() {
  // put your setup code here, to run once:
pinMode(butt,INPUT);
pinMode(buzzer,OUTPUT);
}
void loop() {

if(digitalRead(butt)==HIGH){

    while(count2 >0){
 for( i = 300; i>0; i--){
   digitalWrite(buzzer,HIGH);
  delayMicroseconds(i);
  digitalWrite(buzzer,LOW);
  delayMicroseconds(i);
  } 
delay(100);
    count2 = count2 -1;
      } 
      count2 = 5;
      
    while(count >0){
   
  for( i = 0; i <300; i++){
  digitalWrite(buzzer,HIGH);
  delayMicroseconds(i);
  digitalWrite(buzzer,LOW);
  delayMicroseconds(i);
  } 
  
   count = count -1;
  }
count = 10;
 for( int i2 = 300; i2>0; i2--){
  digitalWrite(buzzer,HIGH);
  delayMicroseconds(i2);
  digitalWrite(buzzer,LOW);
  delayMicroseconds(i2);
  } 

delay(400);

   while(count2 >0){
 for( i = 300; i>0; i--){
   digitalWrite(buzzer,HIGH);
  delayMicroseconds(i);
  digitalWrite(buzzer,LOW);
  delayMicroseconds(i);
  } 
delay(400);
    count2 = count2 -1;
      } 
      count2 = 5;
      
    while(count >0){
   
  for( i = 0; i <300; i++){
  digitalWrite(buzzer,HIGH);
  delayMicroseconds(i);
  digitalWrite(buzzer,LOW);
  delayMicroseconds(i);
  }
  delay(100); 
   count = count -1;
  }
count = 10;
 for( int i2 = 300; i2>0; i2--){
  digitalWrite(buzzer,HIGH);
  delayMicroseconds(i2);
  digitalWrite(buzzer,LOW);
  delayMicroseconds(i2);

}
}
}

 Video

About the Author

Admin

Hi, My name is Aman Bharti, I am interested in making and study of Electronics, circuit diagram, PCB designing and layout etc. I like to share the knowledge and all ideas with people which I get from My Experiment & from different sources. I try to provide any circuit details deeply with test results as possible. If you want to give a suggestion or comments on anything, please leave your comment in the comment box of the related page.

Leave a Reply

Your email address will not be published. Required fields are marked *