|
Arduino Nano V3 |
x 1 | |
|
ZRE200GEZilog
|
x 1 | |
|
SIM800LSIMCOM(芯讯通无线科技)
|
x 1 |
|
Ender 3 S1 3D Printer |
Intruder alert system with SMS
In several places, we must monitor the security of spaces and prevent intruders from entering prohibited places with the aim of carrying out robberies and thefts. This is very common in businesses and homes and generates great losses.
One way to prevent this problem is through a surveillance and intruder alert system, which is capable of monitoring and warning those responsible when an invasion occurs in their spaces.
Based on this principle we developed an intruder alert system. This system, in addition to monitoring, warns in real time that someone is invading the space. This increases security efficiency and allows those responsible to make decisions to call the police and prevent any problems from occurring.
Below we have the developed device. You can download the 3D model in this article.
The device uses a sensor to detect the presence of intruders and sends an SMS with an alert message to a cell phone.
This project was developed in partnership with PCBWay. You can use printed circuit board fabrication and digital prototyping services to create any product.
Next, we will explain the project construction step by step and the programming logic.
Development of the SMS Alert System
The developed system aims to, in real time, send an alert to a cell phone and allow an action to be carried out quickly. This speeds up and allows you to call the police to avoid any risk of robbery or break-in.
The project uses three devices:
- Arduino Nano,
- Sensor PIR, and
- Módulo SIM800L.
The devices were installed in a case to be mounted on the wall.
What is the working principle of this device?
The Arduino reads the PIR sensor and checks whether or not the presence of intruders is being detected. If the sensor detects movement of people, an SMS alert will be sent through the SIM800L module. This message will be received by the business or home owner.
The SIM800L module is shown in the figure below.
This module uses GSM technology and is capable of sending/receiving calls and SMS messages to any cell phone. During communication you need to insert a GSM CHIP so that it is able to exchange information with the cell phone registered in the Arduino program.
All devices will be installed in the internal structure of the case.
The 3D Structure of the Intrusion Detection System
The 3D structure is shown in the figure below. Go to this link and download the 3D file from the enclosure.
The enclosure design will be developed with the Ender 3 S1 Printer in PLA material.
This is the new model developed by Creality. It is capable of printing different materials and has great print quality, accuracy and motion stability during printing.
See other features of the new Ender 3 S1 Printer.
The enclosure is divided into 2 parts: the cover and the box. Below we have the image of the two parts.
The box region has space to store an Arduino Nano and the SIM800L Module. In addition, a hole was inserted in the frame for a power supply connector for the entire device.
The lid structure has threads for easy fixing with the case body. Below we have the structure of the cover. It has a hole for outputting the sensing region of the PIR sensor.
The PIR sensor is installed through screws on the cover structure itself. See the figure below.
To facilitate the fixation of the sensor, use metallic insert nuts in the structure of the holes of the cover.
Below we have the insertion nut.
The nut must be inserted into the holes with the aid of heat. Generally, a soldering iron is used to heat the metallic region of the nuts and facilitate their connection with the holes in the cover. See the figure below.
Next, we will see the structure of the project's programming logic.
System Programming Logic and Control Circuit
The design circuit is shown in the figure below.
The following is the project's programming logic. We will discuss in detail how the code works.
#include <SoftwareSerial.h>
SoftwareSerial chip(10, 11);
String SeuNumero = "+xxxxxxxxxxxxx"; //
#define sensor 12
bool ValorAtual = 0, ValorAnterior = 0;
void setup()
{
Serial.begin(9600);
Serial.println("Inicializando Sistema...");
delay(5000);
chip.begin(9600);
delay(1000);
pinMode(sensor, INPUT); //Configura o Pino do Sensor como Entrada
ValorAnterior = analogRead(sensor); //Captura um primeiro valor de referencia inicial para a variavel ValorAnterior
}
void loop()
{
//Le o valor do pino do sensor
ValorAtual = digitalRead(sensor);
if(ValorAtual == 1 && ValorAnterior == 0)
{
NotIntruder();
ValorAnterior == 1;
}
if(ValorAtual == 1 && ValorAnterior == 0)
{
DetectIntruder();
ValorAnterior == 0;
}
}
void DetectIntruder() //Funcao para enviar mensagem de alerta Umidade Baixa
{
chip.println("AT+CMGF=1");
delay(1000);
chip.println("AT+CMGS=\"" + SeuNumero + "\"\r");
delay(1000);
String SMS = "Intruder Detected";
chip.println(SMS);
delay(100);
chip.println((char)26);
delay(1000);
}
void NotIntruder()//Funcao para enviar mensagem de alerta Umidade Normal
{
chip.println("AT+CMGF=1");
delay(1000);
chip.println("AT+CMGS=\"" + SeuNumero + "\"\r");
delay(1000);
String SMS = "Without Intruder";
chip.println(SMS);
delay(100);
chip.println((char)26);
delay(1000);
}
For this project, we use library SoftwareSerial. The library will be used to communicate the Arduino with SIM800L Module through serial communication.
#include <SoftwareSerial.h>
Next, we'll define what is the pin in the Arduino that will be used like a RX and TX serial communication.
SoftwareSerial chip(10, 11);
Subsequently, we need to create a string and add the mobile number to that string. You must enter the + Country Code and your cellphone number after the country code.
String SeuNumero = "+xxxxxxxxxxxxx";
After, it was defined as the sensor pin and the variables of the code.
#define sensor 12
bool ValorAtual = 0, ValorAnterior = 0;
Finally, is executed the setup function in the Arduino.
The function void setup() and void loop() in Arduino
In the serial communication will be initialized the serial of the Arduino pins (digital pin 0 and digital pin 1) and the virtual serial through the library SoftwareSerial with the object chip.
void setup()
{
Serial.begin(9600);
Serial.println("Inicializando Sistema...");
delay(5000);
chip.begin(9600);
delay(1000);
pinMode(sensor, INPUT); //Configura o Pino do Sensor como Entrada
}
Finally, the sensor pin was defined as a digital input pin. Now, in the void loop function, the system will analyze the sensor state and will send the SMS message for the user.
In the code presented below, the system will read the reed switch sensor and will store its value in the variable ValorAtual.
void loop()
{
//Le o valor do pino do sensor
ValorAtual = digitalRead(sensor);
if(ValorAtual == 1 && ValorAnterior == 0)
{
ClosedDoor();
ValorAnterior == 1;
}
if(ValorAtual == 0 && ValorAnterior == 1)
{
OpenedDoor();
ValorAnterior == 0;
}
}
After, the system will verify what was the value read off the sensor. Therefore, was used two conditions to verify the state of the PIR sensor.
In this code presented above, you can see the first condition. It will be presented below.
if(ValorAtual == 1 && ValorAnterior == 0)
{
DetectIntruder();
ValorAnterior == 1;
}
As is possible to see, case the read value of the sensor is equal at 1 and the variable ValorAnterior is equal at 0, the system will enter the condition.
In this way, the system will execute the function DetectIntruder() and will send the message "Intruder Detected" and hereafter will insert the value 1 for the ValorAnterior variable.
This variable is used to ensure that the code flow enters the condition only once. This prevents the system from sending a message several times, while the door is closed or open.
The other condition has a similar working if compared with the condition presented above.
if(ValorAtual == 0 && ValorAnterior == 1)
{
NotIntruder();
ValorAnterior == 0;
}
When the sensor has the 0 value returned by the function, the variable ValorAtual will be 0 and the variable ValorAnterior will be 1. In this way, the system will enter in this condition and will execute the functions.
As is possible see, the function NotIntruder will be executed to send the "Withouth Intruder" message for the user.
Finally, the user will receive an alert message and will contact the responsible people or police to verify what is occurring in your sector
Acknowledgment
Thanks to the PCBWay for support and produce and assembly PCBs with better quality.
#include <SoftwareSerial.h>
SoftwareSerial chip(10, 11);
String SeuNumero = "+xxxxxxxxxxxxx"; //
#define sensor 12
bool ValorAtual = 0, ValorAnterior = 0;
void setup()
{
Serial.begin(9600);
Serial.println("Inicializando Sistema...");
delay(5000);
chip.begin(9600);
delay(1000);
pinMode(sensor, INPUT); //Configura o Pino do Sensor como Entrada
ValorAnterior = analogRead(sensor); //Captura um primeiro valor de referencia inicial para a variavel ValorAnterior
}
void loop()
{
//Le o valor do pino do sensor
ValorAtual = digitalRead(sensor);
if(ValorAtual == 1 && ValorAnterior == 0)
{
NotIntruder();
ValorAnterior == 1;
}
if(ValorAtual == 1 && ValorAnterior == 0)
{
DetectIntruder();
ValorAnterior == 0;
}
}
void DetectIntruder() //Funcao para enviar mensagem de alerta Umidade Baixa
{
chip.println("AT+CMGF=1");
delay(1000);
chip.println("AT+CMGS=\"" + SeuNumero + "\"\r");
delay(1000);
String SMS = "Intruder Detected";
chip.println(SMS);
delay(100);
chip.println((char)26);
delay(1000);
}
void NotIntruder()//Funcao para enviar mensagem de alerta Umidade Normal
{
chip.println("AT+CMGF=1");
delay(1000);
chip.println("AT+CMGS=\"" + SeuNumero + "\"\r");
delay(1000);
String SMS = "Without Intruder";
chip.println(SMS);
delay(100);
chip.println((char)26);
delay(1000);
}
Intruder alert system with SMS
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(1)
- (DIY) C64iSTANBUL May 24,2022
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Silícios Lab silicioslab
- Electronic Enclosure applied for electronic projects IntroductionWhen designing electronics, the enclosure plays a crucial role that is often overlooked....
- IoT Indoor system with ESP32 to monitor Temperature, Humidity, Pressure, and Air Quality IntroductionAir quality, temperature, humidity and pressure are essential elements to ensure healthy...
- WS2812B RGB LED Controller with ESP8266 via WiFi IntroductionWS2812b addressable RGB LEDs are devices widely used in lighting projects. They are foun...
- Electronic Board for Cutting Electrical Power to Devices and Machines IntroductionAn energy saving system for cutting electrical energy in machines is a fundamental piece...
- PCB Board Home Automation with ESP8266 IntroductionThe incorporation of the ESP8266 module into home automation represents a significant ad...
- Dedicated Control Board for Mobile Robots with Wheels IntroductionFor a long time we developed several prototypes and teaching kits of mobile robots and w...
- Traffic turn signal for bicycles IntroductionDoes every project with electronic logic need a Microcontroller or Arduino to be develop...
- Mini Arduino with ATTINY85 Do you know the ATTINY85 microcontroller? This article has news and a gift for you. Many people deve...
- Christmas Tree The tree used to signal light of Christmas.
- Electronic Enclosure applied for electronic devices IntroductionWhen designing electronics, the enclosure plays a crucial role that is often overlooked....
- Electronic Enclosure for Programmable Logic Controller The housing developed for programmable logic controllers is a practical and efficient solution for t...
- Payment PCB for machines and services IntroductionIn many commercial establishments, hospitals and other places, there are video game equi...
- Relay High Power Printed Circuit Board IntroductionEfficient management of electrical loads is essential for optimizing performance and saf...
- Weather gadget with clock through ESP8266 IntroductionImagine a device that combines technology with an elegant design, bringing functionality...
- ESP32 MPU6050 Monitor IntroductionVarious industrial equipment is essential for the adequate production of products, parts...
- Digital Speedometer for Bicycles IntroductionCycling, increasingly popular both as a recreational activity and as a means of transpor...
- Arduino-based development board with extra features IntroductionArduino is an excellent tool for anyone who wants to develop prototypes. The board has a...
- How to develop low-energy devices powered by batteries? IntroductionIn recent years, there has been a major advance in the area of embedded systems through ...
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
111 0 0 -
DIY Laser Power Meter with Arduino
162 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
154 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
554 0 2