J1772 Hydra

Charge two electric vehicles at once

Similar projects worth following
I became a Maker shortly after I got my first Electric Vehicle. I was a HeathKit kid back in the day, but wound up doing software because I saw surface mount as The End of the home hardware hacker. Turns out I was wrong, but that's another story. My EV led me to discover OpenEVSE, which led me to Arduino, and then to EAGLE and OSHPark and the rest is history.

I got the EV because there were charging stations (EVSEs) at work. But they were oversubscribed, and frequently used at only half their capacity (most public EVSEs are capable of 6.6 kW, but most older LEAFs and all current PHEVs only charge at 3.3 kW). The Hydra was born from a desire to allow these EVSEs to be used at their full capacity.

It would be easy to build a box with a J1772 inlet and two plug/cable sets, but I wanted to come up with a solution that was safe and as compliant with the relevant standards as it could be. The Hydra is the result.

There are two variants of the Hydra. One is the "splitter" variant. It has a J1772 inlet and two plug/cable sets. It was the original version of the Hydra. The other variant is the "EVSE" variant. It trades the J1772 inlet for a simple AC power cable. To be compliant with the standards, the EVSE variant has a GFCI for safety (the splitter doesn't because the host EVSE is assumed to have one). The EVSE variant also has a clock/timer chip and the firmware has an event system to facilitate allowing EV charging to happen only when electric rates are lowest.

Both variants offer two different operating modes. In "shared" mode, the rules are that if both cars are requesting power, each will be allotted half of the power available (the available power is indicated by the host EVSE for the splitter variant, and is a user configuration parameter for the EVSE variant). When one car finishes (or if only one car is connected), then that car is allowed full power. In "sequential" mode, only one car is allowed to charge at a time. When the charging car finishes, the opportunity to charge will be offered to the other car. The benefit of the Hydra is that the plug doesn't have to be manually moved from one car to the other (potentially at 2 AM for ToU charging).

Sensing the amount of available power (for the splitter variant) and informing each car of the available power is done via a signal wire within the J1772 cable called the "pilot." The EVSE indicates its availability by presenting a +/- 12 volt 1 kHz square wave on the pilot line with a 1 k-ohm impedance. The duty cycle of the square wave is the indication of the ampacity of the EVSE. The car accepts this offer by loading the pilot line with a particular resistance value in series with a diode to ground. The two most common resistor values are 2.7 k-ohm and 882 k-ohm (or 1.3 k-ohm in parallel with the 2.7k-ohm). The 2.7 k value indicates the presence of the vehicle. It will bring the 12 volt pilot down to 9 volts (due to the 1 k source impedance). The diode will prevent the resistor from impacting the negative portion of the square wave, which will remain at -12 volts. This is an important safety feature that allows the EVSE to distinguish between a vehicle and a bucket of salt water that has JUST the right resistance. Adding 1.3 k-ohms in parallel with the 2.7k will drop the voltage down to 6 volts. The host EVSE monitors the voltage of the pilot output to detect these state changes from the vehicle and turn the power on and off.

The UL specifications for charging stations require a number of safety systems, and the Hydra makes every attempt to include them all. These include:

  • A GFCI circuit - stops charging instantly if residual current leakage is detected in excess of 20 mA. This is present only on the EVSE variant (the splitter variant relies on the presence of a GFCI in the host EVSE).
  • A ground impedance monitoring system - stops charging if current flow to the system ground is not possible, or excessive impedance is detected.
  • A relay status test - checks to insure that voltage is present on the J1772 output side of the contactors if and only if the contactor is actively engaged.

The instructions here are for both the version 4.x Hydra EVSE and splitter variants.

Theory of operation

Follow along with the schematics in order to see what's going on. Each section will reference a different page of the schematics

HV board

The HV board has 4 jobs:

  1. Provide 12 VDC power for the logic/display board
  2. Perform a GCM (ground continuity monitor) test to insure the path to ground is functional.
  3. Perform a relay test to insure that there is power on the load side of each contactor if and only if that contactor is engaged by the firmware.
  4. Switch the contactor power on and off for each car.

The 12 VDC power is provided by an isolated power supply module. It can provide up to 250 mA at 12 volts, which is plenty.

Most of the remaining functions of the HV board are centered around an LTV-824S dual AC input opto-isolator....

Read more »


EVSE variant logic/display board schematic.

Adobe Portable Document Format - 90.78 kB - 01/02/2016 at 21:33



Splitter variant logic/display board schematic.

Adobe Portable Document Format - 92.63 kB - 01/02/2016 at 21:33



HV board schematic

Adobe Portable Document Format - 39.43 kB - 01/01/2016 at 18:14


  • 1 × Power distribution block Cooper Bussmann 16220-2
  • 1 × 3 x 8 AWG SOOW cable - 4 feet Available from Home Depot.
  • 2 × Current Transformer CR Magnetics CR8420-1000
  • 2 × Current Transformer - GFI CR Magnetics CR8420-1000-G
  • 1 × Water resistant, lit button Available from AdaFruit or the OpenEVSE store

View all 17 components

  • State of the Hydra update

    Nick Sayer11/12/2017 at 20:03 0 comments

    I've been almost totally dedicated of late to other projects but I'm going to try to come back to the Hydra now.

    One thing I discovered not too long ago was that the triac was previously wired wrong. It turns out that triacs are not actually unpolarized devices, at least from the point of view of the gate. The gate needs to be taken towards the opposite main terminal to switch it on, and when the triac is on, the voltage across the main terminals will be near zero (because the triac is conducting), which dramatically reduces the current through the other components involved in triggering. Oops.

    So the AC board's contactor drivers work a lot better now. I'm going to keep using the half-watt components just to be sure.

    One of the fellows who bought a Hydra board set (I won't name him just because I haven't asked his permission first) has contributed to the firmware development in a big way, and a lot of his changes are going to make it back in. This will include some self-tuning for the RTC chip's trimming register (if you set the clock when it's wrong it will get better). He requested an i2c header for the board to add the ability to add off-board sensors, such as temperature sensors and the like. We'll see how much more we can cram into the firmware now that some of the space has been reclaimed by cleaning up and de-duplicating.

    What remains is the continuing difficulty with the relay test. To recall, we want to strategically set up a small leak from the relay test pins to ground and measure the current flow. When the relay is open, there should be no current flow, and when the relay is closed, there should be some. But for safety reasons, it's undesirable to leak more than 1 mA of current, but our detection threshold needs to be 24 kΩ. I think the solution is going to wind up involving an isolated power supply. A small 12VDC -> 5 VDC isolated module would work. The idea would be to set up a voltage comparator across a resistor in the leakage path, and then run the output through an optoisolator with the optoisolated output going back to the controller.

    I haven't sat down to figure that one out yet. I think the challenge is going to be to make it work without dramatically increasing the size or price. We'll see.

  • PT7C4311WEX accuracy redux

    Nick Sayer02/21/2016 at 06:48 0 comments

    I finally had a chance to perform the calibration testing for the clock.

    Stumbling block number one... the FT/OUT pin of the chip is an open drain, meaning you have to pull it up to actually get to see the square wave. Grumble. I was able to hack this up, but it was painful, so the next version of the board will actually add the pull-up resistor and have a calibration test pin for convenience.

    Stumbling block number two... The default value for the calibration register, it turns out, is +31, which ostensibly makes the thing run 124 ppm fast. So no wonder the Hydra clock has been all over the place before now.

    The good news is that the crystal I'm using, with the 8 pF loading caps, results in two board sets so far that have been inside of 10 ppm. Both are slightly slow - one 5 ppm, the other 1 ppm.

    I've had to customize the DS1307 RTC library that plugs into the Time library for Arduino. I haven't done it yet, but I'm going to need to fork the library for the Hydra so that others can build the same firmware. I've also made a bug fix for the time-setting code. The original code attempts to or the seconds with 0x80, but then the write() method converts the value to BCD, which means 0x80 isn't going to stay 0x80. The new method simply writes 0x80 into the seconds register in the first pass, then writes the seconds by themselves in a second pass.

    Anyway, if you've got a EVSE variant Hydra, your real-time clock is probably whacky. You probably want to update your firmware.

    UPDATE: My pull request to the DS1307RTC library was accepted, so you don't have to take my private fork any more! Yay!

  • A slight parts adjustment

    Nick Sayer02/15/2016 at 23:48 0 comments

    Our home Hydra EVSE failed this afternoon for the first time in as long as I can remember (don't let that fool you. It has failed before, it's just been a while, and not with the current revision). The plug for my eGolf started throwing error F, which indicates a ground failure. To recap, the current hardware has a GCM circuit tied to the load side contactor terminals. When the contactor is off, there should be no current, or it's a stuck relay. When the contactor is on, there should be current flow, or else it's a ground impedance failure. The latter was what was being indicated. Watching more closely, it was easy to tell that what was really going on was that when the contactor was being turned on by the logic board, there was no characteristic "kerthunk" indicating that it actually did it.

    I sort of should have seen it coming. The eGolf exercise the EVSE's contactor far more than is necessary. In fact, the eGolf's charging system is the flakiest and most finicky I've encountered so far (and I've encountered quite a bunch more than I've actually owned). Most notably, in the morning when it's time to leave for work, you have to click the key fob to unlock the plug-lock. When you do so, the car turns on the power. There's absolutely no reason for it to do so, since the batteries are all charged, and the climate control warm-up has already concluded. But that's what it does. Then it unlocks the plug lock and when you remove the plug, it turns the power off.

    That's a lot more contactor play than average. What failed was R6 - the 150 ohm resistor connected to the driver triac. It blew open. When I got it out of the circuit there was nothing obviously wrong with it on the outside. But it measured completely open. Replacing it brought the Hydra back.

    This suggests that that component needs to be made beefier. I'd been using ordinary 1/8W chip resistors from a reel, but it looks like the thing to do is use a 1/2 watt part. Fortunately, DigiKey has 'em. While I'm at it, I'm going to use 1/2 watt for the 2.4K resistor in the HV triac circuit too. That means 1/2 watt parts all 'round (the 39 ohm resistor in the outer snubber already has been upgraded).

  • PT7C4311WEX accuracy

    Nick Sayer02/12/2016 at 06:55 0 comments

    With the proper loading caps, the PT7C4311WEX accuracy is better, but not as good as I'd like.

    The solution is to set the calibration register. The mechanism for doing so is to set the FT bit in the config register and then measure the frequency on the output pin (which on the Hydra is not connected) with a GPS-locked frequency counter to see how far away from 512 Hz it is. From that, it's possible to work out the correction factor to apply at startup.

    The Hydra EVSE doesn't really have enough space left for more features, but it does have enough space to poke the calibration value in to the RTC. Storing the calibration value in EEPROM in the controller is a safer place than in the RTC chip, since the contents of the RTC are lost when the battery dies (or is changed).

    A special sketch can be loaded to turn on the test frequency output for measurement. Once the calibration value is determined, it can be written into EEPROM with avrdude. If you set the EESAVE fuse, then this value will be stored permanently across code updates.

  • The tale of the cursed logic board

    Nick Sayer01/02/2016 at 21:03 0 comments

    I built the latest version of the EVSE variant logic board two days ago. What a pain in the ass that turned out to be. I only just got everything working (I think).

    I discovered quite a few issues:

    1. DirtyPCBs' soldermask aperture doesn't always put soldermask between pins. Particularly on fine pitch parts, like TSSOP6 MOSFET arrays. This causes painful games of "find the short." On the other hand, OSHPark doesn't e-test. This can also cause painful games of "find the short" (though not frequently). Pick your poison.

    2. I think that the pilot generator was causing transients on the power. The secondary MOSFET pair for each has a resistor from source to gate to hold the MOSFET open, and then a resistor from the gate to the primary MOSFET to close the MOSFET when desired. The initial values were 10k for the hold-open resistor and 0 for the close resistor. It turns out that resistors cause things to slow down. Having 0 for the closing resistor and 10k for the opening one meant that both MOSFETs were turned on very, very briefly before the opening resistor could raise the voltage on the turning-off MOSFET's gate. The new values are 4.7k for the opening resistor (source to gate) and 10k for the closing resistor (gate to primary output). This appears to work perfectly, and the rise and fall times are still well inside of the 2 µS mandated by the spec.

    3. Because of the power transients I was investigating the DC-DC converters. I switched to a new filter cap for this board and thought it was causing problems. In screwing with it, I made the +5 supply filter cap's negative connection get flaky.

    4. It turns out that LM358 op amps don't like having high impedance loads when used as a comparator (that is, with no feedback). This caused the GFI circuit to not work. I tacked on a 20k impedance load on the output, but the next board design will have a 10k loading resistor.

    All of that done, it appears to finally be working properly.

  • GFI and GCM interactions

    Nick Sayer03/25/2015 at 06:09 0 comments

    The recent addition of the GCM test and the UL mandated "just in time" GFI self-test just before turning the power on to the EVSE variant has caused a little bit of havoc with the GFI.

    As a result of this, the standard design has changed to include a separate GFI coil for each car. The self-test wire takes one wrap around each coil - which means that the wire passes through each coil twice. That should mean that the fault current from both coils would be required for the self-test to trigger a fault and therefore pass.

    The two coils are wired in parallel. The current sensed by each is effectively summed and fed into the burden resistor and the rest of the GFI sense circuit.

    Placing the GFI on the load side of the contactors will guarantee that the GCM leakage current has no impact whatsoever on the GFI.

  • UL compliance?

    Nick Sayer03/21/2015 at 14:24 0 comments

    I inquired once of UL what it would take to have the Hydra UL approved. Their reply was that the "initial engineering consultation," which likely means I send them one and they destroy it and send back a list of what's wrong with it, would cost US$10,000. So a full UL approval, by my estimation, would be Tesla money.

    So it's not happening.

    But friendly birdies have supplied me with a few insights into the process for an EVSE.

    One fall-out from that is that the current design won't do.

    The GCM test is fine, but surprisingly enough, the relay test is the problem. UL is concerned about situations where one pole of the relay/contactor gets welded shut and the other stays open. The current design doesn't catch that.

    So the design is going to morph back to something similar to the very first design I had a while ago, which yielded a combined GCM and relay test.

    Two diodes from each hot line have a common cathode. That cathode runs to the current GCM test circuit unchanged. Repeat that for each car. In the firmware, if the car is shut off, then the relay test line must be low or it's a stuck relay failure. If the car is turned on, then the relay test line must be high or it's a GCM failure.

    What concerns me slightly is that compound failures would not be detected. That is, if you have a stuck relay *and* no ground connection, then that's not a failure until you attempt to start charging. Meanwhile, you have an energized J1772 plug and the user is not alerted. To be fair, though, with the current design, the behavior is the same if only one pole is welded.

    One other problem has surfaced as well - one person who's built their own Hydra has reported GFCI problems. It's occurred to me that the GFI is *before* the GCM, which results in the GCM current adding sensitivity to the GFI. Now, it's only 1 mA of current - not even enough to set off a household GFI outlet - but it's something I didn't think needed to be taken into account. The difficulty is that the GFI coil is physically so small that trying to cram both cars' hot lines through wouldn't be tenable. The only alternative to that is doubling the GFI circuit so that each car is independent. I can only hope that won't be necessary. It should be noted, however, that he's only having this problem with a BMW i3. His other car - a LEAF - is fine. So it's just a border condition, not something pathological.

    So there will need to be another revision of the HV board with the new combined relay/GCM test. The de-sensing of the GFI merely requires swapping out a resistor on the board, so that's no big deal.

  • It's not just me

    Nick Sayer03/13/2015 at 02:18 0 comments

    For the first time, I can actually confirm that someone besides myself has successfully constructed a Hydra.

    I won't say who, because I didn't ask him first, but I've sold two board sets from my Tindie store, and one of them (so far) has reported he's successfully constructed his Hydra.

    I'm going to put together a Splitter variant board this evening possibly for a fourth unit to go where I work. The company has graciously funded construction of three Hydras to allow the charging resources that we have to be fully utilized (without them, PHEVs and 1st generation LEAFs would only use half of the capacity of a single charging station).

    Meanwhile, this weekend I am going to upgrade the Hydra EVSE variant we have here at home to the latest v4 board set and contactors to replace the 12V relays that it currently uses.

