این پروژه دارای فناوری GSM و سیستم ضد سرقت با استفاده از تشخیص حرکت PIR می باشد. هر زمان که حرکت تشخیص داده شود، پیامک را به شماره تلفن همراه از پیش تعریف شده ارسال می کند. ما سنسور حرکت PIR را با این پروژه متصل کرده ایم.
سیستم امنیتی خانگی مبتنی بر GSM با هشدار SMS، از سنسور حرکت PIR، مودم GSM و LCD 16×2 برای نمایش وضعیت سیستم استفاده میکند، از طریق مودم GSM که به پینهای سریال Rxd و Txd متصل است، هنگام تشخیص حرکت از PIR، پیامک ارسال میکند. سنسور، شماره موبایل خود را داخل کد در زیربرنامه SendSMS تنظیم کنید.
ویژگی ها:
1. ارسال اس ام اس هشدار سرقت به شماره داده شده.
2. وضعیت سیستم را روی LCD نمایش می دهد.
3. استفاده از سنسور حرکت PIR
4. کم هزینه این پروژه برای نظارت بر امنیت خانه بسیار مفید است
در این پروژه مودم GSM، سنسور PIR، LCD 16×2 و آردوینو قطعات اصلی هستند.
می توانید این پروژه را با استفاده از شبیه سازی Protius امتحان کنید. نمودار مدار، همراه با کد ارائه شده است. فایل های مربوطه را دانلود کنید
مرحله 1: اتصالات را مطابق نمودار مدار انجام دهید
![امنیت خانه GSM](https://duino4projects.com/wp-content/uploads/2017/05/GSM-Home-Security.png)
مرحله 2: آردوینو را برنامه ریزی کنید
آردوینو را با استفاده از کد زیر برنامه ریزی کنید
/* Home Security System with SMS Alert Blog.Circuits4You.com 2016 Demonstrates the use of PIR Motion sensor and GSM Module. The Project generate SMS when motion is detected on PIR Sensor PIR Sensor is connected to Arduino Pin 8 and GSM Module on Serial Communication Lines, Remove GSM Module While Programming. The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground */ // include the library code: #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(7, 6, 5, 4, 3, 2); const int PIR=8; void setup() { pinMode(PIR,INPUT); Serial.begin(9600); // set up the LCD's number of columns and rows: lcd.begin(16, 2); }
} void loop() { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print("Security System "); lcd.setCursor(0, 1); lcd.print(" Activated "); if(digitalRead(PIR)==HIGH) { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print("Theft Detected "); lcd.setCursor(0, 1); lcd.print("Sending SMS....."); sendSMS(); delay(5000); } } void sendSMS() { Serial.println("AT+CMGD=1"); //Delete privious sent SMS delay(1000); Serial.println("AT+CMGF=1"); //Set SMS configuration delay(1000); Serial.print("AT+CMGW="); //Write New SMS Serial.write(34); //Double quotes ASCII Code Serial.print("+9198--------"); //Enter Your Mobile number Serial.write(34); Serial.println(); //Send Crrige return delay(1000); Serial.println("Alert: Theft Detected"); delay(1000); Serial.write(26); //Cntrl+Z delay(1000); delay(1000); Serial.println("AT+CMSS=1"); //Send SMS from memory location 1 delay(4000); }
بیشتر بخوانید: سیستم امنیتی خانه مبتنی بر GSM با هشدار پیامکی
در ادامه، متن انگلیسی این مطلب را میتوانید مشاهده نمایید:
This project has GSM technology and anti-theft system using PIR motion detection. Whenever Motion is detected it sends the SMS on predefined mobile number. We have connected PIR Motion sensor with this project.
GSM based home security system with SMS alert, it uses PIR Motion Sensor, GSM Modem and 16×2 LCD is used to display system status, It Sends SMS through GSM modem that is attached to Serial Rxd and Txd Pins when motion is detected from PIR sensor, Set your mobile number inside the code in SendSMS subroutine.
Features:
1. Sends Theft Alert SMS to Given number.
2. Displays status of system on LCD.
3. Uses PIR Motion sensor
4. Low CostThis project is very useful for Monitoring home security
In this project GSM Modem, PIR Sensor, 16×2 LCD and Arduino are main parts.
You can try this project using Protius simulation. Circuit diagram, is provided with code. Download respective files.
Step 1: Make connections as per circuit diagram
![GSM Home Security](https://duino4projects.com/wp-content/uploads/2017/05/GSM-Home-Security.png)
Step 2: Program the Arduino
Program the arduino using following code
/* Home Security System with SMS Alert Blog.Circuits4You.com 2016 Demonstrates the use of PIR Motion sensor and GSM Module. The Project generate SMS when motion is detected on PIR Sensor PIR Sensor is connected to Arduino Pin 8 and GSM Module on Serial Communication Lines, Remove GSM Module While Programming. The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground */ // include the library code: #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(7, 6, 5, 4, 3, 2); const int PIR=8; void setup() { pinMode(PIR,INPUT); Serial.begin(9600); // set up the LCD's number of columns and rows: lcd.begin(16, 2); }
} void loop() { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print("Security System "); lcd.setCursor(0, 1); lcd.print(" Activated "); if(digitalRead(PIR)==HIGH) { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print("Theft Detected "); lcd.setCursor(0, 1); lcd.print("Sending SMS....."); sendSMS(); delay(5000); } } void sendSMS() { Serial.println("AT+CMGD=1"); //Delete privious sent SMS delay(1000); Serial.println("AT+CMGF=1"); //Set SMS configuration delay(1000); Serial.print("AT+CMGW="); //Write New SMS Serial.write(34); //Double quotes ASCII Code Serial.print("+9198--------"); //Enter Your Mobile number Serial.write(34); Serial.println(); //Send Crrige return delay(1000); Serial.println("Alert: Theft Detected"); delay(1000); Serial.write(26); //Cntrl+Z delay(1000); delay(1000); Serial.println("AT+CMSS=1"); //Send SMS from memory location 1 delay(4000); }