Preliminary schematic

A project log for Raspberry Pi EVSE Hat

Use a Raspberry Pi to build an EV charging station

Nick SayerNick Sayer 09/11/2019 at 23:200 Comments

I've uploaded a preliminary schematic. Copied from OpenEVSE II is the GFI, +12 and -12 power supplies and the pilot generator.

The new bits are the Raspberry Pi interfaces. In particular, there's a bit of logic around the GFI and relay output that needs some explanation.

When a ground fault happens, the !GROUND_FAULT net will be brought low. That will cause the flip-flop to turn on, which will bring it's !Q output low, which will force the relay output off regardless of its state. The flip-flop can be reset with the PI_GFI_CLR pin, but only if the PI_RELAY signal is off. This means that you can't clear a GFI fault without turning the relay off first. This is a bit of belt-and-suspenders insurance against the software doing something dumb.

There's also a GFI_TEST line. The idea here is that you're supposed to pulse the GFI_TEST line with a 60 Hz square wave (bit-banging in software would be sufficient) and you should see the PI_GFI_SENSE line turn high. After waiting a little bit and pulsing the PI_GFI_CLR line briefly you should see PI_GFI_SENSE go low and stay there. That insures that the GFI functionality works properly. The output of the test circuit goes to a wire that takes 3 or 4 turns through the GFI CT coil and then connects to ground. The 60 Hz pulses will simulate a residual current. This GFI test should be performed immediately before the relay is turned on, every time.

The 5 volt supply is brought in from the FPC connector to the HV board. We also get the relay test / GCM signal and pass that (through a level shifter) directly to a pi GPIO pin. The idea is that this pin should follow the state of the PI_RELAY pin (modulo some switching latency). If it's on when PI_RELAY is off, then that's a stuck relay. If it's off when PI_RELAY is on, then that's a ground impedance failure.

What's still missing is an ADC for the pilot sense. This will be slightly complicated since the SPI lines on the Pi are 3.3v and we would prefer the analog reference voltage to be 5 volts. This will probably require some sort of level shifting. We could use an i2c ADC instead, but I really prefer SPI. We'll see. We also need to choose how many channels to make the ADC. We only need one channel for the pilot feedback sense, but with 3 channels we could also sense input AC voltage and add a current sense CT for power logging.