View all 8 project logs

  • 1
    Step 1

    First, start by preparing the outer chassis. Remove and set aside the lid. Select one of the two short sides to be the top. This side will receive the button for the user interface. The opposite short side will receive either the cable gland for the AC supply cable (for the EVSE variant) or the J1772 inlet (for the splitter variant). The two long sides will each have a cable gland for a J1772 cable for each car.

    The button hole is 5/8" and should be simply centered on the top side. For the two J1772 cables, you want each to be centered vertically between the back and the front, and as close to the bottom "rib" on the inside of the chassis as you can. The easy way to do this is to take the outside diameter of the cable gland, divide it by two, add a quarter inch and measure that distance away from the rib and mark a vertical line from the back to the top edge of the chassis. Drill the appropriate size hole for the cable gland centered on that spot.

    If you're building the EVSE variant, then center a hole for the AC cable gland in the bottom side of the chassis. If you're building the splitter, then you want to mount the inlet as close to the top edge of the chassis as possible, but without extending past it. Even if you're careful to do to, you may find that the mounting hardware hits or gets in the way of the internal mounting plate. If that happens, you will need to cut relief notches in the mounting plate.

  • 2
    Step 2

    Prepare the button by connecting three wires to a 3 pin .1" female SIP header. The center pin should be red, the outside pins green and black. The button will have 5 terminals on it, marked +, -, C (or COM), NO and NC. Connect the red wire to the + terminal, the black wire to the NO terminal and the green wire to both the - and the C (or COM) terminals. Set the button aside for later.

  • 3
    Step 3

    Prepare the internal mounting plate. You will drill holes to mount the two contactors, the power distribution bus, the ground bar and the standoffs for the boards.

    The plate can be divided logically into the top and bottom half along the center, which is defined by the two half-moon cuts that accommodate the center ribs on the long sides. The top half (where the button will go in the chassis) will take the logic and HV boards, one above the other. The bottom half will get the ground bus, the power distribution module and the two contactors.

    The power distribution module is mounted centered horizontally, flanked by the two contactors. The two contactors should be mounted as close to the center as possible to allow room for the J1772 cables to enter via their glands below the contactors. The distribution module should be mounted towards the center as well to allow room for either the inlet and its wires or for the AC cable gland and the GFI coil. Mount the contactors first and the distribution module second. This makes it easier to get to the screw holes at the base of the contactor since the distribution module will be in the way if it's mounted first.

    The ground bus should be mounted in an out-of-the-way spot below one of the contactors, making sure that it will be easy to route the three main ground wires (each J1772 cable and the inlet or AC ground) to it, but that it won't be anywhere near any of the contactor, inlet or HV bus terminals.

    Using either of the two PCBs as a template, mark the four corner holes in the top half. The boards should be centered in the available space, but at least an inch and a half away from the top edge (to leave room for the button). Drill 1/8" holes to accept \#4 hardware. Attach a 1/4" \#4 M-F hex standoff in each hole, securing it on the bottom with a lock washer and a nut. Place the HV board on top of the standoffs, with the 5 screw terminals towards the bottom. Secure the HV board in place using the longer \#4 M-F hex standoffs.

