Attention: new firmware version 102 (june 2016)
Sometimes it is not clear how much power an EV charger is commissioned to give. The power a car actually takes is not a very good indication, because the car itself limits charging power based on temperature and State of Charge. Commissioning errors are made and this little bug sized tool can help identify those. I made it from mostly stuff I had laying around. Even when all part are bought new, the bill should be below 5 euros.
- We're using my favourite chip, the Atmel ATtiny85. It is compatible with the Arduino ecosystem
- For programming, we will use the Arduino IDE
- You need some sort of programmer, there are many instructables on how to build one (see step 3, Firmware)
- one crocodile lead
- one USB lead
- one DIL-8 socket
- one 100 nF capacitor
- three resistors (values are not critical): 560R, 22K, 820R
- three diodes 1N414
- one LED (I used a bright red 3mm one)
- one microcontroller ATtiny85
- some two component resin (optional)
- a soldering iron and solder
- an installed Arduino IDE
- an ISP for the ATtiny85
Step 1: Understanding the Schematic
The car and the charger communicate through a signal between Protective Earth (PE) and the Control Pin (CP). PE is connected to the ground of the device, and CP to R2 and the anode of D3.
The network of D3 and R3 is an emulation of the car telling the charger it is ready to accept power. The charger will put a pilot signal on the CP which indicates the car can start charging and the maximum power it can take. This signal can vary between +12 and -12 volts, which is not suitable for the microcontroller to analyse. The network of R2, D1 and D2 clips the signal between the ground and VCC, and then it is fed into the microcontroller.
The microcontroller measures the pulse width of the signal, which corresponds to the maximum current the car is allowed to take, per lead, and presents the result through the single LED
Step 2: The Build
I decided to build the device "free form".
I used an old USB lead to power the device. Just cut off the mini or micro USB plug and look for the black and red wires. Red is Vcc (5 volt), black is GND.
To connect the device to the Mennekes plug under test, I cut a crocodile lead in half, soldered one half to GND and the other half to the CP input. Make sure you mark the two crocodiles PE and CP, as the device will not work properly when these are swapped.
I put the entire thing into some clear heat shrink tube, heated it and then filled it with two component resin to secure the leads and to protect the loose components.
Of course you can build it on prototype board or any other way you see fit. My goal was to make it small enough to easily ship it in an envelope, and to be able to reprogram the micro-controller, which is tricky but can be done.
Step 3: The Programmer and the Firmware
You need some sort of device to put your programs (or sketches as they are called in Arduino parlance) into the chip's flash memory. Such devices are called ISP's. This instructable is not about how to build yourself an ISP nor how to use the Arduino IDE. If you're new to programming ATtiny85 chips, please read my "Butt Light" instructable, as it contains links to building your own ISP and how to use the Arduino IDE to compile and upload your firmware.
Note: starting version 102 there is untested support for running the code on an Arduino Nano or Arduino Pro Mini. Both are based on the ATmega328 chip.
The firmware is well documented and should be self explanatory.
Step 4: Operating the Device
To operate the device, hook it to any USB device, preferably a power pack. This will power it up and the LED should blink short - long - short-short, indicating operation and version 102 of the firmware.
Now connect the PE crocodile lead to the center PE pin and the CP crocodile to CP pin. When holding a Mennekes type female plug (the one that goes into your car, left one in the diagram) and looking into the business end, the PE is the center pin, and the CP is the smaller pin at the 11 o'clock position. The charger will respond with switching the power on which is usually noticable because a beefy contactor will close with a "cloink" sound.
WARNING: from this moment, the pins L1, L2 and L3 will be live wired to the power network. The pins are shielded and cannot be touched, but don't poke anything in the plug other than the leads to PE and CP. Use common sense!!
The LED repeatedly flashes three sequences to represent a three digit number, with a single long flash indicating a 0 and numbers greater than 3 separated in groups of three. The first number should always be a zero. So when we represent a long flash with an underscore and a short one with a dot, two example are:
_ .. _ _ .. _ 020 amps per lead _ . ... .. _ . ... .. 015 amps per lead
That's it. Happy measuring!