This project demonstrates how to build a smart home automation system using an ESP32 microcontroller and a Telegram Bot. Users can control various devices such as lights, fans, and other appliances using a Telegram bot interface.Features include GPIO management, Wi-Fi connectivity, MQTT/HTTP protocols, real-time updates, and secure access using Telegram's API.
- Control up to 16 devices via Telegram bot.
- Individual ON/OFF and All ON/All OFF commands.
- Secured access using predefined chat IDs.
- Status feedback with visual symbols (✅ for ON, ☑ for OFF).
Follow these steps to set up the project and run it on your ESP32.
- ESP32 Microcontroller Board
- WiFi connection
- 16 output devices (e.g., LEDs, relays for appliances)
- Breadboard and jumper wires
- USB Cable for ESP32 programming
- Power source for connected devices
Connect the output pins on the ESP32 (13, 14, 12, ...) to the respective devices (LEDs or relays).
Insert an image of your circuit here.
Upload your circuit diagram (e.g., from Fritzing or hand-drawn).
- Arduino IDE (with ESP32 board support installed)
- Telegram app on your smartphone
- Git (optional for cloning this repository)
git clone https://github.com/Ganesh-Solapure/Home-Automation-Using-Telegram-Bot-ESP-32.git
cd Home-Automation-Using-Telegram-Bot-ESP-32Ensure you have the following libraries installed in Arduino IDE:
- WiFi
- WiFiClientSecure
- UniversalTelegramBot
Update the following details in the code:
#define BOTtoken "Your_Telegram_Bot_Token"
char ssid[] = "Your_SSID";
char password[] = "Your_WIFI_Password";- Connect ESP32 to your computer.
- Select the correct board and COM port in Arduino IDE.
- Click on Upload.
- Open Telegram and search for BotFather to create your bot.
- Save the API token provided by BotFather and update it in the code.
- Add your bot to a chat or group.
- Use commands like
/start,/switch,/AllOn, and/AllShutDownto interact with the devices.
Include working images or videos here. For example:
Upload GIFs/videos showing:
- Device switching using the bot.
- ESP32 controlling devices.
Include an image of your prototype setup:
| Command | Function |
|---|---|
/start |
Displays welcome message and options |
/switch |
Opens the switchboard interface |
/AllOn |
Turns ON all connected devices |
/AllShutDown |
Turns OFF all connected devices |
- WiFi not connecting: Verify SSID and password.
- Bot not responding: Ensure the bot token is correct and check internet connectivity.
- Devices not working: Check the wiring and power supply.
- Add scheduling features for device control.
- Integrate sensors (e.g., temperature, motion detection).
- Expand to support more devices.
This project is licensed under the Apache License 2.0.
Created by Ganesh Solapure
For any queries or suggestions, reach out via GitHub.
Contributions are welcome! Feel free to submit a pull request or open an issue for improvements.






