Open Source Electric Vehicle Charging

Electric vehicles are becoming more and more common on the road, but when they’re parked in the driveway or garage there are still some kinks to work out when getting them charged up. Sure, there are plenty of charging stations on the market, but they all have different features, capabilities, and even ports, so to really make sure that full control is maintained over charging a car’s batteries it might be necessary to reach into the parts bin and pull out a trusty Arduino.

This project comes to us from [Sebastian] who needed this level of control over charging his Leaf, and who also has the skills to implement it from the large high voltage switching contactors to the software running its network connectivity and web app. This charging station has every available feature, too. It can tell the car to charge at different rates, and can restrict it to charging at different times (if energy is cheaper at night, for example). It is able to monitor the car’s charge state and other information over the communications bus to the vehicle, and even has a front-end web app for monitoring and controlling the device.

The project is based around an Arduino Nano 33 IoT with all of the code available on the project’s GitHub page. While we would advise using extreme caution when dealing with mains voltage and when interfacing with a high-ticket item like an EV, at first blush the build looks like it has crossed all its Ts and might even make a good prototype for a production unit in the future. If you don’t need all of the features that this charging station has, though, you can always hack the car itself to add some more advanced charging features.

26 thoughts on “Open Source Electric Vehicle Charging

  1. I was going to jump on this guy for not including a GFI in his design, but his project page does say he’s plugging into a GFI protected circuit.

    However, I also don’t see any GCM in his design, which is another important safety feature in an EVSE given that the vehicle is always sitting on four rubber tires.

    I strongly urge folks who want to DIY an EVSE to at least look at OpenEVSE, the granddaddy of them all, and at least understand the purpose of all of it’s safety features. OpenEVSE derived designs have obtained UL approval.

    1. i don’t see any difference between sitting on 4 rubber tires (a car) and sitting on a nonconductive wooden floor (my washing machine), so one of GCM or GFI seems like it would be sufficient. but i’m not really here to opine on that…i wouldn’t claim expertise here. really i guess it makes me wish my washing machine had GCM.

      i’m here because this is the first i’ve heard of GCM. how’s it work for a car? does it have two different ground pins that are supposed to be connected to different points on the chassis and it checks continuity between them?

      thanks

      1. GCM is Ground Continuity Monitoring. It fits hand-in-glove with GFI. If there’s no good ground connection to the frame of the vehicle/appliance/whatever, then the GFI can’t detect a residual current until – for example – a user is being electrocuted by completing the circuit to ground.

        For your washing machine, it’s at least conceivable that if the grounding conductor of the power cord fails, there might still be some path to ground through the water supply, and therefore the GFI it’s plugged into might trip.

        1. Oh, I didn’t say how GCM works. A GCM actually measures a very, very small (and limited) current to ground to insure that it’s possible. In my design for the J1772 Hydra and for OpenEVSE II, that current is limited to 1 mA, but if the ground isn’t good enough to allow that 1 mA to flow, then it’s a failure and charging stops.

          1. where do you do the test? what is the length of the loop that it tests? on the one hand, it needs to know that the ground gets all the way to the chassis. and on the other hand, if it isn’t, in the failure mode it needs to cut off hot before it gets outside of the wall-mounted box. i’m not coming up with a way to solve that without a dedicated return pin or similar.

            anyways, i didn’t want to believe running current on ground is how it works, because of the problem Bill describes just below this reply. your GCM is opposed to your GFI. you say they go well together but they’re apparently mutually sabotaging. for something with a metal chassis, i’d probably prefer GCM to GFI but the two together is obviously toxic. some people will find that it triggers their GFI and to get around that they will bypass their GFI.

            i like the idea of GCM but if it’s gonna be forcing the end user to sabotage their GFIs, it’s a non-starter to me.

            i was hoping it was something actually good, like a startup or periodic check where it disables all power output, performs a ground test, and then enables power only if it passes. that won’t catch a sudden fault but it could be pretty bulletproof to an unchanging open connection anywhere in the circuit, and it wouldn’t fight the GFI. the system you’re describing…let’s just say, i wouldn’t shame anyone for leaving it off!

            but of course reality is a set of compromises…

          2. That’s why the GCM and GFI belong in the EVSE – so that the GCM can be placed before the GFI detection. You shouldn’t plug an EVSE into a GFI protected circuit not only because of the GCM, but because the GFI tolerances for an EV (per U.L. spec) are higher than for a household GFI outlet.

        2. > the GFI can’t detect a residual current until – for example – a user is being electrocuted by completing the circuit to ground.

          GFI do more here in Canada, even without a ground wire. Quite some time back, GFI changed to GFCI, and triggers off on more than just stray current on its ground. Every GFCI I’ve seen for over a decade had the usual to detect stray current flow to its ground, but also a coil on each conductor (here, Live & Neutral). An imbalance in the current of those two would also trigger a fault, to cover where the outgoing current doesn’t return to the GFCI, as a defect has provided another path. As such, a GFCI in older buildings where wiring & receptacles do not have a ground will have the GFI detect the imbalance when current finds a different path to ground. (Like the one protecting my aquarium, which has snapped off twice; two skimmers that had pumps that faulted.)

          Note that where you have multiple devices “protected” by a single GFCI, you can have a fault in one device complete the circuit into another device on that GFCI in a manner that the in/out balance in the GFCI is maintained and no fault is detected. Each device should have its own GFCI to prevent that.

          1. GFCI aka conservation of energy violation detector/resolver
            “25 milicoulombs went through wire A and didn’t come back through wire B or C! Energy is not being conserved, panic, shut it down!”
            Sounds like something black mesa ought to have until you realize that the wires arent galvanically isolated and current can flow out “other ways”

          2. Hi guys,

            This debate can continue forever bringing arguments on each side. My opinion WITHOUT any intention to go into a debate is that you can protect the user via RCD/GFI method without any issues if you keep your values @ <30ma / <40ms reaction time using a reliable and well proved method. On another hand a "newer" system GCM will help you detect if you loose the ground connection and is nothing new here being used in industry as a method in the IT systems(or floating) by Continuous Ground Monitoring Devices, but again is not necessary since user is protected by RCD/GFI; moreover as Greg mention you can do that only on the charger side car not being covered (you will need one more ground wire which will complicate the design and charging standards) so with other words GCM is checking only if you are connected to wall socket ground assuming the ground path to car is healthy.
            At this point I agree to Greg in my opinion Nick is trying to boost up his OpenEVSE project ($$$ :)) ) with a note that EV manufacturers are providing this feature with their chargers(I've tested BMW and VW newer ones and they have it)but again is just ticking a box feature, It will depend on user what he want to have …

            As another note, the author is not happy with voltage readings via small VT's. I did not try yet the project but I'm already using 3PH power measuring on my Solar inverter+ grid power( 9 phases total) and is working perfect (using 220/10V VT's ) The trick is in calculation algorithm, I doubt is EV RFI since my 12KW inverter will be there as RFI levels.
            This summer I will try to do my own design planning to have: RFID , local OLED and WIFI connectivity (not for WAN so I need to dig more to see what servers I can use if MQTT? ones still free or maybe my own? ) I have some holes on the APK part so….ANYOANE ON BOARD?? :)

            I would like to thank booth authors for their work on the open projects; this will help me since I will not start from scratch.

            Regards,
            Dan

    2. Nick,
      Bryan is Norwegian , GFI is an obligation, like in EU.
      https://dehnes.com/electronics/2021/03/31/dehneevse_charging_station.html
      The NL210 63A (bottom left on the box) is a GFI, with high immunity, high frequency immunity, and DC immunity , like server protection or inverter, is a very good choice. This is realy safe.
      Ground continuity monitor, is not an obligation in EU. The cause is the type of grid. All EU contry have the same neutral point treatment. But is probably more safe.
      For EU standard, We must have one terminal Yellow/Green on the box. for all cables Y/G. I think you can see that one the second photos. The continuity of G/Y is very importante, because your system can’t be class II. (your car is class II.)
      Bryan, please add a photos and a diagram for security, with your neutral point treatment.

      1. I’m an electrical inspector, this is real, please save your life.

        This electrical Schematic is only for EU, with a TT network. 3 phases 240V between phases and neutral.
        Please see this page : https://en.wikipedia.org/wiki/Earthing_system

        And all parts must be connected directly on ground. with more than 16mm². The rsistance will be R = U / I = 50 / 0,03 = 1666 ohms
        U = 50V (security voltage for human, be careful for other animal like cow…)
        I = 0.03A (GFI valu)
        R = test your ground value, the value must be are <1666 ohms (genealy is 100 ohms )

        @Bryan : your cable is to small, you must use 16mm² with 63A/Ph, or justify your choice (this is possible with the shortes cable on a box, but I prefered that you used 16mm², please).

        Ok this is a good project, but this is dangerous, please contact me, we must be changed some wires and or protection.
        Sorry for the hype

        1. This is the kind of comment I expect from pro on Hackady, bringing productive and sounded critics and not acting like an arrogant douche who despise DIY stuff.

          Thank you David.

    3. Thank you! I came here to say essentially the same thing. The cost of messing up is pretty high – property damage or ultimately it could be someone’s life. Don’t attempt the project unless you have the training and skill.

      Ironically the Clipper Creek EVSE cord provided with my Chevy Bolt apparently has a GCM (ground continuity monitor) circuit, and the test current intentionally leaked into the ground conductor caused imbalance that kept tripping the 120 Volt GFCI socket in my garage almost every day. I never had that happen with the EVSE cord that came with the LEAF I previously had.

      The Clipper Creek EVSE is max 12 Amps, but it can operate at either 120 Volts or 240 Volts, so I had a 240 Volt dryer outlet installed in my garage and made a pigtail so I could plug in the EVSE. The car charges a lot faster and the i squared R loss is approximately constant (*) in the house wiring + EVSE because i=12 at either voltage. There is an overall several percent gain in efficiency because the power is wasted for less time charging at 240 Volts. The charger inverter in the car is also a little more efficient with higher voltage input too.

      (*) 12 AWG wire is ~1.5 Ohms per 1000 feet. My garage is detached, so there is about 200 feet round trip from the breaker panel. At 12 Amps, that means I’m burning up 43 Watts in the house wiring. The dryer plug circuit is 40 Amp and wired with 8 AWG which is ~0.6 Ohms per 1000 feet. I’m only burning up 17 Watts in the 8 AWG wire of dryer circuit when the car charges at 12 Amps.

      1. GCM’s impact on GFI sensitivity is why, in general, your EVSE should have it’s own GFI (and test for residual current *after* the GCM) and should be on a circuit that does not have it’s own ground-fault protection.

        It’s also why I designed the Hydra and OpenEVSE II to use a 1 mA GCM. But even then, the UL standard for EVSE GFI sensitivity is more like 17 mA, which is (I believe) somewhat higher than the standard for normal house GFIs. So you may find more nuisance tripping, depending on the car (after all, the “battery charger” is actually a part of the car. The EVSE is nothing more than a complicated power switch).

        1. Oh, I saw your Pi EVSE hat but didn’t realize you also had the OpenEVSE II…

          I’ll have to take a look at that later this year. (I’m considering either that or the Pi hat for a project…)

          Interestingly, the standards for DC fast charging also have provisions for “smart” AC charging using HomePlug GreenPHY – have you done any experiments with that? Do vehicles that support CCS also support using HPGP/ISO 15118 for AC control? Or is AC control via 15118 in the category of “someone standardized it but zero implementations exist”?

          1. 15518 fort AC is real, but nog het in widespread use. The ‘killer’ feature IMO is plug and charge and more granular charging control.

            ID.3 has it AFAIK.

            Disclaimer, I work for EVBox.

          2. I’m really happy with the hardware on the EVSE hat, but I personally don’t have a use for it, so I haven’t sat down and written software for it. I was sort of hoping that a user community would gel around the platform and do it for me. :D

    4. I won’t argue on safety requirements, but I don’t think a 2nd PE wire would be necessary.
      As I remember correctly the PP and CP (pilot and control pins, that are used as communication between the EV and wallbox) use the PE as ground.

      A PE fault will therefore result in no communication and thus no charging/opening of the mains contactor to the EV.

      That’s at least what I remember from designing a few charging cables for a commercial wallbox.

  2. OpenEVSE has all these features (with an open API I believe), and has had a lot more safety features baked into it as well. I don’t want to disparage another DIY open source EVSE project just because something more fully featured exists, but the stakes of messing up are just high enough here that I’d think twice about regularly using something like that without having a lot of thought put into the safety of the system and its expected failure modes.

  3. The other thing I’ll rather strongly recommend is that if you DIY things that handle dozens of amperes of current, you should make the lid of the box transparent and *regularly* inspect the wiring for signs of heating or degradation or what not. Heat damage from high current is a positive feedback loop and can easily result in a fire.

  4. I really wanted to build an OpenEVSE but then the car arrived so the next best thing was a Wallbox Pulsar Plus which has a RPI compute module. Once the warranty is up, I’m going to take over the compute module. For now though there’s an easy to use API which is undocumented but very easy to sniff using the web portal. I’m controlling charge current, lock/unlock unit and pause/resume based on my elec tariff (Octopus Go) and surplus solar (changing the charge rate to the lowest to ensure max solar ingestion).

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.