Blog
Remote Control with Telegram: A First Step into the Internet of Things
A few weeks ago, UPC Manresa hosted the Girls in ICT Day, supported by the MERIT project. Among other activities, the participating girls took part in a hands-on workshop at Techlab Manresa to learn what the Internet of Things (IoT) is all about. The workshop was led by Xènia Mata and Mercè Tormo, both students of the Bachelor’s Degree in ICT Systems Engineering offered at UPC Manresa. They showed the attendees that controlling a system remotely can actually be done quite easily.
Imagine being able to turn on your home lights just by sending a message from your phone. Sounds tricky? Well, in this workshop participants learned how to make that happen using just an Arduino, Telegram, and a bit of programming knowledge. Want to know how? Keep reading.
What did we do?
The goal of the workshop was to create a remote control system that could turn lights on or off (in our case, we used LEDs, which are easier to work with in a lab) via Telegram. Instead of building a complicated app, we did everything through a Telegram chat—just like talking to a friend.
To make it work, we combined three elements:
- Telegram Bot: a “robot” inside Telegram that reads your messages.
- Python: a program on the computer that interprets those messages.
- Arduino: a small electronic board that receives commands and turns LEDs on or off.
Step 1: Create the Telegram bot
We started by creating a Bot in Telegram. It works like a regular contact you can send messages to, but it’s programmed to respond automatically. In our case, we made the bot understand commands like “Turn on living room light” or “Turn off living room light”.
This bot runs on the computer. To make it work, we wrote a short Python script that reads the messages and prepares them to be sent to the Arduino.
Step 2: Program the Arduino
Next, we moved on to the Arduino. This electronic board lets us easily control things like lights, motors, or sensors. In the workshop, we started by learning the basics—like making an LED blink.
Once we understood how it works, we set up a small circuit with three LEDs, like three lights in a house. We connected them to different pins on the Arduino and programmed it to receive messages and act according to the instructions.
Step 3: Communication between computer and Arduino
To make everything work together, the computer and Arduino need to communicate. We did this using a serial port—a basic connection that lets them send and receive text.
So, when we send “Turn on living room light” to the bot, the Python program sends this text to the Arduino, which then turns on the correct LED.
Step 4: Testing it all
Once each part worked on its own, it was time to see if the whole system came together:
- We sent “Turn on living room light” from a phone to the Telegram bot.
- The computer received this message and passed it to the Arduino.
- The Arduino understood the command and turned on the correct LED (or whatever device was connected).
We could also send “Turn off living room light” to switch it off. And the same process applied to the other lights (or rather, the LEDs we used for the demo).
Why is this so interesting?
This project is relatively simple, but it teaches us a lot. We learned a bit about programming. We got to know Arduino. We saw how a Telegram bot can control remote systems. Then we combined everything and got a clear idea of what the Internet of Things (IoT) is.
One of the best parts is that the system is completely customizable. Once you understand the basics, you can add new components—not just LEDs, but things like motors to open doors, temperature sensors to control heating, or even automatic irrigation systems.
Another great thing is that we used open and free technology (Python, Arduino, and Telegram). That means it’s accessible to everyone, and you can do really cool things at very low cost.
This is just a glimpse of what this field can offer. With a bit of knowledge, you can create simple yet powerful applications—but we also need many more skilled professionals like those trained at UPC Manresa, starting with the Bachelor’s Degree in ICT Systems Engineering and continuing with the Master’s Degree in Machine Learning and Cybersecurity for Internet Connected Systems, developed as part of the European MERIT project.