EV Charging Station - Part I

If you bought a smart device recently you probably ended up with a custom app on your phone thinking ¨Yeey! Another app!¨. Maybe you were being cynical, maybe not. Maybe you ended up staring at the app wondering ¨why can´t I do this or that?¨ Maybe you woke up in the middle of the night beaded in sweat ¨what if the vendor pulls the plug of their platform? can I still use my device¨? Or maybe you just wanted to integrate it with something else and figured out this isn’t possible until you hack something together with the risk of getting jailified (to be complete, in the end they cancelled the take-down).

With most off the shelve EV chargers things are no different having a trade-off between looks, functionality, integration and price. How nice would it be to just have a charging station that can either work standalone OR be integrate with an automation system of choice via an API, without any mandatory stuff that keeps you depended on the vendor, looks good and is reasonably priced? Could this be economically possible? Could it even be technically possible? Isn´t a charger a big magic box full of electronics depending on a cloud with thousands of NVIDIA Grace-Blackwell cpu´s explaining how atoms should get to your cars battery? Well, not really. A possible solution is this.
Smart EVSE controller

Some time ago me and Kristof found out about this neat device and used the Smart EVSE v3 to build our own charging station. However, the initial V3 firmware did not have any API present and lacked some other features. Like a decent status page, being able to use an off the shelve power meter, switch between 2 and 3 phases charging and a better way of combining it with a home battery. As the software running on the Smart EVSE (ESP powered) is open sourced and published on GitHub, we were able to do some modifications to this firmware and offer it as a clone of the original repo under https://serkri.be.

The software is left for part II where we will integrate the Smart EVSE with Home Assistant in combination with Solar panels and a home battery. In this part I we will go through (a possible) hardware setup around the EVSE to build a working charging station following best practices of the trade (be sure to read the disclaimer at the bottom before attempting any actions).

This small DIN-rail mounted box is a ¨EVSE¨ or Electric Vehicle Supply Equipment and is the core of our own charging station. So how come this small box can even charge a 100kWh+ battery? The answer is: it doesn´t. The charger is built-in into your car, not into this box neither in any other EV charging station for that matter. Note that the type of charger discussed here is a mode-3 AC charger using the well known type-2 (7-pin) plug. A mode-4 charger is a DC charger which can yield 22kwh+. In a mode-4 charger AC/DC conversion takes places in the charging station itself and not in the car. These type of chargers are not typically installed domestically but can be found at public (fast) charging stations.

What a mode-3 EV charging station actually does is communicating with the built-in car AC charger and controls a series of contactors, or NO (Normal Open) relays if you´d like. The contactors switch on and off the mains provided to the car´s charger, just like if you would manually connect or disconnect a random device from a wall power socket.

The communication protocol between the EVSE and the car is simple. It is a single wire, the ¨Control Pilot¨ (or short CP). It can be as thin as 0.6mm as it only carries a couple of milli-amps as a signal wire. Both the car and the EVSE have a small circuit that use this wire to communicate. Basically it uses predefined voltage levels and a 1Khz PWM signal (wave-form). The other wires are the mains (N,L1,L2,L3 and earth) that carry the actual charging current.


The following is the sequence and different states that exist:

  1. Car not connected, EVSE sets +12V on CP wire continuously (PWM off)
  2. Car connected, car circuit switches resistor to drop voltage to +9V, EVSE senses this and turns PWM on resulting in a wave form with amplitudes +9V/-12V
  3. EVSE now also control the PWM duty cycle (the width of the pulse) telling the car the maximum charging current. The duty cycle goes from 10% (0.1Khz) meaning 6A to, 96% (0.96Khz) meaning 80A. Duty cycle is calculated for range 6A-51A:current/0.6 and for range 51A-80A: current/2.5 + 64.
  4. Car now knows the max current by ¨reading¨ the duty cycle. In the event the car wants to charge, it switches another resistor that results in dropping the amplitude further down to +6V/-12V
  5. EVSE senses the voltage drop to 6V and now engages contactors
  6. Car senses that mains: N/L1(L2,(L3)) are now active and charging commences (this is the point your car or your cars app shows ¨charging X KWH¨)

