Get Room Temperature and Humidity using ESP8266, DHT11 and Telegram Bot
- ESP8266 NodeMCU
- DHT11 Sensor
- Three Jumper Wires
- USB cable
+ (VCC)to 3V in NodeMCU
- (GND)to GND in NodeMCU
OUT (DHT11 data pin)to D1 in NodeMCU
program.cpp file and modify the following lines:
In Line 17 Replace
NAME OF WIFIwith your WIFI SSID
In Line 18 Replace
PASSWORD OF WIFIwith your WIFI Password
In Line 22 Replace
BOT TOKENwith your Telegram Bot Token (Get Bot Token from BotFather)
In Line 50 Replace
CHAT IDwith your Telegram Chat ID (Get Chat ID from here: https://t.me/chatidx_bot)
Once done, Paste the Code into Arduino IDE.
- Make sure that you have added the following libraries:
- You also need to add UniversalTelegramBot library.
Go to Sketch -> Include Library -> Manage Libraries -> Search for
UniversalTelegramBotand install it.
Make sure you have selected the correct board in the Arduino IDE.
Once finalised, upload the code to the ESP8266 NodeMCU, Press the
FLASHButton if required.
Then Open the Serial Monitor, Press
RSTButton and wait for the ESP8266 to connect to the WiFi.
Now start the telegram bot and test it.
- Here is the sample response from the ESP8266 in Telegram:
- We are looking for any kind of bug fixes or new features.
- MIT License