DESCRIPTION
This project uses z-score analysis to find out whether someone turned On or Off the lights in your room, and send you an SMS when this happens. So, we will write a python code for the same.
So through this project we will be getting SMS alerts when anyone turns ON/OFF the light of a room. It can be used for security purpose in houses and industries.
Components used
1. Bolt IoT wifi module
2. LDR (Light Dependent Resistor)
3. Resistor 10K ohm
OBJECTIVE
To get the data from the LDR sensor over Bolt cloud and view the light intensity values and also notify the user through SMS alert using Twilio account if someone turned ON/OFF the light of the room by writing a Python code which can use z-score analysis.
BUILDING THE HARDWARE
1. Connect one leg of the LDR to the '3V3' pin and the other leg in the 'A0' pin as shown-
2. Connect one leg of the the 10k resistor in the GND pin of the Bolt wifi module and the other leg in the A0 pin as shown-
3. Give a 5V power supply to the Bolt IoT module. Finally it looks like :-
NOTE-Check the connections properly before turning ON the power supply.
4. Connect the Bolt IoT module to the cloud. If this happens the Green LED will glow constantly.
CODING PART
1. Login into the putty by entering the IP address of your digital ocean droplet.
2. After successful login, create a file named conf.py
which will store all the credentials related to Twilio and Bolt cloud account. (Code is given in the CODE sectionbelow. Just replace your own credentials there.)
3. Now create one more file named anomaly_detection.py.
(Full code is given in the CODE sectionbelow.)
4. The outputs are shown below along with the SMS screanshot-
NOTE-Wait for 10 points for the z-score analysis to complete and then turn ON/OFF the light in the room.
- For more details, see the complete video below.
Comments
Please log in or sign up to comment.