The problem
Residential societies and campuses are installing EV charge points, but most are dumb sockets — the society pays one electricity bill and has no fair way to split charging costs between EV owners. Commercial smart chargers solve this at a price few small setups can justify. This project builds the metering and billing layer as a retrofit: a PZEM-004T module measures true electrical parameters of each charging session, the ESP32 applies the configured tariff, and the dashboard produces per-session bills, receipts and revenue summaries. A contactor under ESP32 control handles safe start/stop, and the design keeps all high-current wiring in a properly rated enclosure path, documented with mains-safety notes throughout.
How it works
- The driver plugs in and starts a session from the dashboard or a button on the unit; the ESP32 closes the contactor.
- The PZEM-004T continuously reports voltage, current, power and cumulative energy over Modbus to the ESP32.
- The ESP32 publishes live readings over MQTT and accumulates session kWh locally as a backup.
- The billing engine multiplies energy by the active tariff slot (peak/off-peak) and adds any fixed session fee.
- On stop — driver action, full-charge current taper detection, or overload — the contactor opens and the final bill is generated.
- The dashboard archives the session receipt and updates the day's revenue totals.
Tech stack:
- ESP32 + PZEM-004T energy meter + 40 A contactor
- 0.96" OLED, emergency-stop input, overload protection
- MQTT (Mosquitto) telemetry
- Python/Flask or Node.js billing backend
- HTML/CSS/JS billing dashboard (single-file demo included)
- SQLite for session and tariff records
| Parameter | Value |
|---|---|
| Metering | PZEM-004T: V, I, P, kWh via Modbus (datasheet) |
| Controller | ESP32 |
| Switching | 40 A contactor, ESP32-driven with e-stop (design target) |
| Tariff | Configurable ₹/kWh + fixed fee; peak/off-peak slots |
| Telemetry | MQTT live readings every 2 s (design target) |
| Billing math | Bill = kWh × tariff + session fee (expected) |
| Display | OLED: V, I, kW, kWh, running bill |
| Safety | Overload cut-off, e-stop input, mains-safety build notes |
| Records | SQLite session receipts, CSV export |
Project features
- [True energy metering] PZEM-004T measures voltage, current, active power and cumulative kWh per session — real metering, not current-guess estimates.
- [Live billing engine] The dashboard applies a configurable ₹/kWh tariff plus optional fixed session fee, showing the running bill in real time.
- [Contactor control] A 40 A contactor under ESP32 control starts/stops charging, with emergency-stop input and overload cut-off.
- [Driver-facing OLED] The unit's display shows live power, energy and current bill so the driver sees exactly what they are paying.
- [Session receipts] Each completed session generates a bill record: vehicle ID, start/end time, kWh, tariff applied, total.
- [Revenue dashboard] Daily sessions, total kWh dispensed and revenue collected, with per-charge-point breakdowns.
- [Tariff configuration] Peak/off-peak tariff slots are configurable from the dashboard for time-of-day pricing.
What is included
- Metering unit hardware (ESP32 + PZEM-004T + contactor + OLED)
- Firmware (metering, contactor control, safety cut-offs, MQTT)
- Billing dashboard web application (live view, tariffs, receipts, revenue)
- Single-file billing dashboard demo for presentation
- Wiring diagram with mains-safety and enclosure notes
- Project report PDF (background, metering method, safety design, methodology, test procedure, results)
- PPT presentation for final review
- Viva Q&A preparation document (energy metering, Modbus, contactors, billing logic)
Limitations & prerequisites
- This is an educational metering/billing prototype, not a certified revenue meter — bills are for demonstration and internal cost-splitting, not legal metrology, stated plainly.
- The contactor switches mains current: assembly and installation must follow the documented safety notes and be supervised by qualified personnel.
- Single-phase AC charging only in the base build; DC fast charging is an entirely different system and out of scope.
- Tariff accuracy depends on correct PZEM-004T calibration; the report includes the calibration procedure.
- No payment gateway in the base build — billing produces records and receipts; collection is manual (gateway integration is future scope).
- Dashboard and broker need a local always-on host; no cloud service is included.
Frequently Asked Questions
How is billing calculated?
Session energy in kWh (measured by the PZEM-004T) times the configured tariff, plus an optional fixed session fee. Peak/off-peak tariff slots make time-of-day pricing possible.
Is it safe to switch EV charging current?
The design uses a properly rated 40 A contactor with an emergency-stop input and overload cut-off, and the build notes cover mains safety. Assembly must be supervised by qualified personnel.
Can it replace a commercial smart charger?
For cost-splitting in a society or campus, it demonstrates the full metering-to-bill chain. It is not a certified revenue meter and makes no legal-metrology claims.
Does it handle payments?
No — the base build generates bills and receipts; payment collection is manual. Gateway integration is documented as future scope.
What happens in a power cut mid-session?
Session energy is accumulated locally on the ESP32 as well as the dashboard, so the bill can be reconstructed from the last synced reading.
Is this project suitable for a final-year project?
Yes — for IoT & Embedded, Electrical and Computer Science programs. It combines real energy metering, power switching with safety design, and a complete billing data pipeline. Suitable for B.E./B.Tech final-year projects in IoT & Embedded Systems, Electrical and Computer Science.
Components & software requirements
- ESP32 + PZEM-004T energy meter + 40 A contactor
- 0.96" OLED, emergency-stop input, overload protection
- MQTT (Mosquitto) telemetry
- Python/Flask or Node.js billing backend
- HTML/CSS/JS billing dashboard (single-file demo included)
- SQLite for session and tariff records
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.