This project was primarily designed keeping in mind the hours of study and reading the students have to do each day to be able to compete in the world. Sometimes while reading we forget about our surroundings and this may be harmful to us. This is where my project comes in, the project I made keeps track of the light in the room and sends an alert message if the light present is not enough to keep reading and if it actually harms our eyes. Our eyes are very delicate and keeping them safe is the main agenda of this project.
2.DEMONSTRATIONAlert notification on Telegram
In this section we will study how to build the project from scratch
3.1 Hardware Configuration
Here are the steps for making the hardware connections:
- Step 1: Insert one lead of the LDR into the Bolt Module's 3v3 Pin.
- Step 2: Insert other lead of the LDR into the A0 pin.
- Step 2: Insert other lead of the LDR into the A0 pin.
- Step 4: Insert the other leg of the resistor also into the A0 pin.
After completing the connections it will look similar to the image above.
3.2 Software Configurations
The python coding for this project has been done in Ubuntu (Linux). Before we start coding of the project Reading lights in python, we need to make a configuration file which will have the specific keys for each user/device. We will import this file in our main code and use the various attributes. The advantage of this is that each user will only have to change the contents the configuration file to use the product.
The API key and Device ID of the Bolt module can be determined as follows:
- Connect your Bolt Device to the Bolt Cloud as per instructions given at https://cloud.boltiot.com/.
- Go to the API section to get the API key
3.3 Creating Telegram channel and bot
Steps to create a channel.
- Go to the home screen of the Telegram app.
- Swipe from the left side to reveal the menu.
- Click on "New Channel".
- It will ask you for a Name and Description for your channel. Give a suitable name and description. Adding photo is optional.
- In the next screen set the channel as Public.
- it will then ask you to enter a permanent link for your channel.
You are done making your own channel on telegram.
Steps to create a bot.
Telegram allows us to create a new bot with the help of a bot called as "BotFather". It is a single bot to create and manage other bots.
- On the Home screen of the app, click on the search icon on the top right and type in "botfather".
- Since we need to create a new Bot, go ahead and type in "/newbot" in the window.
- It will ask you to type in few more details like Bot name and Bot username.
- When your bot is created successfully, you will be shown a screen similar to the one below and will contain the Bot Token. This token is used to control your Bot as well as send messages on behalf of it. Please keep this token secure as it will allow anyone to access your Bot.
Now the code the implement this given in the below code section.
3.4 Setting up a Product on Bolt Cloud
Go to https://cloud.boltiot.com/ and then follow the steps below:
Comments