A security system is a system designed to detect intrusion – unauthorized entry – into a building or other area. Security systems can be used in residential, commercial, industrial, and military properties for protection against burglary (theft) or property damage, as well as personal protection against intruders. Security alarms in residential areas show a correlation with decreased theft. Car alarms likewise help protect vehicles and their contents.
This system uses an inexpensive PIR Motion Sensor. PIR sensors allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range. They are small, inexpensive, low-power, easy to use, and don't wear out. They are often referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR motion" sensors.
CONSTRUCTION1. Setup the Bolt IoT Module using the Bolt App in order to connect it to your WiFi Network. Refer to https://docs.boltiot.com/docs for more info.
2. Both the Blue and Green LEDs need to be glowing steadily once powered ON.
3. Construct the circuit as shown in the Schematic.
4. Program the Arduino UNO with the Arduino code provided below (Security_System_with_Telegram_Alert.ino) using the Arduino IDE.
5. You will need to install 'Telegram' on you phone. Complete the initial setup...
6. Now, create a new channel in Telegram : Give an appropriate 'channel name' (Eg: Smart Home) and a short 'description'. Then set the 'Channel type' as 'Public Channel' and give a name for the 'Permanent link' (No spaces ; you can use underscores) (Eg: t.me/smart_home_x01 ).
7. Keep a note of this Channel permanent link name. It will be required later on to send messages to this channel. For example, the channel link name here is "smart_home_x01". So, here your 'telegram_chat_id
' will be "@smart_home_x01".
8. In Telegram, click on the top right search icon and search for 'BotFather' with a blue tick mark next to its name. This will take you to a chat window with the "BotFather". The chat will have a few items already and will display you a list of commands to get started.
9. Since we need to create a new Bot, go ahead and type in "/newbot" in the window.
10. It will ask you to type in a few more details like Bot name and Bot username. When your bot is created successfully, you will receive a message that will contain the Bot Token.
11. For example, if your Bot token is "894346529:AAhuJ2XJQy5dlEtLYF0sc0Z_qu0fSqihSSc". Please save it as telegram_bot_id. The telegram_bot_id is saved as "bot" followed by the bot token. So, in this example, the telegram_bot_id
will be "bot894346529:AAhuJ2XJQy5dlEtLYF0sc0Z_qu0fSqihSSc".
12. From the App home screen, open the channel you have created earlier. In the screen, click on the channel name on the top to open the information for the Channel.
13. Click on the Administrators button so that you can add the newly created bot to the channel. Search for the bot that you have created using the Bot's username. Once you have found the correct Bot click on it to add it to the channel.
14. You will be asked to confirm the rights for the bot. Press on the tick mark on the top right to continue adding the bot to the channel. Make sure that the bot has the rights to "Post Messages". You will now see the newly created Bot in the list of administrators for the channel.
15. You can get the "bolt_api_key
" and "device_id
" for your device from https://cloud.boltiot.com.
16. For the following steps you will need to use a Linux System (or Raspbian running on a Raspberry Pi) : First you will need to install the Bolt Python Library. Refer to https://docs.boltiot.com/docs/python-library for the steps.
17. Save both the python files in a single directory(/folder) (conf.py and security_system.py). Remember to change the credentials in conf.py.
18. Power on your Arduino and Run security_system.py using the command sudo python3 security_system.py
.
19. You should have your Security System up and running !
WORKINGBy default, the system will be Disarmed. In order to Arm it you will need to enter the password preset in the Arduino Code in line 4 -- Password password = Password( "1234" ); --- Here you can change the password to your desired choice. Once you enter the password, press '*'. The system is now Arming. Once the Green LED stops blinking and becomes steady, the system is Armed. Now, if there is a motion in front of the PIR Sensor, the Siren is set off, the Red LED turns on and a message is sent through Telegram using the Bolt IoT Module. The Siren turns off after a few seconds. The system can be Disarmed by entering the password and pressing '*'.
Comments
Please log in or sign up to comment.