The Backpack variant
The J1772 pilot line on the EVSE end is connected to a ±12 volt square wave generator with a 1 kΩ output impedance. The line can either be pinned at +12 volts, -12 volts, or oscillating at 1 kHz with a variable duty cycle. If no vehicle is connected, or if the EVSE is not ready for charging, it will pin the pilot at +12. If the EVSE is in an error condition from which it cannot reasonably recover, it may pin the pilot at -12 volts. If a vehicle is connected and the EVSE is prepared to supply power, it will oscillate the pilot.
On the vehicle end the circuit is quite simple. There is a 2.7 kΩ resistor in series with a diode from the pilot to ground. Most EVs will have a second 1.3 kΩ resistor in parallel with the 2.7 kΩ one, but with a switch (likely a transistor or MOSFET) to bring the 1.3 kΩ additional impedance into play. Because of the host EVSE's 1 kΩ output impedance, 2.7 kΩ will lower the +12 volts to +9 volts. The added 1.3 kΩ will reduce that to +6 volts. Optionally, a fourth state can be defined by adding another 330 Ω, reducing the voltage to +3 volts. This last state indicates to the host EVSE that this vehicle has lead-acid batteries and requires ventilation for charging. EVSEs mounted indoors are supposed to refuse charging when this happens, but EVSEs mounted outdoors can allow it.
The diode will prevent the added impedance from impinging on the negative portion of the square wave. The EVSE is able to detect the minimum and maximum voltage seen on the vehicle side of the 1 kΩ output impedance and therefore detect the state changes. If the negative portion doesn't reach (close to) -12 volts, then the EVSE can surmise that the diode is missing and that a compliant vehicle is not connected and refuse to charge.
The duty cycle of the 1 kHz square wave indicates the ampacity of the EVSE from 6 amps to 80 amps. Additionally, a special duty cycle can be used to indicate "digital communications required," which is what CCS HVDC EVSEs use.
The EV Sim uses a resistor divider network to rescale the potential input voltage range of -12 to +12 to 0-5 volts. That's fed into an analog input pin on the controller. The controller samples the input voltage repeatedly over the course of a sample period and captures the maximum and minimum voltage and the duty cycle (using 0 volts as a decision point dividing low from high). The EV Sim is a "backpack" board on a 2x16 80x36 mm LCD character display. It will display the frequency and duty cycle of the pilot (if it's oscillating) and translate that into a J1772 ampacity indication. Pressing the button will change it into a mode where it displays the minimum and maximum voltage.
The Remote Variant
There's a second version of the project that exchanges the LCD for a USB connection. The ATTiny84 is replaced with an ATTiny841, which has a USART in it to make serial I/O easier. The serial pins are connected to a CY7C65213 USB UART chip. Like the backpack variant, there's a resistor divider network to scale the ±12v pilot to 0-5v for the ADC. Analog sampling, again, is used to determine the number of state changes per second (double the frequency), the number of samples of the "high" and "low" states as well as the positive and negative peak ADC readings. Those are presented over serial to the host as JSON lines.
To control the state, the 3 state setting resistors (2.7 kΩ, 1.3 kΩ and 330 Ω) are switched in and out with N MOSFETs by lines from the controller. Sending a single character A-D over the USB connection will make the EV Sim change states. Unlike the backpack variant, there is no provision to "remove" the diode.
To use the EV Sim, first turn off all four of the DIP switches and then connect the pilot and ground wire up to the J1772 plug of the EVSE. If you look at the plug from the socket end, the pilot pin is at 4 o'clock and the ground pin is at 6 o'clock. *WARNING*...Read more »