Advertisement
Advanced Time: 5–8 weeks Electrical Engineering

Electric Vehicle Charging Station

Build a Level 2 AC EV charging station with SAE J1772 pilot signal, RFID auth, and cloud management.

EV ChargingSAE J1772OCPPPayment GatewaySmart GridPWM Pilot
DifficultyAdvanced
Duration5–8 weeks
Components10 items
Steps8 steps

Introduction

Build a Level 2 AC EV charging station with SAE J1772 pilot signal, RFID auth, and cloud management. This comprehensive guide covers everything from design through implementation, testing, and deployment.

Theory & Background

Level 2 AC charging (SAE J1772 / IEC 61851) uses a pilot signal — a 1kHz PWM square wave on the Control Pilot (CP) wire — to communicate between EVSE (charger) and EV. The duty cycle encodes the available current: 16% duty = 10A, 25% duty = 16A, 51.3% duty = 32A. The EV responds by pulling the CP line to different voltage levels: 9V (ready to connect), 6V (ready to charge), 3V (charging with ventilation needed).

Advertisement

Components & Requirements

10 components required for this project.

#ComponentPurposeQty
132A 7kW Single-Phase EVSE Controller BoardCore charging control logicx1
2MFRC522 RFID ReaderUser authenticationx1
3Raspberry Pi 4OCPP gateway and managementx1
4INA3221 Triple Current SensorEnergy metering per sessionx1
532A 250V Earth Leakage ContactorMain power switchingx1
6Type 2 EV Socket (IEC 62196)Vehicle connectorx1
76mm² 5-Core Flex CablePower delivery to socketx5m
832A RCD/GFCI ProtectionEarth fault protection (mandatory)x1
97" Touchscreen LCDUser interface and session infox1
104G LTE Module (SIM7600)Cloud connectivity for OCPPx1

Step-by-Step Implementation

Follow these 8 steps carefully.

1
Understanding EV Charging Standards

Level 2 AC charging (SAE J1772 / IEC 61851) uses a pilot signal — a 1kHz PWM square wave on the Control Pilot (CP) wire — to communicate between EVSE (charger) and EV. The duty cycle encodes the available current: 16% duty = 10A, 25% duty = 16A, 51.3% duty = 32A. The EV responds by pulling the CP line to different voltage levels: 9V (ready to connect), 6V (ready to charge), 3V (charging with ventilation needed).

2
Pilot Signal Generation

Generate the 1kHz PWM pilot signal using Arduino/ESP32 with a ±12V level shifter (CP must swing ±12V). Set duty cycle based on your circuit breaker rating. Monitor CP line voltage with a precision voltage divider to detect EV connection state machine transitions. State A: 12V (no vehicle), State B: 9V (vehicle connected), State C: 6V (charging), State D: 3V (needs ventilation), State E: 0V (fault).

3
RFID Authentication System

Connect MFRC522 RFID reader via SPI. Store authorized RFID card UIDs in a local whitelist on Raspberry Pi. On card tap, check against whitelist and remote OCPP backend. Display session start on touchscreen with user name and allowed charging limit. Log all authentication events with timestamp. Support multiple user cards with individual kWh allowances for managed fleet charging.

4
OCPP 1.6 Implementation

Install OCPP-J (JSON over WebSocket) client on Raspberry Pi using the ocpp Python library. Connect to a central management system (CMS) like SteVe or ChargePoint cloud. Implement mandatory OCPP messages: BootNotification, Heartbeat, Authorize, StartTransaction, MeterValues, StopTransaction, StatusNotification. This enables remote start/stop, remote firmware updates, and central billing.

5
Energy Metering and Billing

Read INA3221 for real-time power measurement every second. Accumulate kWh per session: energy += (power_W × 1s) / 3600000. Record session data: start time, end time, user ID, kWh delivered, peak power. Calculate session cost at configured rate (e.g., ₹8/kWh). Generate session receipt on touchscreen. Send session summary via OCPP StopTransaction message to CMS for centralized billing.

6
Safety Systems Integration

The RCD/GFCI must trip within 30ms for ground faults > 30mA (IEC 62955 requirement). Test RCD monthly using the test button. Implement software monitoring of CP line for fault states. Add overcurrent detection — if current exceeds 110% of set point for >5 seconds, open the contactor. Monitor cable temperature with NTC thermistor (max 90°C). All safety trips must be logged with cause and timestamp.

7
Touchscreen UI Development

Build the UI using PyQt5 or Tkinter on Raspberry Pi. Home screen: CATB logo, Tap card to start. During session: real-time kW, kWh delivered, session time, cost, animated charging bar. Completion screen: total kWh, total cost, carbon saved (kgCO₂ = kWh × 0.82 for India grid). Include admin mode (PIN protected) for setting tariff rates, viewing logs, and network configuration.

8
Load Management and Smart Charging

Implement dynamic load management: monitor house's main supply current via a clamp meter. When house approaches its supply limit, reduce EV charging current via pilot signal duty cycle. Schedule charging during off-peak hours (11 PM – 6 AM) when tariff is lower. Support solar surplus charging — when solar generation exceeds house load, automatically start/increase EV charging to use excess generation.

