Modular Smart Home Security System
by VarunBoopathi in Circuits > Arduino
348 Views, 0 Favorites, 0 Comments
Modular Smart Home Security System
Here is the guide for making the modular smart home system. This project was inspired through our CS453 course in which we had to incorporate concepts of smart home technology . Our goal is to address issues of home security in a manner that utilizes smart technology. The modular aspect of our system is important as we want to allow the users to select the modules that are most appropriate and beneficial for them. Our current design features three modules each with a unique feature to protect as aspect of the home. Door Sensor: sensor intended to be placed on the front door of a house or office building, triggering when the door opens. Valuable Object Sensor: a pressure plate sensor that the user can place valuable items on. When the object is removed from the plate, the owner will be notified. Noise Monitor: This sensor would monitor the noise level in a building, so that if there anyone tried to enter the system would pick up the noise and notify the owner. The modules in our project will also be controlled by a central remote, which in our case is the Arduino with the joystick. Utilizing this system to turn on and off the device, there are two scenarios for the user to turn the device off. If they know that they will be returning to the house shortly after leaving or if they have to deactivate the system once it triggers. The Joystick control allows for the user to turn off the system, asking the user to input their password (series of gestures) in order to turn off the system.
Supplies
Arduino Metro Mini (x3) https://www.adafruit.com/product/2590
Bluetooth chip, one way connection (Blufruit Le spi) https://learn.adafruit.com/introducing-the-adafru...
Bluetooth chip (2 way connection) bluefruit UART chip https://learn.adafruit.com/introducing-the-adafru...
Joystick https://www.amazon.com/KY-023-Joystick-Sensor-Mod...
Piezo Motor https://www.digikey.com/en/products/detail/seeed-...
Proximity sensor https://learn.adafruit.com/adafruit-vl53l0x-micro...
Prototype Board (x3) https://kjdelectronics.com/products/arduino-uno-p...
Pressure Plate https://www.amazon.com/SENSING-RESISTOR-SQUARE-1o...
Microphone https://www.adafruit.com/product/1063?gclid=Cj0KC...
Software Requirements
Arduino https://www.arduino.cc/
Download Arduino from the above website in order to run the code for the modules.
SQL Server
Download MySQL https://dev.mysql.com/downloads/
After downloading and installing the software, please follow this link on guidance on how to set up the server on your local machine and how to create tables to hold your sensor data:
https://dev.mysql.com/doc/mysql-getting-started/e...
You will need to create a database called SENSOR_DATA and in that database, create three new tables called control_stick, pressure_plate, and proximity_sensor. The code used to create these table is below:
CREATE TABLE control_stick ( attempt_date DATETIME, valid_password VARCHAR(120) );
CREATE TABLE pressure_plate ( alert_date DATETIME );
CREATE TABLE proximity_sensor ( alert_date DATETIME );
Wiring Main Control Hub
Wire the Joystick:
- Connect vin to 5v
- Connect gn to ground
- Connect yout to analog pin 0
- Connect xout to analogue pin 1
- Connect select to digital pin 2
Wire the LED Lights:
- Connect the red light to digital pin 5 with a 10 k resistor
- Connect the green light to digital pin 4 with a 10 k resistor
Test Code:
Downloads
Wiring the Bluetooth Chip (2 Way Connection)
- Connect the 5volt out of the Arduino board to the vin of the bluetooth chip
- Connect Gnd pin to ground Connect the Txo pin to digital pin 10
- Connect RTS to digital pin 8 Connect RXI to pin 9
- Connect CST to pin 11
- Connect Mod to pin 12
Wiring Main Door Sensor
- Connect vin to 5 volt power supply.
- Connect ground to ground.
- Connect SCL to A5 (clock line for Arduino)
- Connect SDA to A4 (data input line for Arduino)
Test Code:
Downloads
Wiring the Valuable Object Sensor
- Connect power to vin
- Connect ground to gnd
- Solder together the ground and a wire connected to analogue pin A0 with a 300 k resistor
Test Code:
Downloads
3D Printing Main Control Hub Housing
The only setup necessary for our 3D prints was the preparation of the STL file. No additional setup process was necessary for our 3D prints, the print staff handled the creation of the Cura files and the actual starting of the print itself. After a print was finished we had to leave it in water so that the supports could dissolve and then clean it before inserting the components.
3D Printing Valuable Object Sensor Housing
The only setup necessary for our 3D prints was the preparation of the STL file. No additional setup process was necessary for our 3D prints, the print staff handled the creation of the Cura files and the actual starting of the print itself. After a print was finished we had to leave it in water so that the supports could dissolve and then clean it before inserting the components.
Soldering the Prototype Board
In order to move the components from a breadboard to a prototype board, begin by taking pictures of the circuit prior to removal of any components and take notes of the pin locations for reference.
We used connectors to avoid soldering components directly to the board so that they can be reused in the future.
Begin by soldering the Arduino attachments to the prototype board and inserting the microcontroller and checking the connections with a voltage meter.
Then cut the attachment blocks to sizes corresponding to chips that we needed to attach to the microcontroller and solder wires to the pins that needed to be used. Next I would solder those wires to the board according to my notes, take the chips out of the breadboard, insert them into the attachment blocks and test the connections with a voltage meter. If everything was working properly I could proceed to insert the circuit into its respective housing.
Assembly
After wiring all the components and printing out the housing for the modules, you are ready to assemble the various modules that make up our home security system.
First, place the main controller hub into the main housing. Make sure that the LED lights and the joystick and microphone fit in the designated spaces for them.
Next, place the valuable object sensor with the pressure plate and Arduino into its housing, making sure that the pressure plate is outside of the housing so that the item can be placed on it.
Place the Main door sensor with the proximity sensor into its specific 3D printed housing making sure that the proximity sensor is facing the door, so that if the door is opened past the threshold the alarm would sound.
Download the code and upload it to the Arduino boards to ensure that each module can function for its intended purpose.
Zip File of Final Code:
Operating Instructions
Hardware Set Up:
- To operate this system, make sure that the modules are first set up in the proper positions.
- Make sure that there is an item on the pressure plate, that the proximity sensor is facing the door, and the main control hub of the system is within reach.
- Utilizing the main control hub you can turn off the alarm system utilizing a series of unique joystick movements which function as a password. Once the system is set up in the home, nothing further needs to be done, the system will automatically trigger once any of the sensors are activated.
Software Set Up:
- User needs to install both mySQL and Python on their computer (instructions on how to install mySQL and set up a server are provided).
- Once installed, plug in the control stick module to your computer via USB. Plug in all other modules to any power source and place them wherever you wish.
- Once all modules are plugged in, open your computer’s bluetooth settings and connect each module to the computer. You should see “Proximity Sensor” and “Pressure Plate” show up.
- Once all modules are connected, open the python file title “check_sql.py”.
- On line 11, replace the x’s in the string with your phone number and save the file. Then run it via the command line.
- Open up a terminal window and start your mySQL server (make sure to change databases to SENSOR_DATA (USE SENSOR_DATA;)).
- IMPORTANT: To ensure the system works, click on the terminal window that is running your SQL server and make sure it stays selected through the entire use of your system.
- Your system is now set up! Simply move an item off the pressure plate or move something in front of the proximity sensor to test the system. If working properly, the hub should make a noise and light up red. You should also get a text notification signaling the system has been triggered.
Potential Improvements
While this project was a lot of fun, and creates a type of functional security system for the home, there are still a number of improvements that could be made in order to make this system more effective.
One improvement which we had in our initial project concept was to connect all the modules through Bluetooth to allow for any of the modules to trigger the alarm system on the main control hub. Another improvement to this project would be to allow the user to easily change the password and texting mechanism on the device so that the user does not need to go into the code to actually change any of these settings.