siddharthabezwada
Published © GPL3+

Light up buzzer alarm

My project is a brightness increasing buzzer alarm.

IntermediateFull instructions provided228
Light up buzzer alarm

Things used in this project

Hardware components

Buzzer, Piezo
Buzzer, Piezo
×1
LED (generic)
LED (generic)
×3
Male/Male Jumper Wires
×8
Photo resistor
Photo resistor
×1
Resistor 1k ohm
Resistor 1k ohm
×3

Story

Read more

Custom parts and enclosures

img20200821111944_jJM6xhq8ov.jpg

Housing

Schematics

Testing

img_20200821_110857_(2)_vha5TyE53m.jpg

Code

Code for project

Python
void setup() {
  pinMode(9, OUTPUT);//Setup for pin
  pinMode(10, OUTPUT);//Setup for pin
  pinMode(11, OUTPUT);//Setup for pin
  pinMode(A4, INPUT);//Setup for pin
  pinMode(3, OUTPUT);//Setup for pin
  
}
int led13 = 13;//Initialises and assorts name for the LED pin
int led12 = 12;//Initialises and assorts name for the LED pin
int led11 = 11;//Initialises and assorts name for the LED pin
int led10 = 10;//Initialises and assorts name for the LED pin
int led9 = 9;//Initialises and assorts name for the LED pin
int led8 = 8;//Initialises and assorts name for the LED pin
int photoresistor;//Initialising photoresistor pin
int buzzer = 3;//Initialising pin number for buzzer

void loop() {
  photoresistor = digitalRead(A4);//Initialising function of photoresistor
  digitalWrite(led10, HIGH);//Turning on LED
  digitalWrite(led9, HIGH);//c
  digitalWrite(led11, LOW);//Turning off LED
  digitalWrite(led9, LOW);//Turning off LED
  digitalWrite(led10, LOW);//Turning off LED
  digitalWrite(led11, LOW);//Turning off LED
  delay(300);
if (photoresistor < 100){//Initialising photoresistor brightness intake 
  digitalWrite(led8, HIGH);//Turning off LED
  digitalWrite(led9, HIGH);//Turning off LED
  digitalWrite(led10, HIGH);//Turning off LED
}
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 494, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 994, 1000);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 3000);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 994, 1000);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 3000);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 20, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 20, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 20, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 20, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
}

Credits

siddharthabezwada
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.