Some notes:

  • The voltage is measured between the CP and the ground (GND) NOT between the CP and the PP (Proximity Pilot), the PP serves a completely different purpose
  • At step 4 the car is in control, if the battery is full or the car does not want to charge for whatever reason, nothing happens
  • If between step 5 and 6 is too much time: the car drops the voltage to 6V indicating it wants to charge but it senses that mains are not connected (in like 1 or more seconds) the car will abort the process, this is a security feature
  • There is also a +3V/-12V case instead of +6V/-12V. this is charging with ventilation. This is for special batteries that release hydrogen require air-ventilation, in that case the EVSE offers a relays to operate another circuit to turn on a physical ventilation system in the space where the car is in (if this space is a enclosed one like a garage). This is NOT supported with the EVSE shown here, but this is something very rare, almost all car batteries are lithium based and require no special ventilation
  • If the voltage changes to anything else than +6V/-12V, the EVSE will disengage the contactors as a security measure
  • The -12v is important and servers as fault detection: if there is a short circuit or something at the cars end that might lead to a voltage drop, the EVSE will not interpret it as long as the bottom of the amplitude is not -12V. The reasoning is that -12V cannot be created by accident (current leaks or by applying your fingers) only when the real circuit is controlling it

Another important aspect is the charging current. As the EVSE is not the one doing the actual charging, the max current is thus not limited by the EVSE. It is limited by your electrical house installation, the type of charging cable (the thickness) and the charger inside the car.

For example: BMW hybrid models have a single phase 16A charger. When applying 3 phases or even instructing the EVSE to allow 80A, charging current wont go higher than 16A or 230v*16A ~3.6Kwh. Mercedes hybrid models have two single phase 16A chargers. When applying 3 phases or even instructing the EVSE to allow 80A, charging current go higher than 2x16A or 230v*16A*2 ~7.3kwh. Then there are EV models with real 3 phase chargers supporting 32A and 400V. With these you can go up to 22Kwh (32A*400V*sq3 ~22Kwh).

The best way to start is to verify the specs of your cars internal charger. This practice also goes for installing an off-the shelve charger. However, if you have a ¨normal¨ electrical network as far as EU standards go, either single phase 230V or 3x230/400V (that would be 3 phases + N) a rule of thumb is to simply connect what you have and be done. Single phase 230V: just connect L1 and N. 3x230/400V + N? connect N,L1,L2 and L3. Even if the car does not have a three phase charger, it will ignore the other 2 phases. As a comparison: if you charge your car in a public charging station, there is no way the station knowing what your car supports either, it is the job of the charger inside the car to use it or ignore it. There are some other details such as the goal of the other wire (PP) and how the system is protected for over-current, but we´ll go into that later.

The global setup looks as follows: a pole to mount a weatherproof cabinet on that connects the ground cable to the tethered charging cable. The ground cables routed to the garage where they are terminated inside ¨cabinet 4¨ where the EVSE components are housed

Let´s now start with the stuff we need to get things going. All good DIY projects start in the Gamma, right? Building a charger is no different. This pole looked ok as the dimensions allow to support a plug holder and it´s meant to be put into the ground. Personally I like the charger to be minimalistic and as invisible as possible. but that is just a matter of taste.

