A fully UI-controlled IoT-based system that will notify via mail in case you have an intruder in your home
What if you are out of the home and some burglar steals valuables stored in your vault?
Ohh! You have CCTV cameras installed..but what's the use of the footage if the burglar has already escaped the city.
What if you are notified and alarms start buzzing right at the moment burglar puts his hands onto your stuff?? Sounds great right??
1. Proximity Sensor
Connect Vcc, Vgnd and Vout of the sensor to 5v, GND and A0 of Bolt respectively. After this connection your sensor is ready to i/p analog readings to A0 pin of Bolt
Checking the sensor's changing values:
Go to python cli and install out library if not done already using below command.
pip install boltiot
Replace your API_KEY and device_id in the below code. This small code will display the sensors values. You can calibrate the sensor based on your settings and set threshold for motion detection.
from boltiot import Bolt
mybolt = Bolt(api_key, device_id)
mybolt.analogRead('A0')
2. Alerting system
Connect resistor, buzzer and led in series to Pin1 and GND. Our simple logic to set the alarm on is as below where Threshold is your calibrated sensor value.
from boltiot import Bolt import json mybolt = Bolt(api_key, device_id) inp=mybolt.analogRead('A0') val=json.loads(inp) v=val["value"] if (int(val["success"]) == 1): if ( int(v) < Threshold ): mybolt.digitalWrite(1,'HIGH')
Well... our setup is ready, but we need some means of controlling our system. You won't like it if the alarm starts buzzing when you yourself is using the vault right? I have created a simple yet effective flask UI to handle all the different scenarios.
If the sensor detects any movement then you will be notified by a mail along with the link to turn of the buzzer.
Link to the project is here. You just need to replace few variables so that the app works perfectly for you. Do as instructed in readme file.
This project alerts over email if the sensor detects movements. You can try various other variations according to your requirements like sending SMS to you or other family members.
Check out the Bolt IoT and ML training. This online video training is excellent for those who want to start with IoT and ML because it teaches you to build projects from the basics. Click on the button below to know more about the training.