Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schematics/firmware? #3

Open
jimon opened this issue Aug 12, 2021 · 15 comments
Open

Schematics/firmware? #3

jimon opened this issue Aug 12, 2021 · 15 comments

Comments

@jimon
Copy link

jimon commented Aug 12, 2021

Hi,

I think this repo either empty or all branches hidden.
So any schematics and firmware available for v2?
Thanks!

@dries007
Copy link

I second this request. I might like to add some additional features so I don't need another device attached to the P1 bus.

@mstegen
Copy link
Member

mstegen commented Aug 29, 2021

Schematic and standard firmware files are now available.

@dries007
Copy link

Can you write up somewhere what modbus registers are available in the current firmware?

@mstegen
Copy link
Member

mstegen commented Aug 30, 2021

Just added the explanation of the modbus registers to the Readme, and some examples.
Please note that you can only read all the mobus registers at once. You can not request a specific register.

When using the CT inputs, you can also set the Grid setting from 4 to 3 wires, and the field rotation from CW (clockwise) to CCW (counter clockwise).

@IgorYbema
Copy link

IgorYbema commented Sep 2, 2021

Thanks for making the ESP32 code, the PIC firmware and the schematic available!
Are you also planning to release the PIC code? I was looking if it was possible to use P1 and CT together. P1 for the mains meter and CT for the EV charged meter.
Maybe it is possible with current PIC firmware (let the PIC do the CT and the ESP32 do the P1 as P1 seems to be connected to the ESP32 also)? (edit: thinking about this while looking at modbus registers, is the PIC maybe already doing both?)

@mstegen
Copy link
Member

mstegen commented Sep 2, 2021

Yes, i'm cleaning up the code, and will make the code for the PIC available in a few days.

There will be two compile options, one normal, where the PIC handles everything (this is currently the way it's done).
The PIC will then handle the P1 data and the CT measurements, and communication over RS485. The ESP32 will only blink the LED ;-)

The other compile option will just do the CT measurements, and send the raw data to the ESP for further processing.
Here the ESP32 will handle the P1, and RS485 bus, and read the CT measurements data from the PIC (over a serial line).

All data from CT's+P1 port is already sent to the SmartEVSE, so if you want to use the CT measurements as EV meter, it might be easier to modify the SmartESVE code?

@IgorYbema
Copy link

All data from CT's+P1 port is already sent to the SmartEVSE, so if you want to use the CT measurements as EV meter, it might be easier to modify the SmartESVE code?

Ok great. Yes that would be more feasible.

@WilfredHoogerbrugge
Copy link

Yes, i'm cleaning up the code, and will make the code for the PIC available in a few days.

There will be two compile options, one normal, where the PIC handles everything (this is currently the way it's done). The PIC will then handle the P1 data and the CT measurements, and communication over RS485. The ESP32 will only blink the LED ;-)

The other compile option will just do the CT measurements, and send the raw data to the ESP for further processing. Here the ESP32 will handle the P1, and RS485 bus, and read the CT measurements data from the PIC (over a serial line).

Any progress on this?

It would be realy nice to have a 'smart' sensorbox that provides an API for home automation purposes and does all the modbus comminication so we don't have to bother with a multi-master modbus setup anymore.

@mstegen
Copy link
Member

mstegen commented Feb 10, 2022

Ok, a few days became a few months... But i've just uploaded the Sensorbox 2 code.

@IgorYbema
Copy link

Thanks. A great progress forwards! So this is still sensorbox as slave as I understand. Are you planning to switch the master/slave task somewhere soon?

@mstegen
Copy link
Member

mstegen commented Feb 10, 2022

As the next SmartEVSE v3 also uses a ESP32, i'm planning on moving the code over to the sensorbox once it's working on the SmartEVSE. Should probably hire someone to work on this, as there is a lot of stuff to do.

@rob040
Copy link

rob040 commented Nov 4, 2022

@mstegen any progress in making the current sensorbox-2 PIC firmware available?

I'm curious on how often the current is sensed and if the phase difference is monitored, and if true-RMS current measurement being done. From the schematics, I gather the voltage is no measured, hence no power measurement is possible, only zero crossing of one phase is read. Are the CT phases checked/monitored by FW? On a household mains grid there could be there could be quite some harmonics in the CT signal, so the measurement frequency and anti-aliasing filtering can become important for decent CL1 results.
When using CT for measuring the current to the EV , in combination with P1-data, the phase voltages are known, so it could generate data about the power the EV actually takes. This would be an interesting use-case, and room for further improvements.

@mstegen
Copy link
Member

mstegen commented Nov 4, 2022

Hi @rob040,
I have just uploaded the PIC18F26K40 code. It can be used as stand alone, or in ESP_DIRECT mode.
In ESP_DIRECT mode it will not handle the modbus data, and only send raw data serially to the ESP32 for processing.

I can answer some of your questions. Each phase is sampled 60 times per second.
The phase is measured with the optocoupler, but voltage measurements are not possible this way, so i'm using a sine wave look up table as the 'voltage'. As i'm only interested in the currents on each phase (and not the power), this works out ok.

If the voltage lead is not connected, it will use a alternative way to calculate the current on each phase. (this is less precise for low currents, as the power factor is unknown)

@WilfredH
Copy link

Thanks for sharing the new firmware.

In this new version the Sensorbox is still the modbus slave so the webserver is not of much use, it can only provide the P1 / CT measurements.
I was hoping for the Sensorbox to become an entry point for controlling the SmartEVSE via an webinterface/api but maybe I should give up and buy a V3 controller instead?

@lhupfeldt
Copy link

I'm also hoping for controlling SmartEVSE V2 via the sensorbox, specifically just to toggle between Solar and Smart modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants