Skip to content

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! πŸ”₯🏠✨

License

Notifications You must be signed in to change notification settings

CyberScopeToday/heatguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HeatGuard πŸ”₯🏠

CodeFactor

HeatGuard Demo

Table of Contents

🌟 Overview

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.

✨ Features

  • πŸ“Ά 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.

πŸ› οΈ Hardware Requirements

  • πŸ”Œ 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)

πŸ’» Software Requirements

  • πŸ’Ύ 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

πŸš€ Setup Instructions

1. πŸ“₯ Clone the Repository

Clone this repository to your local machine using Git:

git clone https://github.com/CyberScopeToday/heatguard.git

2. πŸ“š Install Arduino Libraries

Open the Arduino IDE and install the required libraries:

  1. Go to Sketch > Include Library > Manage Libraries.
  2. Search for and install the following libraries:
    • Universal Telegram Bot
    • DallasTemperature
    • OneWire
    • Adafruit GFX Library
    • Adafruit SSD1306
    • DHT sensor library

3. βš™οΈ Configure the Code

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%

4. πŸ“€ Upload the Code to ESP32

  1. Connect your ESP32 board to your computer via USB.
  2. Select the appropriate board and port in the Arduino IDE:
    • Tools > Board > ESP32 Dev Module
    • Tools > Port > Select your ESP32 port
  3. Click the Upload button to compile and upload the code to the ESP32.
ardideexample

πŸ“– Usage

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.

πŸ€– Telegram Bot 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.
  • /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.
  • /help πŸ†˜

    • Description: Displays the list of available commands.
    • Response: List of commands with descriptions.

πŸ”§ Troubleshooting

  • πŸ“Ά 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.

πŸ“„ License

This project is licensed under the MIT License.


πŸ“’ Project Demo

HeatGuard Demo

🀝 Contributing

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.

πŸ“§ Contact

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! πŸ”₯🏠✨


About

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! πŸ”₯🏠✨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages