Close
0%
0%

J1772 Pilot Generator

A tester for J1772 pilot analysis

Similar projects worth following
543 views
0 followers
One of my other projects is an EV Simulator, which is a piece of test equipment for J1772 EVSEs.

Well, I need a piece of test gear for THOSE now, so here we are.

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...

Read more »

pilot gen t10.pdf

Adobe Portable Document Format - 34.08 kB - 08/21/2021 at 03:05

Preview

pilot gen t10.sch

sch - 201.46 kB - 08/21/2021 at 03:05

Download

pilot gen t10.brd

brd - 66.61 kB - 08/21/2021 at 03:05

Download

pilot gen.pdf

Adobe Portable Document Format - 36.15 kB - 08/04/2021 at 05:36

Preview

pilot gen.sch

sch - 187.54 kB - 08/04/2021 at 05:35

Download

View all 6 files

  • Why not the Tiny9/10?

    Nick Sayer08/13/2021 at 00:33 0 comments

    Folks who have followed me lately know that I've had a penchant for using the ATTiny9 in a lot of projects. So why the Tiny85 here?

    The problem comes down to clocking. The Tiny85 can use a crystal for clocking (at the cost of a quarter of the pins). This project needs fairly accurate (I mean, not like GPSDO accurate, but better than the built-in RC oscillator) clocking so that the 1 kHz frequency of the output pilot stays within J1772 spec.

    Well, the only way to clock the Tiny9/10 with a crystal with with an external oscillator input. That means that not only do you have to have a crystal, you need an oscillator for it too. So suddenly you're either adding another chip to the board or upgrading the crystal to a self-contained oscillator. <sad trombone/>

    Well, set aside that for a moment. PB1 is the CLKI pin, and it's also OC0B. Can we get the PWM signal we want just using OC0A? Well, fortunately Fast PWM mode (0xe on the WGM bits) defines the TOP is ICR0, and you can use OCR0A as a compare match.

    The ADC has only an 8 bit resolution, but even using that entire range would give us 1/4% resolution, which isn't different from what we can get with the Tiny85's 8 bit PWM timer. The Tiny10 can do 16 bit PWM, which would let us be much more granular (which we don't really care about).

    Programming would also be interesting, because the TPICLK pin is also the CLKI pin, so you'd need to isolate or turn off the clock during programming. One answer there is to get an oscillator with an enable pin and add a jumper for that you can temporarily close during programming.

    That, and all I have on hand are Tiny9s, and they don't come with an ADC. I'd have to buy some Tiny10s. Everybody and their brother is out of stock on them, but DigiKey expects a shipment of them "any day now."

    So I might wind up trying it anyway, just for completeness' sake.

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates