Skip to content

unrealbg/ESP32-Env-Monitor-PO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This project is an environmental monitoring system built using the ESP32 microcontroller. It monitors temperature and humidity using a DHT sensor, controls a relay, and sends data to an MQTT broker. The system ensures continuous internet connectivity and handles MQTT messaging.

Features

  • Wi-Fi connectivity
  • DHT sensor integration for temperature and humidity monitoring
  • Relay control
  • MQTT client for data publishing
  • Uptime tracking
  • Logging system for status and error messages

Installation

  1. Clone the repository:

    git clone https://github.com/unrealbg/ESP32-Env-Monitor-PO.git
    cd ESP32-Env-Monitor-PO
  2. Install dependencies:

    • Ensure you have the Arduino IDE installed.
    • Install the necessary libraries:
      • WiFi
      • PubSubClient
      • DHT sensor library
  3. Configure the project:

    • Update the config.h file with your Wi-Fi credentials and MQTT broker details.

Usage

  1. Upload the code:

    • Connect your ESP32 to your computer.
    • Open the project in Arduino IDE.
    • Select the correct board and port.
    • Upload the code to the ESP32.
  2. Monitor the system:

    • Open the Serial Monitor in Arduino IDE to view logs.
    • The ESP32 will connect to Wi-Fi, start the MQTT client, and begin monitoring temperature and humidity.
  3. MQTT Messaging:

    • The system will publish temperature and humidity data to the configured MQTT topic.
    • It will also handle incoming MQTT messages and log them.

Code Structure

  • src/main.cpp: Main application code handling setup and loop functions.
  • RelayService.h/.cpp: Handles relay control.
  • DhtService.h/.cpp: Manages the DHT sensor.
  • InternetConnectionService.h/.cpp: Ensures continuous internet connectivity.
  • MqttClientService.h/.cpp: Manages MQTT client operations.
  • UptimeService.h/.cpp: Tracks and logs system uptime.
  • LogHelper.h/.cpp: Provides logging functionality.

Contributions

Contributions are welcome! Please fork the repository and submit pull requests.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published