- π Overview
- β¨ Features
- π οΈ Hardware Requirements
- π» Software Requirements
- π Setup Instructions
- π Usage
- π§ Troubleshooting
- π License
- π’ Project Demo
- π€ Contributing
- π§ Contact
HeatGuard is a Smart Heating Monitoring System designed to keep a close eye on your indoor heating environment. Utilizing an ESP32 microcontroller, it integrates multiple sensors to monitor temperature and humidity, displays real-time data on an OLED screen, sends data to ThingSpeak for cloud-based monitoring, and provides instant notifications via a Telegram bot. This system is perfect for applications such as home heating management, environmental monitoring, and IoT-based alert systems to ensure a comfortable and safe living environment.
- πΆ Wi-Fi Connectivity: Seamlessly connects to your local Wi-Fi network for internet-based functionalities.
- π‘οΈ Temperature & π§ Humidity Monitoring: Utilizes DS18B20 and DHT22 sensors to accurately measure temperature and humidity.
- π₯οΈ OLED Display: Displays real-time temperature and humidity data on a 128x64 OLED screen.
- βοΈ ThingSpeak Integration: Sends sensor data to ThingSpeak for cloud-based data logging and visualization.
- π² Telegram Notifications: Sends instant alerts via Telegram when temperature or humidity crosses predefined thresholds.
- π οΈ User Interaction: Control and monitor the system using intuitive Telegram bot commands.
- π ESP32 Development Board
- π‘οΈ DS18B20 Temperature Sensor
- π‘οΈπ§ DHT22 Temperature and Humidity Sensor
- π₯οΈ 128x64 OLED Display (e.g., SSD1306)
- π§ Resistors:
- 4.7kΞ© resistor for DS18B20 data line
- πͺ Breadboard and Jumper Wires
- π Power Supply: Suitable for ESP32 (e.g., USB power)
- πΎ Arduino IDE (version 1.8.0 or later)
- π¦ Arduino Libraries:
Wire.h
WiFi.h
WiFiClientSecure.h
UniversalTelegramBot.h
HTTPClient.h
OneWire.h
DallasTemperature.h
Adafruit_GFX.h
Adafruit_SSD1306.h
DHT.h
Clone this repository to your local machine using Git:
git clone https://github.com/CyberScopeToday/heatguard.git
Open the Arduino IDE and install the required libraries:
- Go to Sketch > Include Library > Manage Libraries.
- Search for and install the following libraries:
- Universal Telegram Bot
- DallasTemperature
- OneWire
- Adafruit GFX Library
- Adafruit SSD1306
- DHT sensor library
Open the HeatGuard.ino
file in the Arduino IDE and update the following parameters:
-
π Wi-Fi Credentials:
const char* ssid = "Your_WiFi_SSID"; const char* password = "Your_WiFi_Password";
-
π ThingSpeak API Key:
String apiKey = "YOUR_THINGSPEAK_API_KEY";
-
π€ Telegram Bot Token:
const char* botToken = "YOUR_TELEGRAM_BOT_TOKEN";
-
π GPIO Pins (if different from defaults):
#define ONE_WIRE_BUS 12 // DS18B20 data pin #define DHTPIN 15 // DHT22 data pin #define SDA_PIN 5 // OLED SDA #define SCL_PIN 4 // OLED SCL
-
π§ Temperature Thresholds (optional):
float temperatureThreshold = 25.0; // Example: 25Β°C float humidityThreshold = 60.0; // Example: 60%
- Connect your ESP32 board to your computer via USB.
- Select the appropriate board and port in the Arduino IDE:
- Tools > Board > ESP32 Dev Module
- Tools > Port > Select your ESP32 port
- Click the Upload button to compile and upload the code to the ESP32.
Once the system is powered and connected to Wi-Fi, it will start monitoring the sensors, display data on the OLED, send data to ThingSpeak, and await Telegram commands.
Interact with HeatGuard using the following Telegram commands:
-
/start π
- Description: Initializes the bot and displays available commands.
- Response: Welcome message with command list.
-
/status π
- Description: Retrieves the current sensor readings.
- Response:
π‘οΈ DS18B20: XX.X Β°C π‘οΈ DHT22: XX.X Β°C π§ Humidity: XX.X %
-
/set_temp_threshold [value] π₯
- Description: Sets a new temperature threshold for notifications.
- Usage:
/set_temp_threshold 28.5
- Response:
- Success:
π₯ New temperature threshold set to 28.5 Β°C
- Failure:
β Invalid value. Please try again.
- Success:
-
/set_humidity_threshold [value] π¦
- Description: Sets a new humidity threshold for notifications.
- Usage:
/set_humidity_threshold 55
- Response:
- Success:
π¦ New humidity threshold set to 55%
- Failure:
β Invalid value. Please try again.
- Success:
-
/help π
- Description: Displays the list of available commands.
- Response: List of commands with descriptions.
-
πΆ Wi-Fi Connection Issues:
- Ensure that the SSID and password in the code are correct.
- Check the distance between the ESP32 and the Wi-Fi router.
-
π‘οΈ Sensor Read Errors:
- Verify the wiring connections for DS18B20 and DHT22.
- Ensure that the sensors are properly powered.
-
π₯οΈ OLED Display Not Working:
- Check the I2C connections (SDA and SCL pins).
- Confirm that the OLED address (
0x3C
) matches your display.
-
π€ Telegram Bot Not Responding:
- Make sure the bot token is correct.
- Ensure that the ESP32 is connected to the internet.
- Check if the bot is started in Telegram.
-
βοΈ ThingSpeak Data Not Updating:
- Verify the ThingSpeak API key.
- Ensure that the ESP32 has internet access.
- Check ThingSpeak channel settings.
-
π Notifications Not Sending:
- Confirm that the temperature and humidity thresholds are set correctly.
- Ensure that the ESP32 is connected to the internet.
- Check Telegram bot permissions and chat status.
This project is licensed under the MIT License.
Contributions are welcome! Please fork the repository and create a pull request with your enhancements. For major changes, please open an issue first to discuss what you would like to change.
For any questions or suggestions, feel free to open an issue or contact me directly.
HeatGuard ensures your heating environment is always monitored and maintained, providing peace of mind through real-time data and instant alerts. Stay warm and stay informed! π₯π β¨