In this tutorial, we build a very useful Arduino Intruder Alarm. The project is very easy to build and the cost of it is very low. All you need is an Arduino Uno, a GSM shield, a PIR sensor, and a DS3231 real-time clock. You can buy all these parts from the links below. The project, when it detects motion, it sends an SMS to a predefined telephone number! That’s a great project to build and protect your belongings!

Intro to the Arduino Intruder Alarm project

The parts needed for this project are these: An Arduino Uno, the TinySine GSM shield a PIR sensor, a DS3231 Real Time Clock module some wires and an LED if you need to debug your project. The cost of the project is very low. You can build this project for less than 35 euros. You need 25 euros for the GSM shield, you need 1.5 euros for the PIR sensor 1.5 euros for the Real Time Clock, and around 5 euros for the Arduino. You can find links for all the parts of this project in the description of the video.

——————–
WHERE TO BUY
——————–

1. GSM Shield: https://educ8s.tv/part/GSMShield

2. PIR SENSOR: https://educ8s.tv/part/PIRSensor

3. DS3231: https://educ8s.tv/part/DS3231

4. Arduino Uno: https://educ8s.tv/part/ArduinoUno

5. LED: https://educ8s.tv/part/LEDs

6. Small Breadboard: https://educ8s.tv/part/SmallBreadboard

7. Wires: https://educ8s.tv/part/Wires

Full disclosure: All of the links above are affiliate links. I get a small percentage of each sale they generate. Thank you for your support!

[adsense]

Let’s now see how to connect all the parts together. Before starting I encourage you to watch some of the previous videos on the channel. I have prepared detailed tutorials on the GSM shield the PIR sensor and the DS3231 real-time clock. By watching these videos you would have a better understanding of all the parts and it will be easier to build this project. First, we connect the GSM shield to Arduino Uno. Next, we connect the real-time clock. Vcc goes to breadboard Vcc. Ground goes to breadboard Ground. SDA goes to analog pin 4 on Arduino which is now accessible via the GSM shield. Lastly, SCL goes to analog pin 5 of Arduino. Let’s now connect the PIR sensor. Vcc the pin next to the diode goes to breadboard Vcc. Ground goes to breadboard Ground. And lastly, the output pin, the middle one, goes to digital pin 7 of Arduino. Next, we connect the breadboard Vcc to Arduino 5V and the breadboard ground to Arduino Ground. Next, we connect the LED. The long leg goes to digital pin 13 and the other one to Ground.

——————–
LIBRARIES
——————–

? GSM Library: http://www.tinyosshop.com/datasheet/GSM_GPRS_GPS_Shield_GSMSHIELD.rar

Now we are ready to power on Arduino. At first, the project connects to the GSM network. As you can see the LEDs will start flashing here in a moment. OK, here it is. At the same time, the PIR sensor initializes and that initialization process takes time as well. Our project will be ready in about 30 seconds from power on. Let’s wait for a bit. The LED is flashing slowly that means that we are connected to the GSM network. Now if I place my hand in front of the PIR sensor, the LED will go on, in order to visually see the detection and it will send an SMS to my cell phone along with the time that the motion happened. Let’s try it. OK. The LED goes on, now we are going to receive an SMS message, let’s wait… OK, here it is As you can see motion detected at 11:35. The LED will stay on for around one minute in order not to send SMS messages all the time if it detects the same motion over and over again. Now let’s go to the computer and see the software side of the project.

In the code of the project we use two libraries that need to be downloaded. The first one can be downloaded directly from the Arduino IDE. I’m using the latest version the Arduino IDE which is 1.6 .5 You have to go to Sketch -> Include Library-> Manage libraries and search for the DS3231 library. OK we search here DS3231 and you have to download the Sodaq DS3231 library directly from Arduino IDE. The other library that we have to use is the GSM shield library that you can find the link for this library in the description of the video. The code of the project is very simple. At first we initialize the GSM shield. Then we read the PIR pin all the time. If the PIR pin goes HIGH we read the time from the Real Time Clock and send an SMS to a predefined telephone number. The we wait for a minute, before reading the PIR pin again. In order to set time to the Real Time clock, we can use an example the comes with the library in order to do that. We go to File->Examples to Sodaq_DS3231 and we load the adjust sketch. In this line here we enter the date Year, month, date, hour minute, second, and weekday and we upload it to our Arduino once. Then the time is set and can be kept internally for many years with the embedded battery of the module. As you can see the code of the project is very simple.

——————–
CODE
——————–

 

 

 

——————–

SUBSCRIBE ON YOUTUBE

——————–

Never miss a video: Subscribe to educ8s.tv