View all 8 instructions

Enjoy this project?



Lance wrote 07/01/2018 at 19:36 point

Hi Nick, just wanted to check in and say that I finally built my Hydra EVSE variant.  It appears to be up and running.  A few of the hookups were a bit confusing because the silkscreen on the logic board was partially covered up by the connector, or the pictures or didn't match the instructional text exactly.  The GFI circuit is one example.  It wasn't clear which pin corresponded exactly to which wire.  Looking at your pictures, in one example you had a red and 2 black wires (IIRC) and in another a green, a BLUE and a red.  Going with the latter picture, I connected them in this order (L to R):  Green, Black, Red and all is well.

BTW, my splitter variant ended up failing on one of the outputs.  The contactor would audibly close, but the car didn't actually draw any current.  I suspect some kind of a pilot issue, although I did check the connections and couldn't find a fault there.  Anyway, I stopped using it because a splitter with only one output is kind of useless.  Plus a change in commutes and vehicles (I upgraded to a 30kWh LEAF) changed our charging habits such that we could effectively plug share a single EVSE.  But I am about to sell my LEAF and with it will go the 240V upgraded portable EVSE.  It's being replaced with a Tesla Model 3, which could work fine from a NEMA 14-50 using the UMC, but that would leave my wife's Volt charging at 120V, so it was time to build the Hydra EVSE.

