In this project we’ll create a Telegram bot for the ESP32-CAM that allows you to control your board from anywhere to request a photo, sensor readings or control the flash. Additionally, you’ll receive a notification with a new photo whenever motion is detected.
Resources
ESP32-CAM board
Bread board
PIR sensor
FTDI prpgrammer
ESP32-CAM Telegram BotTo control the ESP32-CAM shield, we need create Telegram bot, so that you can control your ES32-CAM from any part of the world.
Connection
3v3 vin
Gpio13 input
Gnd gnd
- check here my previous tutorials
- ESP32-CAM Face detection|Face Recognition
- Machine to Machine Interactions
- mesh networking- explained
Go to Google Play or App Store, Download and Install Telegram
search for “botfather” and click that
The window should open and you’ll be prompted to click the start button.
Type /newbot. Give it a name and username.
If your bot is successfully created, you’ll receive a message with a link to access the bot and the bot token. Save the bot token that will use in code part.
You can make Bussiness queries by using the business queries section. You can find that at the bottom of this page
- You can make queries related to place ads, product placement, and advertising
- make project queries related to DIY project section (college and school students for their projects)
Thanks UTSOURCE.net to offer electronic components for my projects
Get Your Telegram User IDAnyone that knows your bot username can interact with it. To make sure that we ignore messages that are not from our Telegram account (or any authorized users), you can get your Telegram User ID. Then, when your telegram bot receives a message, the ESP can check whether the sender ID corresponds to your User ID and handle the message or ignore it.
In your Telegram account, search for “IDBot”
Start a conversation with that bot and type /getid. You will get a reply back with your user ID. Save that user ID, because you’ll need it later in this tutorial.
Preparing Arduino IDEBefore you go to upload the code you need to download the following library
- Click here to download the Universal Arduino Telegram Bot library.
- Go to Sketch > Include Library > Add.ZIP Library...
- Add the library you’ve just downloaded.
Follow the next steps to install the ArduinoJsonlibrary.
1. Go to Sketch > Include Library > Manage Libraries.
2. Search for “ArduinoJson”.
3. Install the library.
Upload Code to the ESP32-CAM
Check my previous post here that how to upload code to ESP32-CAM
After that, open your Telegram account and test your board. You can see that when any mosition is detected by pir, the ESP32-CAM alows to take an image and it would send that image to your telegram bot
Hope you have liked this post and don't forget to share this post who aspire to make these kind of project
Comments