So I had a go at detecting if a one phase EV is charging on a three phase EmonEVSE. It was more difficult than I thought when I started. Now I have the software working in a proof-of-concept setup.
The main difficulty was figuring out what the input from the AC test circuit looks like. The openEVSE controller board I got is a v5 board, that uses a HCPL-2731 optocoupler instead of a MID400. The application notes I found either didn’t mention using it as an AC line monitor, or they were short on detail about how the device behaves typically under those conditions. I ended up using the serial debugger to print out a string of ones and zeroes, 1 char for every sample:
(I programmed it so that when voltage was detected on AC_TEST2, a zero was printed, otherwise a one. Current is 0 for positive value, 1 for negative value)
As you can see, current en voltage do line up at the center of the half cycle. Once I knew that, all I had to do was write the code to measure when the center of the positive half of the current and the voltage appear, and compare them to calculate phase difference.
My proof-of-concept setup uses a 3 phase EmonEVSE on a one phase power supply (230V), and a space heater as the “EV”. When I mount the CT inside the EmonEVSE in one direction around the L1 wire, the unit counts the power as one phase power (current in phase with voltage). When I put the CT the other way around the L1 wire, it counts the power as 3 phase power (current in counter phase with voltage).
I uploaded my code to GitHub - janherrygers/open_evse: Firmware for OpenEnergyMonitor OpenEVSE
Next steps are
- to connect the unit to a 3 phase socket to see if it still works as intended. My current plan is to run L1 and L2 through the CT, connect the space heater to L2, and see if it counts 3 phase. I haven’t thought of a way to simulate a 3 phase load yet (L1+L2 should shift the center of the current half wave in between L1 and L2), so suggestions are welcome.
- I’d like to get some 3rd party review on my setup and code. I am a software developer by day, but I don’t program microcontrollers professionally.
- Finally, now that I have 3 phase detection, it would be nice to get some feedback on the display about how many phases are used. Maybe even on the web page.