Anyway, thanks again for the great work on the project.  Looking to get a lot more use out of it.

  Are you sure? yes | no

Lance wrote 03/16/2017 at 14:04 point

Hi again!  We recently moved to a new house.  I left my old EVSE at the old house and for the time being I have been using my 240V upgraded Nissan portable EVSE as the host EVSE (I am getting ready to build the standalone version of the Hydra so this is only temporary).

I have noticed that my Hydra goes into PAUSED state several times during charging.  Examining the code it appears that the incoming pilot signal indicates less than 12A and causes the Hydra to turn off the pilot signals to any cars that are charging.  I suspect this might be happening because even though the portable EVSE was upgraded to handle 20A operation, it does get warm during use and perhaps it is throttling back (but not completely turning off) its max current briefly (usually the unit comes out of PAUSE after a few seconds and charging proceeds).  The problem is that my wife's Volt does not like this very much.  She gets an error message that charging was interrupted on her console the next morning.  Not to mention that we both get texts from our cars when charging is interrupted in this fashion.  It's not a severe error really, but to my wife any error message is severe.

So my comment:

When I use just the portable EVSE without the Hydra, charging is not usually interrupted on either car.  I wonder if the portable EVSE throttles back to between 6A and 12A, but Hydra gives up at 12A because it thinks it needs to be able to split the power.  However, if only one car is plugged in and actively charging, it really could go down to 6A.  Wondering if some logic could be added to handle this case.

  Are you sure? yes | no