A small weatherproof electrical cabinet is mounted to the pole. The color of the cabinet is gray but it was sanded and then painted black with a spray can to match the color of the pole. Pole clamps are used to attach the cabinet to the pole. We have a tethered charging cable and finally a dummy connector holder to hold the connector when not connected to the car.
In this setup the charging pole or cabinet does not contain any electrical components. It is just a big junction box to connect our ground cable with the charging cable, to serve as holder for the charger plug and possible to house LEDs to also visually indicate charging status. The plastic junction box inside the cabinet is just there as an extra security to connect the tethered charging cable to the ground cable and to avoid any contact with the cabinet. Instead of a junction box it is also possible to use a cable connector instead. The small junction box on the left is to keep the CP wire separated from the mains as extra security. Note: in this specific tethered cable there are two wires to be seen going into the left junction box: orange and purple. However, they are combined at the end (form one cable serving as the CP). One of the two could be used as PP but is not connected in this cable. More on this below where the PP is discussed.

On the image above, the cables going into the cabinet from right to left: the tethered charging cable, the ground cable (EXVB 5G6 mm²) and an UTP cable (U/UTP Cat. 6 outside) used for connecting the CP. I´ve used 1 pair and combined them as 1 cable. That leaves 3 other pairs they can be used, for example to connect a status led.

End result:

Besides the CP there is also the PP (proximity pilot) wire which we haven´t discussed yet. The PP wire is used to indicate that the car is connected to the EVSE and for our type 2 plug it also indicates the maximum current of the charging cable. This is important for untethered cables only. For example, if you would connect your own cable to a charging station capable of 22kwh on the one side and your car (for example also capable of 22kwh) on the other side, neither the charging station nor the car has an idea about the thickness of your cable and the maximum current it supports. For 22kwh you need at least a 6mm2 cable, any thinner might heat up and burn the cable.

However, in a tethered cable there is no need to connect the PP to the EVSE as we can configure the max current ourselves in the EVSE itself as this cable will fixed. For the car side, the tether cable shown above has a resistor in place that will tell the car the maximum current supported by the cable. Bottom line: in this case (of a tethered/fixed cable) there is no need in connecting the PP to the EVSE side, just the CP. The cable in question does not even offer a PP wire.

Note: the tethered charging cable as listed above is a 32A cable and comes pre-installed with the correct resistor, it is ready to use. When planning to build the charging cable yourself instead, keep in mind to provide the correct resistor between PP and GND or to route it through and connect it to the EVSE itself.

Next up are the actual charging station components. These components are housed inside a electrical cabinet inside my garage. I´ve opted to install all outside electricity (together with the solar panels) in a separate cabinet. The cabinet is connected in parallel on the main differential. As a cabinet I chose the IDE 120modules

The components needed for the cabinet:

Below is the schema how to connect the components:

An important aspect of this setup is the use of type B differentials. Note that the type indication of a differential (A, B) is not the same as the type indication of a circuit breaker (A,B,C,D). Normal household differentials are of type A. The theoretical problem is that a AC/DC transformer is able, in abnormal conditions, of producing a so called ¨DC leak current¨. The differentials job is to cut power when a leak current is detected above the indicated current. However, a type A cannot detect a DC leak current, it only detects AC leak currents. One might be tempted to place just a single type B before the EVSE circuit breaker. This means that there is at least the 300mA type A differential (the main/obligated 300mA in Belgium) in front of the type B. For example:

Type A 300mA main differential –> Type B 30mA –> 32A EVSE circuit breaker

Now another (even more important) side effect appears: type A differentials get blinded when a DC leak current occurs above 6mA. What does that mean? Suppose the car transformer is generating a leak current of 10mA. This is not enough to trigger our 30mA type B differential. The type A differential is not triggered by the leak current either, because it is well below 300mA, but most importantly because the type A does not trigger on DC leak currents. If there would now appear a AC leak current (over 300mA), somewhere else and not related to our charging infrastructure (for example a device connected to a power socket inside the house), the type A differential will not trigger because of the 10mA leak current and basically becomes ¨blind¨ for the job it was designed to do in the first place.

Only upstream type A differentials are blinded. In a normal household setup, there would be a 30mA type A downstream of the 300mA for humid spaces. In the setup as discussed above, the 30mA type A would be logically seen in parallel with the type B 30mA. Hence in case of a leak current in for example the bathroom, the 30mA will still be triggered. Nevertheless, leak currents can also exist outside humid spaces which are only protected by the 300mA. Not to say that this could lead to dangerous situations either way.

