Correct power calculation for both single and 3-phase

I’d have 2 contactors

Contactor 1 - N + L1, controlled by relay1; L1 monitored by AC_Test1
Contactor 2 - L2 + L3, controlled by relay2; L2 monitored by AC_Test2

I don’t think L3 needs monitored, the key is to monitor each contactor.

edit: neverming, was all wrong I think :wink:

Not strictly related, but I changed out my openEVSE wifi module today for the ESP32-dev board with wired ethernet. Worked well, first time.

While I was inside my emonEVSE, I noticed the main contactor is not fed through relay1 or relay2 connections but directly from the AC_Relay connections on the main power connector to the openevse board. These look to be triggered by PB1 on the AVR (physical pin 13, AC_Relay1) fed to some unnamed chip that appears to be able to actuate a 240V AC coil on the contactor directly. So seems there are 3 ways to trigger a contactor to close from the software (relay1, relay2 and this AC connection)…
Looking at the code again the AC one is also activated thus:

#ifdef CHARGINGAC_REG
    pinChargingAC.write(1);
#endif

Not a problem and doesn’t affect the plan at all. AC_Relay and Relay1 (the 12v relay output) are essentially the same thing as far as I’m concerned (both will be associated to L1 contactor) . Relay2 (other 12v relay output) is the ‘special’ one that will control L2/L3 Contactor.

However, I’d love to know what that unnamed IC is that takes 5v level logic in and can actuate a 240AC coil on the contactor.

Just a transistor like PN8359 no?
The ac / DC pins are to actuate ac or DC relay. They use the same pin so

It looks like a PCB mount Solid State Relay.
I think something like this https://docs.rs-online.com/539d/0900766b80e1fa51.pdf

Yes, from a close up picture of the board its a AQH2223

Well, I’ve just discovered how to auto detect 3ph or 1ph connection.

If you read here : OpenEVSE SAE J1772 Theory of Operation : Support

You will see this key piece of information:

This seems to suggest that by connecting the AC_Test lines as I describe above (1 to L1, the other to L2) then the presence of three phase can be detected. While this can’t tell us if a vehicle is actually using 3phase to charge, it can tell us that we are 3 phase connected or not.

I believe that’s what openEvse use for north American setups and how the auto level feature works

But it’s not compatible for European specs, and probably why it’s wired like this for Europeans one. we should replace the auto level1/2 for proper mono / three-phase selection.

Yes, you are right… from the README for openevse firmware :

UK/EU

  • Disable AUTOSVCLEVEL (autodetection is designed for split-phase)

  • Charging level default to L2

  • Set MAX_CURRENT_CAPACITY_L2 32 (limit for single-phase charging in UK/EU)

  • Add ‘.EU’ to version number

  • Enable LCD Redraw every couple of min (required for EMC/CE)

There’s not much to change in actual evse fw then .
Just use the same service level flag to detect one/3phase.
Haven’t checked yet, does the code already switch relay2 pin when forcing service level using rapi?

No it doesn’t. EU is compiled to service level L2 by default, and both relay pins are closed. I’ve made the code so that we can chose to close either one or both via RAPI for pv divert purposes

I mean for the US version, have you checked it doesn’t already use booth pin to switch levels?

For the US version, I believe it does use both pins to switch levels… imagine if it sees V on both the feeds it assumes split phase and goes to L2.

For the EU, we can use to detect 3 phase, but does not solve the issue of single phase charging on a 3 phase unit… My brain is trying to figure out the best solve for getting another CT sensor active.

For EU, detect three phase, I have two options in mind

  1. additional CT(on phase 2 or 3), connected on the ESP32 which detects current or not. Example connection can be found on this website actually:
    How to Build an Arduino Energy Monitor - Measuring Mains Current Only — OpenEnergyMonitor 0.0.1 documentation
    Just a few resistors and a capacitor. software in the ESP32 needs to be adjusted so it will switch from one to three phase when it detects current.
  2. External meter.
    This might be done in several ways. for my own home, I have a dedicated three phase modbus meter (ABB B23) for my charging system. This meter is read out by my home automation system, Openhab. I have a rule in place that detects if there is three phase charging or not. Openhab can then use the Openevse API to switch the is-threephase boolean(maybe nice feature in the future will be to be able to control this via MQTT).
    Update the EVSE configuration | OpenEVSE WiFi v4
    Personally I have not implemented this last step as I do not have my homebrew Openevse board completely up and running.

@Jippe , energyMeter is now handled by ESP32.
So if the is_threephase switch is toggled or not, it will calculate correctly for booth mono/three .

Having the second CT sensor would allow to automate this switch easily

Agree with the 2nd (&3rd!) CT sensor, but I’m not a fan of putting it on the ESP side.
Sensing if we have 3phase is easily done with existing hardware (AC_Test2), measuring the current is the problem.
I am beginning to think that the next openevse revision could have additional connector for the CTs as standard, and all the ‘power’ stuff should stay on this board. Just my 2c.

That would be a better way of having an updated openEvse module with more io to handle 3phase properly.

I’ve now got my test EVSE up and running thanks to @glyn.hudson and the awesome OEM team.

The feature I mentioned above of being able to control if one or both the 12V relays engage during a charge with $SR command works well on my testbed. Default is to engage all relays (onboard AC, DC Relay1 and DC relay2), when $SR 0 command is given, subsequent charge sessions will engage only onboard AC and DC Relay 1. The idea being that L2/L3 are on a contactor operated by DC Relay 2.

This means we could create a config option in the gui called ‘Single Phase Charging on PV’ and the user can choose to use either single phase (1500W start) or three phase (4500W start) charging for PV.

I’ll add the basic logic (detect and adjust current power calculations if we are single/3phase, and revert to all relays on for schedule or override charge sessions) to the ESP32 code in a new branch in coming days.

I’m sure there will be more to do to make this ‘production’ if that is what you want to do.