martin.polak wrote 10/19/2016 at 11:46 point

Hi Nick, would you mind uploading a drawing of the wiring for the GFI detect and the relay test? and also which wires connect where on the HV board?

Another thing: is it ok, that the hex spacers are made of metal and thus connect display board ground to AC board ground to the metal plate in the housing (which should also be GND)

  Are you sure? yes | no

Nick Sayer wrote 10/19/2016 at 15:28 point

The relay test is quite simple - just wire the load side of the contactors to the relay test inputs on the HV board. 22 gauge wire will do - it's not high current. There are 5 connection pairs on the HV board - AC in, contactors A and B and relay test A and B. The contactor connectors go to the contactor coil. The relay test wires go to the load side of the contactors. There's no polarity on either - just make sure relay test and contactor A both go to one contactor and B to the other.

The GFI system is a little weird. The two GFI coils are wired in parallel. For best results, they should be wired so that their directionality is the same. So if you have them oriented the same way, then connect the two "lefts" together and the two "rights" together. Select one side of the coils to be ground. Connect the test wire up to that ground point and then pass it through one of the coils twice, then through the other coil twice. That wire connects up to the "test" pin on the GFI connector. The coil wires that are connected to the other end of the test wire go to the "ground" pin on the GFI connector. The remaining pair of coil wires go to the "GFI" pin on the GFI connector. The idea is that the controller will pulse some 60 Hz 5VDC current through the test wire and expect to see a GFI interrupt as it does so. If that doesn't happen, it's a test failure.

