Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Based Smart Power Monitoring and Control System with Wi-Fi Connectivity

View and Edit Project In Cirkit DesignerImage of ESP32-Based Smart Power Monitoring and Control System with Wi-Fi Connectivity

Circuit Documentation

Summary

This circuit is designed to monitor and control electrical parameters using an ESP32 microcontroller. It includes various sensors, relays, and an LCD display to provide real-time data and control functionalities. The circuit also integrates with the Blynk platform for remote monitoring and control.

Component List

  1. ESP32

    • Description: A powerful microcontroller with Wi-Fi and Bluetooth capabilities.
    • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, VIN, 3V3, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23, BOOT
  2. Grounding Receptacle Outlet 15A 250V~

    • Description: A grounding receptacle outlet for 15A, 250V~.
    • Pins: life, GND, Life
  3. Bridge Rectifier

    • Description: Converts AC to DC.
    • Pins: Source_in-, source_out-, source_out+, source_in+
  4. LM2596

    • Description: A DC-DC buck converter.
    • Pins: IN, OUT
  5. Electrolytic Capacitor

    • Description: Stores electrical energy.
    • Pins: -, +
    • Properties: Capacitance: 0.000001 Farads
  6. Power 220V

    • Description: Power source.
    • Pins: hot wire, neutral wire
  7. SSR-40A

    • Description: Solid State Relay.
    • Pins: -, +, Lin, Lout
  8. Micro USB to Cable (2 Pin)

    • Description: Micro USB to 2-pin cable.
    • Pins: Micro USB, +, -
  9. LCD 20x4 I2C

    • Description: 20x4 character LCD with I2C interface.
    • Pins: GND, 5v, SCA, SCL
  10. PZEM-004T AC

    • Description: AC power monitor.
    • Pins: 5V, RX, TX, CF, GND
  11. Pushbutton

    • Description: A simple pushbutton.
    • Pins: Pin 2, Pin 1, Pin 3, Pin 4
  12. Resistor

    • Description: Limits current flow.
    • Pins: pin1, pin2
    • Properties: Resistance: 200 Ohms
  13. COIL

    • Description: Inductor coil.
    • Pins: +, -
  14. RGB LED (Wokwi compatible)

    • Description: RGB LED.
    • Pins: R, COM, G, B
  15. Piezo Buzzer

    • Description: Emits sound.
    • Pins: pin 1, pin 2
  16. DS18B20

    • Description: Temperature sensor.
    • Pins: VDD, DQ, GND

Wiring Details

ESP32

Grounding Receptacle Outlet 15A 250V~

Bridge Rectifier

LM2596

Electrolytic Capacitor

Micro USB to Cable (2 Pin)

LCD 20x4 I2C

PZEM-004T AC

Pushbutton

Resistor

COIL

RGB LED (Wokwi compatible)

Piezo Buzzer

DS18B20

Documented Code

#include <BlynkSimpleEsp32.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <DallasTemperature.h>
#include <OneWire.h>

// Blynk Authentication Token
#define BLYNK_TEMPLATE_ID "Your Template ID"
#define BLYNK_DEVICE_NAME "Your Device Name"
#define BLYNK_AUTH_TOKEN "Your Auth Token"

// LCD and Temperature Sensor Setup
LiquidCrystal_I2C lcd(0x27, 20, 4); // Address 0x27, 20x4 LCD
#define ONE_WIRE_BUS 4              // DS18B20 data pin
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

// Pins for PZEM, Relays, and RGB
#define RELAY1_PIN 23
#define