All projects

Hardware · ESP32

Mini EV Charging Station

A building-brick charging station that simulates a complete EV charging session, built to explain how EV charging works to kids aged 8 to 12. Plug the car in, watch the lights change and the numbers go up.

The charging station built from blue and grey bricks, with a 16×2 blue LCD reading Idle and 0.00 kWh, a green status light on top, a charging cable on a post and a minifigure standing beside the parking bay.
The station in Idle: green light on, the display waiting at 0.00 kWh.

How it works

The station is a five-state machine. A push button hidden under the plug moves it from one state to the next, and every state has its own light pattern and display text. While charging, the energy counter rises by 0.01 kWh every half second, and the cost follows from the price per kWh.

The same controls are available in the browser: the ESP32 opens its own Wi-Fi network and serves a dashboard with live values, settings and a session history.

StateGreen lightRed lightEnergy and cost
IdleOnOff0
Ready!OffBlinking0
Charging…OffOnCounting up
Charging stoppedBlinkingOffFrozen where you stopped
Charging completeBlinkingOffFrozen at the limit
The brick station with a toy car parked in front, next to a laptop showing the Mini EV Charger web dashboard with status Idle, energy, cost and a Ready button.
A car in the bay and the web dashboard at 192.168.4.1.
Top view of the station with its roof lifted, showing the ESP32 and breadboard wiring inside the brick housing and the green status light glowing.
Roof off: the ESP32 and breadboard fit inside the housing.

Build your own

You need no soldering. Everything sits on a breadboard, and the housing is whatever bricks you have at home.

What you need

  • An ESP32 dev board (a standard 38-pin board) and a USB cable
  • A 16×2 I2C LCD that works with the LCD_ST7032 library
  • One red and one green LED, each with a current-limiting resistor
  • A small push button
  • A breadboard and jumper wires
  • Building bricks for the station, plus a toy car

Wiring

PartConnection
Power railsESP32 GND to the ground rail, ESP32 3V3 to the 3.3 V rail
Push buttonGPIO18 → button → GND (the internal pull-up is used, so no resistor is needed)
Red LEDGPIO23 → resistor → LED → GND
Green LEDGPIO4 → resistor → LED → GND
LCDSDA → GPIO21, SCL → GPIO22, GND → GND, VCC → 5 V or 3.3 V depending on your module
The bare breadboard build: ESP32 on a breadboard with the push button and two LEDs, wired to the LCD, which reads Idle and 0.00 kWh. The green LED is lit.
Idle: green LED on.
The same breadboard build while charging: the LCD reads Charging and 0.28 kWh, and the red LED is lit.
Charging: red LED on, energy counting up.

Flash the firmware

  1. Install the Arduino IDE.
  2. Add ESP32 support: open Boards Manager, search for esp32 and install the package by Espressif Systems.
  3. Open Library Manager and install LCD_ST7032. Wi-Fi, the web server and flash storage come with the ESP32 package.
  4. Download the code from GitHub and open firmware/mini-ev-charger/mini-ev-charger.ino. The IDE loads the other files in that folder automatically.
  5. Connect the board, choose ESP32 Dev Module and its port, then click Upload.
  6. Optional: open the Serial Monitor at 115200 baud. It confirms that the Wi-Fi network has started and prints the station's address.

Use it

With the button

  1. Park the car at the station. It starts in Idle with the green light on.
  2. Press the hidden button to “plug in”. The station is Ready! and the red light blinks.
  3. Press again to start charging. The red light stays on, and energy, cost and the timer count up on the display.
  4. Press again to stop. The green light blinks and the numbers freeze.
  5. Press once more to return to Idle for the next car.

If the charge limit or the cost cap is reached first, the station switches to Charging complete on its own.

With the web dashboard

  1. On a phone, tablet or laptop, join the Wi-Fi network EV-Charger with the password 12345678.
  2. Open http://192.168.4.1 in the browser.
  3. The dashboard offers only the actions that fit the current state, such as Ready, Start charging, Stop charging or Back to Idle. Values refresh every second.
  4. A stopped session can be resumed: energy and the timer carry on where they paused.
  5. Open Session history to see the last five sessions with energy, cost and duration. They are kept in flash, so they survive a power cut.

Settings

In Idle, the dashboard shows a settings panel.

SettingDefaultWhat it does
Charge limit1.0 kWhCharging completes when this much energy is delivered. At the default, a full session takes about 50 seconds.
Price per kWh€0.35Used to calculate the cost shown on the display and dashboard.
Cost capOffOptionally stop charging once the cost reaches this amount. Set it to 0 to switch it off.

For tinkerers

GET /api/status returns the current state, energy, cost and duration as JSON, which is handy for connecting another screen or app.

Safety: this is a simulator and a toy. It does not charge anything. Never connect it to a real vehicle, a charging cable or any battery-charging circuit.