Light Controller using Telegram Bot

Mounika N
2 min readSep 14, 2020

Internet of Things (IOT) can be described as a digitally connected network of everyday physical objects. In the present day, IOT is being widely used to transform quotidian devices to smart ones in order to automate tasks enabling human comfort. The basic components of an IOT device includes sensors, an IOT framework, Cloud servers, actuators..The values recorded by the sensors are sent to the cloud where storing, processing and accessing of data is done. This data can be accessed using a mobile app and particular actions can be performed using actuators.

The project titled Light Control using Telegram Bot’s aim is to control a light by taking queries from telegram bot and sending the data to the adafruit cloud service which not only helps in storing and retrieving data but also helps the user to visualize actions being performed without hardware.

The steps involved in building the project:

  • Creating a bot in Telegram using Botfather.
  • Writing a python code to create a feed in adafruit. After creating a feed, a dashboard consisting of a status indicator should be added to examine the end action.
  • With the help of API’s of telegram bot (HTTP API) and Adafruit_IO , a complete python code should be written to take a query in the form of text from telegram. A command ‘turn on’ sends a value ‘1’ to the adafruit feed and ‘turn off’ sends a ‘0’.
  • Deploy the python code in Heroku app.

Functioning of the project:

Telegram bot takes command from telegram app and returns a message and picture indicating the action being performed to the user.

The end action to be performed is virtually indicated by the status indicator from the Adafruit dashboard that turns ‘Red’ when a ‘turn on’ message is received and ‘Orange’ for a ‘turn off’ message.

This project can be further taken forward by syncing embedded hardware and LED to perform action.

Press the link for code

The values being recorded in the adafruit feed
Status indicator turns Red when Light is ON and turns Orange when light is OFF.
Output as seen from the telegram bot, returning a message and picture of the action done

--

--