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

ESP32-Based Smart Power Socket Controller with Current Sensing

View and Edit Project In Cirkit DesignerImage of ESP32-Based Smart Power Socket Controller with Current Sensing

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed to interface various components with an ESP32 microcontroller. The circuit includes power supply elements, a current sensor, a relay, LEDs, resistors, and an LCD display. The ESP32 serves as the central processing unit, controlling the relay and LEDs, and receiving data from the current sensor. The circuit is powered by a 12V power supply, which is regulated down to the voltage levels appropriate for the ESP32 and other components.

Component List

AC Wall Plug Point

ESP32

2.1mm DC Barrel Jack

Rocker Switch

Resistor (200 Ohms)

16X2 LCD

2.1mm Barrel Jack with Terminal Block

ACS712 Current Sensor

5V Relay

Socket

LED: Two Pin (Green)

LED: Two Pin (Red)

POWER SUPPLY 12V 5AMP

Wiring Details

AC Wall Plug Point

ESP32

2.1mm DC Barrel Jack

Rocker Switch

Resistor (200 Ohms)

16X2 LCD

ACS712 Current Sensor

5V Relay

LED: Two Pin (Green)

LED: Two Pin (Red)

POWER SUPPLY 12V 5AMP

Documented Code

ESP32 Microcontroller Code (Instance ID: 79c68616-4cab-4018-9729-178f6e3c537b)

void setup() {
  // Initialize the digital pins as outputs:
  pinMode(D34, OUTPUT);
  pinMode(D27, OUTPUT);
  pinMode(D14, OUTPUT);
  pinMode(D21, OUTPUT);
  pinMode(D22, OUTPUT);
  pinMode(D26, OUTPUT);
}

void loop() {
  // Example code to blink the LEDs and control the relay:
  digitalWrite(D27, HIGH);   // Turn on the red LED
  digitalWrite(D14, LOW);    // Turn off the green LED
  delay(1000);               // Wait for a second
  digitalWrite(D27, LOW);    // Turn off the red LED
  digitalWrite(D14, HIGH);   // Turn on the green LED
  delay(1000);               // Wait for a second
  
  // Control the relay:
  digitalWrite(D26, HIGH);   // Activate the relay
  delay(2000);               // Wait for 2 seconds
  digitalWrite(D26, LOW);    // Deactivate the relay
}

(Note: The provided code is a basic example. The actual application code will depend on the specific requirements of the circuit's use case.)

Additional Notes

Please ensure that the actual application code is written and uploaded to the microcontrollers for the circuit to perform its intended functions.