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

ESP32-Based Battery-Powered Voltage and Current Monitoring System

View and Edit Project In Cirkit DesignerImage of ESP32-Based Battery-Powered Voltage and Current Monitoring System

Circuit Documentation

Summary

This circuit involves an ESP32 microcontroller interfacing with a voltage sensor, a current sensor, a bridge rectifier, an electrolytic capacitor, and a 5V battery. The ESP32 reads voltage and current values from the sensors and outputs the data via serial communication.

Component List

GND

Electrolytic Capacitor

ESP32 (30 pin)

Bridge Rectifier

Voltage Sensor DC 25V

Current Sensor 5A

5V Battery

Wiring Details

ESP32 (30 pin)

Voltage Sensor DC 25V

Current Sensor 5A

Electrolytic Capacitor

Bridge Rectifier

5V Battery

Code Documentation

ESP32 Code

int voltagePin = 34;
int currentPin = 35;

void setup() {
  Serial.begin(115200);
  pinMode(voltagePin, INPUT);
  pinMode(currentPin, INPUT);
}

void loop() {
  float voltage = analogRead(voltagePin) * (3.3/4095.0);
  float current = analogRead(currentPin) * (3.3/4095.0);
  Serial.print("Voltage: "); Serial.println(voltage);
  Serial.print("Current: "); Serial.println(current);
  delay(500);
}

This code initializes the ESP32 to read analog values from the voltage and current sensors connected to pins 34 and 35, respectively. The values are then converted to voltage and current readings and printed to the serial monitor every 500 milliseconds.