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

ESP8266 Nodemcu Controlled EV Wireless Charging System

View and Edit Project In Cirkit DesignerImage of ESP8266 Nodemcu Controlled EV Wireless Charging System

Circuit Documentation

Summary

The circuit in question appears to be a wireless charging system with voltage regulation and battery charging capabilities. It includes an AC power supply, a bridge rectifier for converting AC to DC, a voltage regulator for maintaining a stable output voltage, and a charging module for a 3.7V battery. The system is controlled by an ESP8266 NodeMCU microcontroller, which manages the charging process and provides user feedback through an OLED display. The circuit also includes a MOSFET for switching purposes, resistors for current limiting, and capacitors for voltage smoothing.

Component List

Mosfet

Copper Coil

AC Supply

ESP8266 NodeMCU

Electrolytic Capacitor

Bridge Rectifier

LM317 Voltage Regulator

TP4056

3.7V Battery

Resistor

LED: Two Pin (red)

OLED Display 128x32

Wiring Details

Mosfet

Copper Coil

AC Supply

ESP8266 NodeMCU

Electrolytic Capacitor

Bridge Rectifier

LM317 Voltage Regulator

TP4056

3.7V Battery

Resistor

LED: Two Pin (red)

OLED Display 128x32

Documented Code

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// LCD setup
LiquidCrystal_I2C lcd(0x27, 16, 2);  // I2C address 0x27 for a 16 chars and 2-line display

// Pin definitions
const int mosfetPin = D1; // GPIO pin connected to the MOSFET gate
const int ledPin = D2; // GPIO pin connected to the LED for charging indication

// Variables
float batteryVoltage = 0.0; // Variable to store battery voltage

void setup() {
  Serial.begin(115200); // Start serial communication
  lcd.begin(); // Initialize LCD
  lcd.backlight(); // Turn on LCD backlight

  pinMode(mosfetPin, OUTPUT); // Set MOSFET control pin as output
  pinMode(ledPin, OUTPUT); // Set LED pin as output

  digitalWrite(mosfetPin, LOW); // Start with MOSFET off
  digitalWrite(ledPin, LOW); // Start with LED off

  lcd.setCursor(0, 0);
  lcd.print("EV Wireless Charging");
}

void loop() {
  batteryVoltage = readBatteryVoltage(); // Function to read battery voltage

  lcd.setCursor(0, 1);
  lcd.print("Voltage: ");
  lcd.print(batteryVoltage);
  lcd.print(" V");

  // Charging control logic
  if (batteryVoltage < 3.7) { // If battery voltage is low
    digitalWrite(mosfetPin, HIGH); // Turn on MOSFET to start charging
    digitalWrite(ledPin, HIGH); // Turn on LED to indicate charging
    lcd.setCursor(0, 1);
    lcd.print("Charging...");
  } else {
    digitalWrite(mosfetPin, LOW); // Turn off MOSFET to stop charging
    digitalWrite(ledPin, LOW); // Turn off LED
    lcd.setCursor(0, 1);
    lcd.print("Charged!    ");
  }

  delay(1000); // Delay for a second before next reading
}

// Function to simulate battery voltage reading
float readBatteryVoltage() {
  // Replace with actual code to read voltage from your circuit
  return 3.5 + (rand() % 10) * 0.01; // Simulate a voltage between 3.5V and 3.6V
}

This code is designed to run on the ESP8266 NodeMCU microcontroller. It initializes an I2C LCD display, controls a MOSFET for charging, and indicates the charging status with an LED. The battery voltage is read and displayed on the LCD. Charging logic is implemented to start or stop charging based