Prototype IEC61851 / J1772 EVSE Interface

This is a prototype IEC61851 / J1772 EVSE (Electric Vehicle Supply Equipment) Interface intended to connect to a 3.3V micro-controller of your choice. It was originally designed to piggyback on the Electric Vehicle Charge Controller PCB (shown above) and utilise the on-board Microchip dsPIC33 MCU. Firmware for the dsPIC33 is currently working.

Code is now being developed for the ESP32. The ESP32 has WiFi capability and this will enable the EVSE to retrieve electricity market pricing or instantaneous PV solar generation data.

Below are selection of open source designs for EVSE. Some have been through multiple revisions and make a great starting point to learn from their findings.

Hardware – Theory of operation

Readers should be familiar with IEC61851 / J1772 signalling. If not, please refer to Wikipedia.

Control Pilot – Background

Below is a simplified version of the Control Pilot (CP) circuit. A relay, used to switch in SWCAN digital communications, has been removed to enhance readability.

Figure 1: Simplified Control Pilot Circuit.

The PWM input is a 3.3V digital input. Use an external microcontroller to generate a 1kHz ± 0.5% square wave used to advertise the available charging current. The duty cycle can be determined from the table below:

Available Charging CurrentDuty Cycle provided by EVSE (± 1%)
Use Digital Comms
e.g. IEEE 1901 Power Line or Tesla SWCAN
6A to 51A10% to 85% – Duty Cycle = Current (A) / 0.6
51A to 80A85% to 96% – Duty Cycle = (Current (A) / 2.5) + 64

Op-amp U3A (LM7332) will convert this to a ± 12V signal and drive the control pilot via a 1K series resistor. The LM7332 is a rail to rail op-amp with high output drive and has been used by SmartEVSE.

Figure 2: +/-12V Power Supply for Control Pilot.

The ±12V is generated by a 1 watt Mean-well unregulated DC-DC converter (DPU01L-12) operating from a 5V supply. According to the datasheet the output should have an absolute accuracy of ± 3%, but load regulation may be poor. The IEC standard calls for a voltage tolerance of ±5%. It has been noted some open source EVSE designs have shifted from these DC-DC brick converters to a positive 5V to 12V DC-DC switcher and separate charge pump (e.g TC1044) to generate the negative rail from the positive.

Control Pilot Feedback (Status)

The vehicle will communicate back the status by loading the positive cycle of the control pilot. This will in effect produce the following voltages (acts as a voltage divider with the 1k resistor R7):

Charging StatusVoltage at EV SocketCP Output
Vehicle Detected+9±1V2.89V
Ready (Charging)+6±1V2.5V
No Power (off)0V1.72V

With a spare ½ op-amp left, U3B provides voltage buffering of the CP.  R12/R13/R14 is designed to linearly convert ±12V to 0 to 3.3V suitable for feeding into an ADC.

PP (Proximity Pilot) – For Detachable Cable Assemblies

When a tethered cable is attached, the maximum current advertised by the EVSE should naturally not exceed the maximum capability of the charging cable. In this case, the maximum current is hardcoded, and the PP line is normally not connected back to the EVSE electronics.

However, when an EVSE accepts detachable cables, it must first determine the maximum current carrying capacity of the cable. This is done via a resistor mounted in the plug between PP and PE of the detachable cable. (IEC states removable cables should have no release buttons). Both ends of the cable should have the same resistor value so both the EVSE and vehicle can determine maximum current capacity.

Figure 3: Proximity (Detachable Cable Current) Detection.

The PP analog output is used to determine the maximum current carrying capability of the detachable cable. This resistor acts as a simple voltage divider with R10.

Resistor fitted to charging cable (Ohms)Amps (Cable)PP Output (Volts)

Tesla SWCAN Support

This board also includes experimental support for Tesla SWCAN (Single Wire Controller Area Network) communication. This is optional and does not need to be populated.

To enable this mode, set SWCAN_EN high. This will enable a relay and switch the control pilot line to the SWCAN transceiver.  SWCAN_RX and SWCAN_TX is the output from the transceiver and should be wired to a CAN Controller.

Contactor Driver / General Purpose Open Drain Outputs

The board includes two 60V open drain MOSFET outputs, one intended to operate the mains contactor to enable power to the vehicle. The SQ2364EES has a maximum drain current of 2A. (Maximum power is 3 watts, but with a RDSON @ 1.5V of 0.245ohms, you are unlikely to exceed it.)

Figure 4: Output MOSFETs to drive mains Contactor.

Normally you would include some back EMF protection across the coil, however we do not have access to the coil supply. The contactor currently being used has in-built protection varistor to suppress back EMF.

Connector I/O

Below is the pinout for the I/O connector. The PCB requires both 5V and 3.3V to operate. I/O is 3.3V.

Figure 5: I/O Connector.
5VPower5V Power Supply. Provides 5V for +/-12V Switcher, SWCAN transceiver and relay.
3V3Power3.3V Power Supply
PWMDigital Input1kHz Control Pilot signal. Duty cycle specifies available charging current.
CPAnalog OutputControl Pilot feedback. Used to determine vehicle state.
PPAnalog OutputProximity Pilot. Reports maximum current carrying capability of detached cables. Not used when implemented with tethered cable.
OUT1Digital InputEnable MOSFET output (1).
OUT2Digital InputEnable MOSFET output (2).
SWCAN_ENDigital InputHigh enables Single Wire CAN Mode. Pulled low by 10k.
SWCAN_RXDigital OutputReceive output from SWCAN Transceiver.
SWCAN_TXDigital InputTransmit input to SWCAN Transceiver.

Design Files

Design files can be downloaded from the Circuit Maker website. Circuit Maker is a free EDA tool from Altium.

Source Code

Open Source Firmware based on the dsPIC33EP can be found the following GitHub Repository:

Safety Notes

This is a prototype interface module and not a finished product. Reproduction should only be attempted by suitably competent persons.

Most EVSE will have a built-in RCD (Residual Current Device) or GFCI (Ground Fault Circuit Interrupter) Type-A, 30mA trip.

Type-A RCD’s will not trip or could get saturated by DC leakage currents. Some jurisdictions require Type-B (or Type-EV) RCDs that will trip with DC leakage. This may also be provided as a built-in RDC-DD (Residential Direct Current Detection Device) conforming to IEC62955.

Other jurisdictions may also require PEN (Protective Earth and Neutral) fault protection.


Leave a Reply

Your email address will not be published.