Code & Implementation

Core code for ocpp_client.py:

ocpp_client.py Python
import asyncio import logging from datetime import datetime from ocpp.v16 import ChargePoint as cp from ocpp.v16 import call from ocpp.v16.enums import RegistrationStatus, Action, AuthorizationStatus import websockets  logging.basicConfig(level=logging.INFO)  class CATBChargePoint(cp):     async def send_boot_notification(self):         request = call.BootNotificationPayload(             charge_point_model="CATB-EVSE-L2",             charge_point_vendor="CATB.in"         )         response = await self.call(request)         if response.status == RegistrationStatus.accepted:             logging.info(f"Registered. Heartbeat interval: {response.interval}s")             asyncio.ensure_future(self.send_heartbeat(response.interval))      async def send_heartbeat(self, interval):         while True:             await asyncio.sleep(interval)             await self.call(call.HeartbeatPayload())      async def authorize_card(self, id_tag):         response = await self.call(call.AuthorizePayload(id_tag=id_tag))         return response.id_tag_info.status == AuthorizationStatus.accepted      async def start_transaction(self, id_tag, connector_id=1):         if not await self.authorize_card(id_tag):             logging.warning("Card not authorized")             return None         response = await self.call(call.StartTransactionPayload(             connector_id=connector_id,             id_tag=id_tag,             meter_start=0,             timestamp=datetime.utcnow().isoformat()         ))         logging.info(f"Transaction {response.transaction_id} started")         return response.transaction_id      async def stop_transaction(self, tx_id, meter_wh):         await self.call(call.StopTransactionPayload(             transaction_id=tx_id,             meter_stop=meter_wh,             timestamp=datetime.utcnow().isoformat()         ))  async def main():     async with websockets.connect(         "ws://cms.catb.in/ocpp/CATB-001",         subprotocols=["ocpp1.6"]     ) as ws:         charger = CATBChargePoint("CATB-001", ws)         await asyncio.gather(             charger.start(),             charger.send_boot_notification()         )  asyncio.run(main())

Testing & Troubleshooting

Test Electric Vehicle Charging Station by verifying each subsystem individually before full integration.

!
Troubleshooting Tips

Verify power voltages, check ground connections, use serial monitor for debug.

Real-World Applications

*Residential home charging installation
*Apartment complex shared charging
*Office workplace charging for employees
*Shopping mall visitor charging amenity
*Fleet vehicle depot overnight charging
*Hotel and hospitality charging services
*Petrol station EV charging integration
*Smart city EV infrastructure

Extensions & Next Steps

  • Add solar integration for green charging with surplus PV power
  • Implement vehicle-to-grid (V2G) bidirectional charging
  • Add QR code payment via UPI for pay-per-use public stations
  • Build a mobile app for remote session monitoring
  • Integrate with home energy management system for smart scheduling

Interactive Playground

Coming Soon

An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.

Frequently Asked Questions

What is the difference between Level 1, Level 2, and DC Fast Charging?
Level 1 (5V AC, 1.4–1.9kW) uses a regular household outlet and adds 6–12 km of range per hour — very slow. Level 2 (240V AC, 3.3–22kW) adds 25–80 km/hour and requires a dedicated EVSE installation. DC Fast Charging (50–350kW) bypasses the onboard charger to directly charge the battery bank, adding 100–300+ km in 20–30 minutes. This project implements Level 2 charging.
Do I need a permit to install an EV charging station at home?
In most regions, installing a Level 2 charging station (above 1.8kW / 16A) requires a licensed electrician, electrical permit, and utility notification. In India, follow IS 17017-1:2018 for EV supply equipment. The circuit requires a dedicated 32A/40A circuit breaker, proper earthing system (TN-S or TT), and a 30mA RCD (RCCB). Self-installation without qualification is dangerous and may void home insurance.
What is OCPP and why is it important for EV chargers?
OCPP (Open Charge Point Protocol) is an open industry standard enabling any EV charger to communicate with any central management system, regardless of manufacturer. This prevents vendor lock-in, enables roaming (use your charge card at any network), allows remote management, and supports smart grid integration. Without OCPP, chargers can only be managed by their own proprietary app and backend system.
How do I protect against EV charging cable theft?
Use locking Type 2 sockets that engage the cable latch electronically — the cable can only be removed when the charging session is properly stopped via RFID card or app. Physical bollards or a lockable charging post enclosure prevent damage to the station. OCPP-enabled stations can remotely disable charging if suspicious activity is detected. Cable retract mechanisms keep cables off the ground when not in use.
Can this charger work with all electric vehicles?
The Type 2 (Mennekes) socket is the European/Indian standard compatible with most EVs including all Tesla Model 3/Y/S/X (with adapter for older cars), Tata Nexon EV, MG ZS EV, Hyundai Kona/Ioniq, BMW, Mercedes, Volkswagen EV models. North American vehicles use SAE J1772 (Type 1) but can use adapters. CHAdeMO and CCS are DC fast-charging standards incompatible with this Level 2 AC design.
Advertisement