IoT stands for Internet Of Things, which is nothing but a system of internet connected objects that can communicate and transfer data over the internet without human interventions. An IoT ecosystem consists of web-enabled smart devices that use embedded systems, such as processors, sensors and communication hardware, to collect, send and act on data they acquire from their environments.
PROJECT DESCRIPTIONThe following project is based on IoT, the basics of which are Sending an SMS alert whenever the lights are switched ON or OFF in the place where the device is kept. It uses z-analysis for the same and can be used for security purpose too.
COMPONENTS' DESCRIPTION
1. BOLT WiFi MODULE
This WiFi Microcontroller module is an easy interface to quickly connect your hardware to cloud over GPIO, UART, and ADC. Bolt is equipped with industry standard protocols to ensure a Secure and fast communication of your device data with the cloud.
The Bolt mudule is powered using a USB connected to a power supply.
2. LDR
LDR stands for Light Dependent Resistor. It is also called Photo Resistor. It is a light sensitive resistor whose resistance decreases as the intensity of light it are exposed to increases. This light sensitive device is most often used to indicate the presence or absence of light, or to measure the light intensity. In the dark, it's resistance is very high, sometimes up to 1MΩ, but when the LDR sensor is exposed to light, the resistance drops dramatically, even down to a few ohms, depending on the light intensity.
3. RESISTOR 10K ohm
A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust signal levels, to divide voltages, bias active elements, and terminate transmission lines, among other uses. Here we are using a 10K ohm resistor.
SOFTWARES AND SERVICES USED
1. BOLT IoT CLOUD
Bolt Cloud lets you build IoT devices, write your code, and configure only on the desktop. To monitor, control and setup your device, download the Bolt IoT App.
2. TWILIO SMS MESSAGING API
Twilio is a cloud communications platform that allows software developers to programmatically make and receive phone calls, send and receive text messages, and perform other communication functions using its web service APIs.
MAKING THE CIRCUIT CONNECTIONS
1. Connect one leg of the LDR to the '3V3' pin and the other leg to the 'A0' pin as shown-
LDR has equal legs and hence you don't need to worry about the negative/positive for connecting it to the module.
2. Connect one leg of the the 10K ohm resistor to the GND pin of the Bolt wifi module and the other leg to the A0 pin as shown-
Make sure that the two circuit components don't touch each other otherwise it will lead to a permanent damage to the module due to short circuiting.
3. Connect the Bolt module to a power supply and wait for it to connect to the cloud. Once it is done, both led's glow up, as shown-
CODING
1. Login into the putty by entering the IP address of your digital ocean droplet.
2. Now create a file named conf.py
which will store all the credentials related to Twilio and Bolt cloud account.
3. Now create one more file named anomaly_detection.py.
NOTE-Wait for 10 points for the z-score analysis to complete and then turn ON/OFF the light in the room.
4. Following is the SMS alert -
Comments