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

[RFC] adding a voltmeter #825

Open
kolyshkin opened this issue Apr 16, 2024 · 2 comments
Open

[RFC] adding a voltmeter #825

kolyshkin opened this issue Apr 16, 2024 · 2 comments

Comments

@kolyshkin
Copy link

This is a continuation/summary of discussion in lincomatic/open_evse#175

Current OpenEVSE hardware (as of April 2024) lacks a voltmeter, and the current meter is not too precise. As a result, power calculations use some predefined voltage (like 240) and imprecise current.

After some research, it seems that adding a dedicated power meter that will interface with ESP32 directly (i.e. no ATMEGA involvement) would be the best solution.

For example, Peacefair PZEM-004t (v3.0) measures both AC voltage and current (up to 100A) and is able to talk via a serial bus. There are mixed reports of whether it can work with ESP32's 3.3v signalling, but most sources say it can (if being powered by 3.3v).

Another possibility is to use Peacefair PZEM-016 which seems to be a newer version of PZEM-004t v3.0 (as far as I can tell, the only difference is built-in power supply that is powered from the high voltage side).

ESP32 has 3 serial ports. Current OpenEVSE hardware (OpenEVSE TFT v1) has two serial ports available on the board:

  • Serial0 (used to talk to ATMEGA board);
  • Serial2 (seems to be used for development/debug, although the connector is not soldered).

There's also a possibility to use Serial 1 by directly connecting to any two ESP32 pins that are otherwise unused.

For now, I am going to try using Serial2 (aka debug port). Unfortunately it is used even when the DEBUG is not defined, so the first step would be to make debug work without actually occupying a real serial port.

The next step would be to modify the code to support a dedicated power meter instead of relying on information from ATMEGA board.

Any ideas, comments, questions etc. are very welcome!

@Dicion
Copy link
Contributor

Dicion commented Jun 19, 2024

Looks like the PZEM-004t is RS232 on the serial side, and PZEM-016 is RS485.

It would be REALLY easy if someone made an i2c version of something like this. Can just bus it on the QWIC connector along with the RFID reader.

It might be worth looking into using something like this: https://www.dfrobot.com/product-2001.html

Especially since you're having difficulty accessing the serial ports already.

@Dicion
Copy link
Contributor

Dicion commented Jun 19, 2024

Assuming you're using the TFT board, could you modify platformio.ini to move the debug port to the unsoldered one as a test to free it up?

From

[env:openevse_wifi_tft_v1]
board = denky32
build_flags =
${common.build_flags_openevse_tft}
-D DEBUG_PORT=Serial2
-D RAPI_PORT=Serial

To

[env:openevse_wifi_tft_v1]
board = denky32
build_flags =
${common.build_flags_openevse_tft}
-D DEBUG_PORT=Serial1
-D RAPI_PORT=Serial

Which would possibly free up Serial2 for your use. Or maybe you could just undefine it as well. Not sure how it would handle that though. Other platforms don't have a debug port defined, so I'd hope that undefining it works.

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

2 participants