When buying a off the shelve charger, chances are high that there is a device inside that can detect leak currents over 6mA and can cut power. The same would go for power plug chargers. It could also be that the car itself has some kind of DC leak current protection.

Either way, it is not always clear that this is the case. With this setup we are not depended on this security being present or not. This will work for our charging station but it will also work for an off the shelve charger that would be installed.

So eventually in my setup there are two main 300mA differentials: one type A in cabinet1 and one type B in cabinet 4. Both positioned in parallel of each other. Everything in cabinet1 (and other cabinets that are logically positioned ¨behind¨ the 300mA in cabinet1 ) use solely type A differentials. Everything in cabinet 4 uses type B differentials. This adheres to the rule that there are no upstream type A differentials seen from the path from our charging infrastructure.

A more elaborate explanation, and also alternative ways of dealing with this correctly can be found here.

The result of ¨Cabinet 4 (outside + charging station)¨:

Note: in the cabinet are other components not related to the charging station setup, also there are two charging stations foreseen. The red numbers identify the component related to the schematic.

  • 1: 300mA type B parallel on the main 300mA type A
  • 2: Wago´s
  • 3: 30mA type B protecting charging station 1
  • 4: 32A circuit breaker for charging mains
  • 5: 6A circuit breaker for EVSE and Modbus power supply
  • 6: Power meter
  • 7: EVSE
  • 8: 32A Contactor 1
  • 9: 32A Contactor 2
  • 10: Modbus gateway power supply
  • 11: Modbus gateway
  • 12: Earth/GND
In order to connect the 300mA type B of cabinet4, the main 300mA type A (in cabinet 1) connection holes are used as junction point. This normally doesn´t work as the connection holes are not big enough to securely fit 2 cables. However, the 300mA type A needed to be replaced anyway with a delayed version. This is not related to the charging station setup, but we had a faulty device some time ago causing a leak current and noticed that the 300mA would trigger before the 30mA did which would turn off all electricity.

With a delayed version this would not have happened and would give (each) downstream 30mA the chance to trigger by itself only cutting the problematic circuit. Now, because of this I had the chance to replace it with the 80A version. This costs slightly more, and is overkill (as my connection is only 40A) but! It has larger connection holes allowing to connect the copper coming from the main meter cabinet AND the copper for connecting to the 300mA of cabinet 4, killing two birds with one stone.

Note: another solution would be to terminate the installation cable (coming from the main meter) into wago´s in cabinet1 and connect from there to the 300mA type A in cabinet1 and to the 300mA type B in cabinet4. However, this setup is not allowed in a main cabinet as it is not possible to ¨seal¨ this solution. A solution that is accepted is a variant by placing an small separate cabinet where only the 300mA´s and some wago´s can fit. This allows to do basically the same, but this is allowed as everything is combined in a sealable cabinet: terminate the installation cable into wago´s, go from there to the 300mA type A and 300mA type B, and then go from either differential to the corresponding cabinet1 and 4. For me this would be more hassle as placing another cabinet, and it would also mean re-routing the 16mm2 stiff copper installation cable from cabinet1 to this new cabinet which is rather difficult. So the ¨create a junction inside the 300mA¨ was the most pragmatic solution in for my case.

So, now that we have setup all the hardware, it´s time for part II to start integrating it software wise.

Disclaimer: a reminder to exercise caution and judgment if you attempt to implement any recommendations, techniques, or practices discussed here. The author of this article shall not be held liable for any injuries, damages, losses, or adverse outcomes resulting from the use or misuse of the information contained within. Readers are solely responsible for assessing their own capabilities, the correctness of the contents offered here, and ensuring their competence and suitability for any actions they choose to undertake based on the content of this article.

Koen Serneels

Koen Serneels