A Light controlling BOT

smohammedirfan17
3 min readDec 10, 2020

A bot is a software application that is programmed to do certain tasks. Bots are automated i.e. they run according to the instructions provided to them without a human interference in order to proceed with there action. Typically: they do repetitive tasks and at a much faster pace than a real time human users could. Bots can be sub categorized into:

•Chatbots.
•Crawlers.
•Transactional bots.
•Informational bots.
•Entertainment bots.

In our project, we make use of a Telegram bot in order to virtually control the switching on and off of a light bulb. Boys made at telegrams are AI-inspired apps that can serve many functions: send relevant information about the weather or useful news articles, schedule reminders, play tunes, create to-do lists, and many more.

Here are some major ways on how to create a bot. Let’s give it a watch.

1. Telegram

  1. First, open a conversation with BotFather in your telegram application.
  2. Type /start followed by /newbot.
    Choose a suitable name and username for your bot.
  3. You will be provided with a link to start conversation with your bot and a token to access the HTTP API.
    (Input: Telegram chatbot to give commands to turn on/off the led.
    Output: Checked on adafruit.io cloud service) (Adafruit.io helps run and manage projects over the internet).
  4. value 1 is given to the feed to turn on the bulb
    value 0 is given to the feed to turn off the bulb
    [We can also insert pictures from the internet to show the on/off action of our light bulb in the output.]

2. Adafruit

The keys from Adafruit is required to access its API and send values to the required feed. This can, in turn, be programmed to be connected to an Arduino, which can receive the values you send and this is also required to have your desired output i.e. demonstration of light control.

3. GitHub

GitHub: An open source community web-based platform used to work on open source projects and help collaborate on projects.

Here, we create 4 repository files: README.md, chatboy.py, Procfile, Requirement.txt (you may create lesser number of repositories in case you don’t wanna go detailed).

You upload your necessary code through the repository. (Mine one can be viewed here: https://github.com/xcd568t/Light-control)

4. Heroku

Heroku is a Platform as a service (PaaS) cloud based service operator that enables developers to build, run, and operate applications entirely in the cloud. Here you need to deploy your GitHub code and the adafruit too.

If you’re new to it create an account and create a new app (you will see a tab) and deploy it through your GitHub using the repositories.

Once you’re done with all these above things:

One can check there output(s) by providing the necessary commands: /ledon and /ledoff to the bot.
Simultaneously, respective changes would be seen or observed in the adafruit status indicator.

Thank You,

--

--