This projects is about detecting when the lights are switched on in the room at night and alerts us when this happens by sending Message to our Mobile number, No matter wherever we are.
Getting Started:
- step1: Take the bolt module, LDR sensor and 10k ohm resistor.
- step2: Make connections by inserting one leg of LDR into the 3v3 pin of the module and other into analog input pin(A0).Now take the resistor wind its one of legs to the leg of ldr sensor in Analog pin, Insert Another leg of the resistor into the Ground Pin. Then switch on the Module.
- step3: Now, login to ubuntu and create a file named "conf.py" with the command (sudo nano conf.py) to hold all credentials as BoltAPI key, deviceID, SID and Auth_Token of Twilio account, From_Number and To_Number and maximum_limit number.
The above credentials had to be filled and press cntrl+x to save the file.
- step4:Now, Create another file name it as ldr_sms.py by typing the command (sudo nano ldr_sms.py ).Which contains the main code.
This is the main code,Then press cntrl+x to save it and press "y". key.
- step5:Run The Code, with the command (sudo python3 ldr_sms.py).
This the output of the code in the file ldr_sms.py.
It prints the sensor_value obtained from the sensor, then Makes request to twilio and receives the response and sends it as an sms to the mobile number.
Conclusion:
With this project, we can be notified when someone switches on the light in the room.













Comments