Simple Security Alarm
This project, is the most cheap and simple solution, for all the situation that happens, mainly in Brazil, that where this project was created. The principal component of the project,is a movement sensor that will contain the information that have something there , in front of the sensor. Another important thing, this project will over time, he may be solving several bad issues, such as violence, thieves entering unprotected houses.Also, the alarm is technically and more effective than a security camera because the camera does not identify a foreign target and warns (in the case of the alarm, the warning would be the sound) to the inhabitants of the danger. It's small so you can put it anywhere.
Step 1 : Materials
1- Jumper wires (male male and female female ) /BUY : https://www.ebay.com/bhp/male-to-female-jumper-wire
The jumper wires in the project, will have the function to connect the arduino to the components
2- Arduino UNO / BUY: https://www.amazon.com/HiLetgo-ATmega328P-Development-Compatible-Microcontroller/dp/B01AR7YJ3O/ref=pd_lpo_vtph_147_lp_img_3/144-5617709-3840969?_encoding=UTF8&psc=1&refRID=0W9H49KF2ZDYDVEVT7CX
the arduino in our project will be the brain of the project, it will give all the commands for the operation of each component, it will be the most important part, without it the project would never work, without the other materials too, but he and the most important
3- Buzzer /BUY: https://www.amazon.com/a12081600ux0477-Diameter-Terminals-Electronic-Continuous/dp/B00B0Q4KKO/ref=sr_1_6?s=industrial&ie=UTF8&qid=1543006507&sr=1-6&keywords=buzzer
the buzzer will test the operation of the sensor through the sound it will cause the sensor to pick up something because if it did not have the buzzer the sensor would simply pick up the information but not show somehow the presence of someone
4- Movement sensor /BUY: https://www.filipeflop.com/produto/sensor-de-movimento-presenca-pir/
The Presence Sensor has the function of perceiving, that is, detecting a certain type of energy and its variation in the environment, as some person passing by, like walking on the street
Step 2: the Code
To write this code you need to use this app: Arduino App
This is the code that you need to use, to program the project:
#define pinPIR 7
const int pinBuzzer= 5; //const int pinPIR = ;
void setup() { pinMode(pinPIR, INPUT); pinMode(pinBuzzer, OUTPUT); Serial.begin(9600); }
void loop() { bool valorPIR = digitalRead(pinPIR);
if (valorPIR == HIGH){ digitalWrite (pinBuzzer, HIGH); tone(pinBuzzer, 2000); Serial.println(valorPIR); } else { digitalWrite(pinBuzzer, LOW); Serial.println(valorPIR); } }
Step 3: Building
You are going to build the hardware part of the project, based on this image, but you need to add the buzzer.
We connect all the materials directly, because we didnĀ“t used a breadboard, so we attached the jumper wires to the sensor, and to the arduino.
wire 1(yellow in the image)- middle portal of the sensor and portal 7 on the arduino
wire 2(red in the image)- left portal of the sensor and portal 5V on the arduino
wire 3(black in the image)- right portal of the sensor and portal GND on the arduino