Metal hex spacers should be fine.

  Are you sure? yes | no

martin.polak wrote 08/19/2016 at 17:35 point

Hi, I'm really glad I found that project - exactly what I've been looking for ... but without having to hammer my own head for a great solution :-) couldn't resist to order one across the big pond!

I just wanted to understand a bit more on your design considerations:

- why did you pick HV controlled contactors instead of DC 12V coil ones? Shouldn't those be easier to drive from the ATmega?

- have you also considered an ACS712 (Hall sensor) based current measurement instead of transformer based one?

- do you have any plans about expansion on the controller end: like ESP8266 Wifi, RFID card reading

  Are you sure? yes | no

Nick Sayer wrote 08/19/2016 at 18:22 point

I chose contactors because it was much easier to find high current UL registered contactors than relays. My OpenEVSE II project has HV boards that can operate relays instead of contactors, but that's necessary for a unit that can work at both L1 and L2. There's generally no purpose to build an L1 Hydra. 

I've not considered expanding the feature set of the Hydra as at the moment the flash space is almost exhausted. I have a design on paper for a board with a bigger controller (ATMega644 perhaps), but haven't really had much incentive to go that route. 

  Are you sure? yes | no

Nick Sayer wrote 08/19/2016 at 18:24 point

I haven't tried using other than CTs for current sensing, as the CTs seem to be good enough. It's not really "revenue grade" sensing, really. Just a convenience so you can see what the cars are doing. 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

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