WARNING!

Do not build one of these and use it as a basis for an EVSE. Please. A proper EVSE has a bunch of safety systems built-in to prevent fatal electrocution. If you want to build an EVSE, go look at one of my other projects, like OpenEVSE II, the Hydra, or the Pi EVSE Hat.


To check the operation of my EV Sim, I sometimes drag my own charging station plug over to the workbench and use that, but it's not very convenient, and you have to be careful to avoid the hot pins.

This project is just my quad MOSFET pilot generator circuit, plus the -12 volt charge pump and an ATTiny85 to generate the input square wave.

The pilot generator takes a TTL level input. That input is fed into the gates of an N and P MOSFET (which are simply two units in a dual complimentary array). The signal being high turns on the N channel FET and the signal being low turns on the P FET. The P FET pulls up on the gate of a second N channel FET, which switches on the -12 volt supply to the pilot output. The primary N channel FET pulls down on the gate of a secondary P channel FET, which switches on the +12 volt supply to the pilot output. The input logic line has a pull-up resistor to insure that it is firmly in one state at all times, as otherwise it's possible that both sides of the circuit could be switched on, which would short out the two 12 volt supplies to each other. The secondary FET gates have pull-open resistors to their sources and the lines from the primary FET drains have series resistors. The ratio of these biasing resistors is intended to make turning the FETs on take slightly longer than turning them off, which results in less current draw during the transitions. The resulting rise and fall times are well inside the requirements in the J1772 spec. This same pilot generator is in all of my EVSE projects.

The primary power input is +12 volts. This directly supplies the positive side of the pilot generator. A TC1044 charge pump inverter derives -12 volts from that. To supply +5 volts to the controller, there's a wide input LDO.

The Tiny85 is set up with Timer 0 in Fast PWM mode to generate the variable duty cycle 1 kHz square wave. The duty cycle is selected with a simple pot feeding an analog input. The ADC reads the pot's setting and sets the duty cycle in 1/4% increments. Yes, you could probably do this simpler with a purely analog circuit, but  pilot generation needs to have a fairly accurate frequency and stable duty cycle, so doing it with a crystal controlled microcontroller is a better idea.

One disadvantage of the Tiny85 is that if you use a crystal to clock it, and if you don't disable !RESET, then the remaining usable pins are all also used for programming. Any pins used as outputs don't really matter, so long as the downstream circuitry can tolerate the programming signals while programming is taking place (in our case, powering the chip via the ISP interface rather than with the input 12 volt supply would suffice). Pins used as inputs potentially need to be protected during programming from low impedance outputs. For us, this means protecting the SCK pin, which is used as the analog input from the pot. Since the ADC input is high impedance, we can simply add 1 kΩ of series impedance without impacting the ADC operation, but this extra impedance will allow the programmer to easily override it during programming.

As an alternative, we could replace the pot with using the USI interface to perform async serial input, but the AC0B output is shared with the USI DO pin, so this potential serial interface would have no output side. It seems more sensible to bump up to a more capable controller chip (perhaps the ATTiny841) if changing the control mechanism is desired.

Another variation on this project replaces the ATTiny85 with an ATTiny10. The ATTiny10 is dramatically less expensive than the 85, and is a reasonable choice because we only need one analog input pin and one timer output pin. What complicates the choice of the T10 is that it can only be externally clocked with a square wave - it has no crystal oscillator (internal clocking wouldn't be suitably accurate per the J1772 spec). Moreover, the clock input pin is also the programming clock pin, so you must be able to disable or otherwise override it during programming. Fortunately, you can get self-contained oscillators with disable pin functionality. They're a little more expensive than the equivalent crystal for the T85, but not so much that you completely eat away the lower cost of the T10 (the importance of engineering for BOM value when you need exactly one of a them is obviously debatable). The oscillator inhibit pin can simply go to a normally open solder jumper. You could solder it closed for programming, but it's really only necessary to short it with a length of desoldering braid (for example) for the duration of programming (which for the T10 is only a few seconds).