This project can be used in Street lights or Emergency lamp for home application for automatic turning on and off according to the surroundings.In this project, Light Dependent Resistor(LDR) is used to get the intensity of light around the surroundings. In order to detect the sudden changes in the intensity of light around the surroundings Z-score analysis is used. An Alert system has been setup using Telegram Bot to notify when the light intensity changes suddenly.
2. DEMONSTRATIONThe below video shows that, when the surroundings is dark, the LED turns On automatically and the intensity of LED turns Off when the surrounding light intensity increases.
Telgram message alert image:The python coding for this project has been done in Ubuntu (Digital Ocean Droplet). These configuration file must be prepared before the actual coding for the automatic light intensity changer. This configuration file will be written in python and saved as separate file for security. These files will be imported in to actual code for various purpose later.
Configuration file:
API_KEY = "XXXXX"
DEVICE_ID ="BOLTXXXX"
TELEGRAM_CHAT_ID= "@XXXX"
TELEGRAM_BOT_ID = "botXXX"
FRAME_SIZE=5
MUL_FACTOR = 2
The API key and Device ID can be determined from the site https://cloud.boltiot.com/.
The telegram chat ID and bot ID can be determined as follows:
- Install Telegram from Play store / App store. Sign in using your mobile number.
- In telegram, select New Channel. Then give the channel a name and click on tick icon.
- Then create a permanent link which will be the Telegram chat ID and save it. Note the Chat ID for future use in the program.
- Then in search section, search for BotFather. Click on Start. Bunch of options will pop-up.
- In that pop-up menu, select /newbot and create a bot by giving a name and username ending with bot.
- Then there will be a pop-up with HTTP API. Take note of it as it is the Bot ID.
- Then go to our new channel we created and click on Administrators.
- Add the bot we created by selecting the Add Admin. Thus our new channel and bot is ready to go.
Comments
Please log in or sign up to comment.