Street light controller projects are already made by others so, I have taken that main concept and added alarm clock to the project.
In order to save the electricity and also time to on and off of street lights this project will be helpful.
In this project, based on the light intensity value which will be sensed by LDR sensor street light are controlled automatically and the alarm will be on when the street lights are off. This will be helpful for the people to wake up in the early morning to expose to sunlight which is the best source to get vitamin D as soon as sun rises. the message will be sent to the respective person when the lights are off or on.
Step 1. Hardware connectionsstep 1: connect one leg of LDR sensor into bolt module's 3V3 pin
step2: connect another leg of LDR sensor to A0 pin
step3: connect 1K ohm resistor one lead to A0 and another to GND pin
step 4: connect +ve leg of LED to (GPIO)1 pin and -ve to GND pin
step 5: connect +ve leg of buzzer to (GPIO) 2 pin and -ve to Gnd pin
step 6: connect the bolt module to power supply and check the module is online using bolt cloud.
Step 2.software configuration
In vmware workstation on ubuntu server write the python code for automatic street light controller
Download the virtual box and ubuntu server on PC(windows) by referring to below video
Step 3: Bolt python library setupTo setup bolt python library to interact with bolt cloud API using our python application
first login to ubuntu server and follow the below steps
Step 1: update the packages on ubuntu by giving the below command
sudo apt-get -y update
Step 2: install python3 pip3 using following command
sudo app install python3-pip
Step 3: installing boltiot library using pip using this command
sudo pip3 install boltiot
by this we are done with boltiot python library installation
Step 4 : from the bolt cloud app get the Api key and the Device id
click on API to get Api key
now to get device id click on device in bolt cloud
Step 5: Creating account on Twilio
Twilio is used to make and receive phone calls and also send and recieve the text messages using its web service APIs
Refer the following video to create account on Twilio and to find Sid number and from Number
Next step, we have write configuration file which contains following information
By typing the command,
sudo nano conf.py
code in python file
SID = 'You can find SID in your Twilio Dashboard'
AUTH_TOKEN = 'You can find on your Twilio Dashboard'
FROM_NUMBER = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
TO_NUMBER = 'This is your number. Make sure you are adding +91 in beginning'
API_KEY = 'This is your Bolt Cloud account API key'
DEVICE_ID = 'This is the ID of your Bolt device'
Next, we have to write code for street light automationby typing the command
sudo nano street_light.py
Algorithm for code:
1. Fetch the latest sensor value from the bolt device
2. Check the value is between the minimum and maximum limits
3. If not in the range, then switch of the led and buzzer is on otherwise, switch on the led buzzer is off and sms will be send
4. wait for 10 seconds
5. repeat the above steps
Save the file using ctrl+X and Y
Next run the program using the command
sudo python3 street_light.py
Comments