Thursday, July 10, 2014

OpenEVSE II - ground failure testing

Chris H over at the OpenEVSE project brought UL standard 2231 to my attention the other day. What it amounts to is that UL mandates a ground impedance test for EVSEs.

This is kind of a wrench for the Hydra EVSE, since it requires you to intentionally create and then measure a ground "fault." But the Hydra EVSE puts the GFI coil on the AC input so that it can have only one GFI circuit. But if you're going to have a ground test as well, then you either have to siphon off the current for it before the GFI coil, or the GFI is going to see the ground test current as a fault.

The normal architecture of the Hydra is that the AC hot lines go into a distribution bus module where the hot lines are divided to go to each relay. That's the only place where the AC can be broken out. But if you put the GFI coil after that, then you have to try and squish four 10 (or even 8) gauge wires through the coil instead of just two.

The other way to go is to leave the GFI in front and then simply account for the leakage by desensitizing the GFI circuit accordingly. That only works, however, if the leakage is constant - which means that the traditional OpenEVSE relay test system won't work, because the leakage would depend on how many cars were being powered (never mind that the OpenEVSE system doesn't allow for continuous ground testing, which is required by the UL standard).

For OpenEVSE II, I believe I've come up with a workable ground test solution.

The OpenEVSE II HV + Contactor board schematic

The reason the original OpenEVSE solution couldn't test ground impedance continuously was that when both relays were turned on, then a circuit path existed from one hot, through one of the MID400s, to the ground line running between the two MID400s, then through the other one and back to the other hot - there was no requirement for the current to actually flow to ground. You could only make the current flow to ground by lighting up one hot line at a time (which you obviously can't do while charging).

My solution is to use a pair of rectifier diodes to break that cross-conduction path. That done, the test can be run continuously. With a comparator acting as a threshold, the microcontroller should see high logic levels no less frequently than once every 15 ms (3/4 of a cycle at 50 Hz).

The other optoisolator just above the bottom one is acting as an isolated voltmeter. The same voltage divider that supplies the threshold for the comparator is also used to supply a biasing offset for a transimpedance amplifier, which converts the phototransistor's collector current into a 1-5 volt output for an analog pin. The controller will simply look for a peak and scale it. The peak voltage will be 1.414 times higher than the RMS voltage because (unlike the ammeter) we can be sure that the input will be a pure sine wave. Peak reading should allow for the most linear portion of the phototransistor's operating range to be used, which hopefully will yield reasonably accurate results.

Note that the optoisolator in this case is actually an AC input one - there are two LEDs in opposing parallel on the input side. This means that both AC half-cycles will create light.


  1. I fail to see how your lower LTV826S will detect a ground resistance of say, 500 to 1000 ohm.

    1. There is a detection threshold, certainly. I haven't done exhaustive testing to determine where it is, but if it's too high or too low, it can be adjusted with the value(s) of the series resistors to make the LEDs "brighter" or "dimmer."

    2. 500-1000 ohms external to ground will not affect the current at all with that 47K in series. That's only ~1% difference. If you lower that 47K, won't the ground current flow be too high?

    3. You're right, it's quite small in comparison. I honestly don't know what the governing standards require as a threshold (I'm trying to find out, but can't afford to just outright buy a copy of UL 2231-1).

      If the spec requires that level of sensitivity, there won't be any choice than try and come up with a way to amplify the measured current flow and isolate the result. That's going to be more complex.

      On the other hand, what I've designed is very similar to the original OpenEVSE GMI/relay test system (at least on the primary side of the opto), and I believe Chris has said that that system has passed U.L. scrutiny.

      The only way to know for certain is to determine the spec requirements.

    4. Sent you a private email. Mike.