Skip to content

Dipta117/esp32-blynk-iot-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ESP32 IoT Smart Monitoring System with Blynk

๐Ÿ“‹ Project Overview

An IoT-based environmental monitoring system using the ESP32 microcontroller that demonstrates bidirectional communication with the Blynk mobile app. The system reads temperature and humidity data and allows remote LED control through cloud connectivity.


๐ŸŽฏ Project Objectives

Implement IoT system with ESP32 and DHT22 sensor Demonstrate READ operations from mobile app to hardware Monitor real-time environmental data through cloud platform Showcase bidirectional communication between hardware and mobile app


๐Ÿ› ๏ธ Technologies Used

Hardware: ESP32 Dev Module, DHT22 Sensor, LED Software: PlatformIO, Arduino Framework IoT Platform: Blynk Cloud Services Simulation: Wokwi ESP32 Simulator Communication: WiFi, Blynk Cloud


๐Ÿ“ Project Structure

esp32-blynk-iot-project/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ main.cpp                 # Main application code
โ”œโ”€โ”€ include/                     # Header files
โ”œโ”€โ”€ lib/                         # Custom libraries
โ”œโ”€โ”€ diagram.json                 # Wokwi simulation diagram
โ”œโ”€โ”€ wokwi.toml                   # Wokwi configuration
โ”œโ”€โ”€ platformio.ini               # PlatformIO configuration
โ””โ”€โ”€ README.md                    # Project documentation

๐Ÿš€ Quick Start

Prerequisites

VS Code with PlatformIO extension Blynk IoT mobile app Wokwi account (for simulation)

Installation Steps

  1. Clone the Repository

    git clone https://github.com/Dipta117/esp32-blynk-iot-project.git
    cd esp32-blynk-iot-project
  2. Open in PlatformIO

    Launch VS Code Open the project folder PlatformIO should automatically detect the project

  3. Configure Blynk Credentials Update the following in src/main.cpp:

    #define BLYNK_TEMPLATE_ID "YOUR_TEMPLATE_ID"
    #define BLYNK_TEMPLATE_NAME "YOUR_TEMPLATE_NAME"
    #define BLYNK_AUTH_TOKEN "YOUR_AUTH_TOKEN"
  4. Build the Project

    Click the โœ“ (Build) button in PlatformIO Or use the terminal:

    pio run

๐ŸŽฎ Running the Simulation

Method 1: Wokwi Simulation (Recommended)

  1. Ensure all files are in the project root:

    diagram.json wokwi.toml platformio.ini

  2. Build the Project

    Click the โœ“ Build button in PlatformIO

  3. Start the Simulation

    Press Ctrl + Shift + P Type: Wokwi: Start Simulator Press Enter

Method 2: Physical Hardware

  1. Connect Components

    DHT22: VCC โ†’ 3.3V, GND โ†’ GND, DATA โ†’ GPIO4 LED: Anode โ†’ GPIO23, Cathode โ†’ GND (with resistor)

  2. Upload Code

    Connect ESP32 via USB Click the โ†’ (Upload) button in PlatformIO


๐Ÿ“ฑ Blynk App Setup

Step 1: Download Blynk App

Android: Play Store โ†’ โ€œBlynk IoTโ€ iOS: App Store โ†’ โ€œBlynk IoTโ€

Step 2: Create Account & Template

  1. Create a new Blynk account

  2. Go to Templates โ†’ Create New

  3. Set the following:

    Name: ESP32 IoT Monitor Hardware: ESP32 Connection: Wi-Fi

Step 3: Add Widgets

Virtual Pin Widget Purpose
V0 Button LED ON/OFF Control
V1 Label LED Status Display
V2 Label Temperature Display
V3 Label Humidity Display

Step 4: Device Setup

  1. Create a new device from the template
  2. Copy the Auth Token
  3. Update the token in src/main.cpp

๐Ÿ”ง Configuration Files

platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps = 
    blynk/Blynk@^1.3.2
    adafruit/DHT sensor library
    adafruit/Adafruit Unified Sensor

wokwi.toml

[wokwi]
version = 1

[[parts]]
type = "esp32"

[[parts]]
type = "dht22"
connect = "D4"

[[parts]]
type = "led"
connect = "D23"

๐Ÿ“Š Features Demonstrated

โœ… READ Operations (Mobile App โ†’ ESP32)

V0: Button press to control LED Real-time command processing from mobile app

โœ… WRITE Operations (ESP32 โ†’ Mobile App)

V2: Temperature data transmission V3: Humidity data transmission V1: LED status updates

โœ… Additional Features

Real-time sensor data monitoring Cloud connectivity via Blynk Error handling and data validation Non-blocking operation using timers


๐ŸŽ“ Learning Outcomes

Technical Skills

ESP32 programming with Arduino framework IoT cloud communication protocols Sensor integration and data processing Mobile app integration with hardware Simulation-based development

IoT Concepts

Bidirectional cloud communication Remote device control Real-time data monitoring Wireless sensor networks


๐Ÿ” Expected Output

Serial Monitor

๐ŸŽ‰ SUCCESS: Connected to Blynk Server!
๐Ÿ“ฑ READ from App: Button V0 - ON | LED: ๐Ÿ”ด ON
๐Ÿ“ค WRITE to App: Temp: 26.5ยฐC | Hum: 45.2%
๐Ÿ“ฑ READ from App: Button V0 - OFF | LED: โšช OFF

Blynk App Display

Real-time temperature and humidity LED control button with status System status indicators


๐Ÿ› Troubleshooting

Common Issues

  1. Device Offline in Blynk

    Check WiFi credentials Verify Auth Token Ensure correct Blynk server configuration

  2. Build Errors

    Clean project:

    pio run --target clean

    Check library dependencies in platformio.ini

  3. Sensor Read Failures

    Verify DHT22 connections Check sensor initialization

Simulation Notes

Wokwi uses simulated sensor values (e.g., 79.9 ยฐC, 40.0 %) Real hardware shows actual environmental data LED behavior is accurately simulated


๐Ÿ“ˆ Future Enhancements

[ ] Add multiple sensor support [ ] Implement data logging [ ] Add web dashboard [ ] Include alert notifications [ ] Support multiple ESP32 devices


๐Ÿค Contributing

  1. Fork the repository

  2. Create feature branch:

    git checkout -b feature/new-feature
  3. Commit changes:

    git commit -am "Add new feature"
  4. Push to branch:

    git push origin feature/new-feature
  5. Submit a pull request


๐Ÿ™ Acknowledgments

Blynk IoT Platform for cloud services Wokwi for ESP32 simulation environment PlatformIO for development tools Arduino Community for libraries and support


Developed for IoT Education and Demonstration Perfect for academic projects and IoT learning ๐ŸŽ“

For questions or support, please open an issue in the repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages