⇏ Step 1: Hardware Required:
![Hardware Required](https://cdn.instructables.com/FDB/YEVE/IVHQJZIY/FDBYEVEIVHQJZIY.MEDIUM.jpg?width=614)
- Arduino Uno
- Buzzer
- LED
- LDR (photoresistor)
- 220 and 10k ohm resistor
- Wires
- Breadboard
⇏ Step 2: Buzzer - LED - LDR attach to board
![Buzzer - LED - LDR attach to board](https://cdn.instructables.com/FYZ/8LIK/IVHQJZJ2/FYZ8LIKIVHQJZJ2.MEDIUM.jpg?width=614)
![vlcsnap-2016-11-16-04h50m31s146.png](https://cdn.instructables.com/F60/4NTQ/IVHQJZJ3/F604NTQIVHQJZJ3.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h50m44s521.png](https://cdn.instructables.com/F0L/5VG7/IVHQJZJ4/F0L5VG7IVHQJZJ4.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h51m09s299.png](https://cdn.instructables.com/F70/WACG/IVHQJZJ5/F70WACGIVHQJZJ5.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h51m33s867.png](https://cdn.instructables.com/F4L/CA88/IVHQJZJ6/F4LCA88IVHQJZJ6.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h51m46s633.png](https://cdn.instructables.com/FTQ/3K3D/IVHQJZJ9/FTQ3K3DIVHQJZJ9.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h52m33s508.png](https://cdn.instructables.com/F27/ET0J/IVHQJZJA/F27ET0JIVHQJZJA.MEDIUM.jpg?width=614)
![vlcsnap-2016-11-16-04h52m42s388.png](https://cdn.instructables.com/F9I/QO84/IVHQJZJB/F9IQO84IVHQJZJB.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h53m09s276.png](https://cdn.instructables.com/F2F/IH6K/IVHQJZJE/F2FIH6KIVHQJZJE.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h53m28s420.png](https://cdn.instructables.com/FY0/3BY0/IVHQJZJH/FY03BY0IVHQJZJH.SMALL.jpg?width=204.66666666666663)
- Buzzer attac to board (the buzzer long leg (+) and short leg (-))
- LED attach to board (the LED long leg (+) and short leg (-))
- 220 resistor attach to board from LED long leg (+)
- LDR attach to board
- 10k resistor attach to hboard from LDR one leg
![Arduino Connection](https://cdn.instructables.com/FKE/6IMN/IVHQJZM5/FKE6IMNIVHQJZM5.MEDIUM.jpg?width=614)
![vlcsnap-2016-11-16-04h53m52s128.png](https://cdn.instructables.com/F8F/LEAA/IVHQJZJK/F8FLEAAIVHQJZJK.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h54m52s192.png](https://cdn.instructables.com/FMI/7AKB/IVHQJZJL/FMI7AKBIVHQJZJL.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h55m15s134.png](https://cdn.instructables.com/FUF/KKCI/IVHQJZJM/FUFKKCIIVHQJZJM.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h55m27s474.png](https://cdn.instructables.com/FMY/9VG1/IVHQJZJR/FMY9VG1IVHQJZJR.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h56m03s962.png](https://cdn.instructables.com/F46/TLAG/IVHQJZJX/F46TLAGIVHQJZJX.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h56m15s083.png](https://cdn.instructables.com/FX0/8BZY/IVHQJZK0/FX08BZYIVHQJZK0.MEDIUM.jpg?width=614)
![vlcsnap-2016-11-16-04h56m31s490.png](https://cdn.instructables.com/FTS/UTYA/IVHQJZK2/FTSUTYAIVHQJZK2.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h56m43s455.png](https://cdn.instructables.com/FJF/N4AK/IVHQJZK5/FJFN4AKIVHQJZK5.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h57m12s920.png](https://cdn.instructables.com/F7L/R8BD/IVHQJZK8/F7LR8BDIVHQJZK8.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h57m41s613.png](https://cdn.instructables.com/FZ3/LXBX/IVHQJZKE/FZ3LXBXIVHQJZKE.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h57m59s253.png](https://cdn.instructables.com/FNX/OKXZ/IVHQJZKO/FNXOKXZIVHQJZKO.SMALL.jpg?width=204.66666666666663)
![vlcsnap-2016-11-16-04h58m12s113.png](https://cdn.instructables.com/FKL/6HGU/IVHQJZKZ/FKL6HGUIVHQJZKZ.MEDIUM.jpg?width=614)
![vlcsnap-2016-11-16-04h58m30s685.png](https://cdn.instructables.com/F15/LVHR/IVHQJZLA/F15LVHRIVHQJZLA.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h58m49s704.png](https://cdn.instructables.com/FR1/W2PS/IVHQJZLT/FR1W2PSIVHQJZLT.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h59m05s090.png](https://cdn.instructables.com/FFT/TMQI/IVHQJZLY/FFTTMQIIVHQJZLY.SMALL.jpg?width=307)
![vlcsnap-2016-11-16-04h59m39s153.png](https://cdn.instructables.com/F9O/E5C9/IVHQJZM2/F9OE5C9IVHQJZM2.SMALL.jpg?width=307)
- The wire connect to ground, then the same wire attach to board.
- The wire connect to buzzer short leg, then the same wire attach to GND on the board.
- The wire attach to LED short leg, then the same wire connect to GND on the board.
- The wire connect to 10k resistor empty leg, then the same wire connect to GND on the board.
- The wire connect to +5V, then the same wire attach to LDR empty leg.
- The wire connect to digital 12, then attach to buzzer long leg.
- The wire connect to digital 13, then attach to 220 resistor empty leg.
- The wire connect to A0, then attach to LDR's - resistor's same column.
⇏ Step 4: Code
![Code](https://cdn.instructables.com/F81/U8SX/IVHQJZMA/F81U8SXIVHQJZMA.MEDIUM.jpg?width=614)
![vlcsnap-2016-11-16-05h00m47s926.png](https://cdn.instructables.com/FZA/IQTE/IVHQJZMG/FZAIQTEIVHQJZMG.MEDIUM.jpg?width=614)
Vedio ➧➧➧➧ here
programme
⇩⇩⇩⇩⇩⇩⇩⇩⇩
const int ledPin = 13;
const int buzzerPin = 12;
const int ldrPin = A0;
void setup () {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(ldrPin, INPUT);
}
void loop() {
int ldrStatus = analogRead(ldrPin);
if (ldrStatus >= 400) {
tone(buzzerPin, 100);
digitalWrite(ledPin, HIGH);
delay(100);
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
delay(100);
Serial.println("----------- ALARM ACTIVATED -----------");
}
else {
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
Serial.println("ALARM DEACTIVATED");
}
}
EmoticonEmoticon