What if you are out of the home and some burglar steals valuables stored in your vault?
Ohh! You have CCTV cameras installed..but whats 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??
Let's assemble the stuff1. 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:
from boltiot import Bolt
mybolt = Bolt(api_key, device_id)
mybolt.analogRead('A0')
This small code will display the sensors values. You can calibrate the sensor based on your settings and set threshold for motion detection.
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.
- To start the sensor
- To stop the sensor
- To stop the buzzing alarm (Hoping you catch the thief RED handed!!)
- To refresh the sensor status.
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.
Caution: This system doesn't save you from burglar's weapons if any :P
Comments
Please log in or sign up to comment.