Page 3 of 4

Re: Cheap Chinese Power Meter made wireless

Posted: Wednesday 05 July 2017 19:48
by SweetPants
littlewouter wrote:The provided code from Kapee sends the average watt value each minutes via MQTT, this could be easily recalculated to kwh consumed in the last minute.
That is why I save the calculated Kwh every hour on the ESP module's flash. If I lose power or pull the meter I lose max. 1 hour of Kwh measurements. You can save more times and be more accurate, but that will eventually break your ESP module as the flash can only be written x number of times.

Through MQTT I can also clear the Kwh and reset the ESP if I want measurement to start over, in case of moving the meter to another device I want to monitor.

PS: I'm not using Kapee's code

Re: Cheap Chinese Power Meter made wireless

Posted: Wednesday 05 July 2017 22:00
by Kapee
You're welcome.
As I said, I am not working with domoticz, but with Node-Red.
The calculation from watt + time to kWh is done in a Node-Red function. I think in Node-Red the time is quit accurate, in wemos not.

Re: Cheap Chinese Power Meter made wireless

Posted: Friday 11 August 2017 15:04
by Rolo
Nice project, I have inspiration to build one with a MySensors node in it. Just ordered two meters, wil take some time to get here. I'm curious what board is in the meters I get, I will update this topic a soon as I have them.

Re: Cheap Chinese Power Meter made wireless

Posted: Friday 01 September 2017 14:21
by bilbolodz
Kapee wrote: Thursday 08 June 2017 12:12The second burst contains the value for volt and watt.
Have you manged to figure out "which registers" are checked by MCU? As I can see from your code main CPU ask for 4 content of four registers. Because of communication protocol of it has to bee "four registers in incremental order": first is power and third is voltage how about second and fourth?
If you know "base address register" (power register) maybe 2 and 4 word will be useful too?

And second idea: I've to check PCB but maybe it's possible to cut RX/TX traces between MCU and V9261F, put ESP8266 "as a proxy" and collect more interesting reading from measuring chip?

Re: Cheap Chinese Power Meter made wireless

Posted: Sunday 03 September 2017 19:21
by Kapee
I was just interested in volt, watt an frequency. kWh will be calculated by the Node-Red system.
With the finishing of the software I stopped investigating the power meter.
But I like to hear from you if there are more possibilities with the power meter.

Re: Cheap Chinese Power Meter made wireless

Posted: Monday 04 September 2017 11:11
by bilbolodz
As I understood you are NOT going to extend your project and I have to try myself? Am I right?

Re: Cheap Chinese Power Meter made wireless

Posted: Monday 04 September 2017 11:26
by SweetPants
bilbolodz wrote: Monday 04 September 2017 11:11 As I understood you are NOT going to extend your project and I have to try myself? Am I right?
That's what I read :mrgreen: :mrgreen: :mrgreen:

Re: Cheap Chinese Power Meter made wireless

Posted: Monday 04 September 2017 14:46
by Kapee
Indeed, that's what I meant.

Re: Cheap Chinese Power Meter made wireless

Posted: Saturday 09 September 2017 9:02
by Rolo
I'm working on a powermeter (the model as in kapee posts) and have build a circuit get the RX data optically isolated. Using this method you can safely connect the microcontrollerboard of your choice to the USB port of your computer. No need for an isolation transformer. My prototype uses a node MCU board but it will also work with other boards. Please be careful, there is still 230V ac within the red dotted line.
<edit> The serial logic is inverted in this setup.
I will share the schematic here :
Image

Prototype in action :
Image

Re: Cheap Chinese Power Meter made wireless

Posted: Saturday 16 September 2017 13:56
by xose
Thanks @kappe and @rolo, I'm using your code and setup for my Intertek.
So far I've discovered the codes the MCU is sending the V9261F:

FE 11 80 01 00 00 00 A2 => read register 0x0180 (sysctrl)
FE 11 19 04 00 00 00 06 => read 4 registers starting at 0x0119

So the values in @kappe sketch are:

0x0119 average total active power
0x011A average total reactive power
0x011B average total voltage rms
0x011C average total current rms

What I don't know yet is how to know the calibration constants. In @kappe sketch they are hardcoded as magic numbers but I'd like to know where do they come from (experimenting?). In the 5.13 section of the datasheet talks about calibration registers and formulae but I can't figure the numbers out...

Re: Cheap Chinese Power Meter made wireless

Posted: Tuesday 19 September 2017 18:35
by Rolo
I know these calculations are done empirical, My meters needed other numbers to make the readout match with what's on the display. I did not further investigate the logic behind it. I have build two meters. I have made two virtual power sensors in Domoticz and the ESP module updates the values by posting JSON url's to domoticz.

Image

Re: Cheap Chinese Power Meter made wireless

Posted: Wednesday 20 September 2017 10:37
by Kapee
I ordered three powermeters and all three have a different printed circuit board. The 1st and the 3rd with spi interface, the 2nd with serial interface.
For the 3rd powermeter I made a pcb for the wemos and power supply, it just fitted in height.
3pwrmtrs (Small).jpg
3pwrmtrs (Small).jpg (87.19 KiB) Viewed 11134 times

Re: Cheap Chinese Power Meter made wireless

Posted: Monday 25 September 2017 13:48
by xose
I've been wrapping up things with these powermeters and adding support for both the V9261F and the ECH1560 in ESPurna (beta testing right now). It also provides and option to calibrate those "magic numbers" from the webUI. I only have the serial interface version and it works great. The ECH1560 has probably a few bugs but I cannot test it.
If anyone is interested in trying it you can first read this post http://tinkerman.cat/connected-power-meter/. Any feedback would be very valuable. Thank you!

Re: Cheap Chinese Power Meter made wireless

Posted: Monday 25 September 2017 20:28
by Rolo
Nice article. You took the time to gather all the info.

Re: Cheap Chinese Power Meter made wireless

Posted: Monday 02 October 2017 22:38
by Raspberry Piet
Nice article indeed!
Already have a Sonoff Pow with the espurna firmware, works very good. :!:

Now i flashed espurna 1.9.5 for my ECH1560 Chinese powermeter. (wemos d1-mini inside)
It is showing some values but it is a bit jumpy:
Image

Code: Select all

    #define ECH1560_CLK_PIN     5
    #define ECH1560_MISO_PIN    14
    #define ECH1560_INVERTED    0  
I don't have it wired with an optocoupler but with a levelshifter (it works! with the firmware from Sweetpants)
So i thought i should change the ECH1560_INVERTED to 1 but it keeps this same erratic behavior :|
How to debug this?
Also found another bug? Voltage IDX is gone after a reboot:
Image

And i can't find the Power Calibration menu. (not visible)
Hope this can be fixed, i really like the espurna firmware!

Re: Cheap Chinese Power Meter made wireless

Posted: Tuesday 03 October 2017 12:06
by Kapee
In the software of Karl Hagström I see the line:

if ((U > 195) && (U < 253) && (P >= 0) && (P < 4000)) // ignore spurious readings with voltage or power out of normal range
{

I adapted this line a little, in the Netherlands the voltage can be 230volt -15% +10%
Perhaps this can help you.

Re: Cheap Chinese Power Meter made wireless

Posted: Saturday 25 November 2017 15:52
by bilbolodz
I've some problems with ESPurna V9261F version of power meter: almost all values are wrong displayed at web page and some values in mqtt are also wrong. Measure conditions (read from LCD screen): 23,7W, 0.014 KWh, 245.9V, 0.174A power factor: 0.55, 50Hz

At the status web page the only "non zero value" is voltage: 245 V (rest are 0), in mqtt message I can see:
miernik_mocy_1/data {"current":"0.18","apparent":"24","energy_delta":"1486.067","energy_total":"51032.548","power":"24","reactive":"0","voltage":"246","factor":"100.00","time":"2017/11/25 15:46:29","host":"miernik_mocy_1","ip":"192.168.105.236"}
miernik_mocy_1/data {"app":"ESPURNA","version":"1.9.9","host":"miernik_mocy_1","ip":"192.168.105.236","mac":"60:01:94:37:8C:91","rssi":"-56","uptime":"3000","freeheap":"19928","vcc":"3018","time":"2017/11/25 15:51:29"}
I've tried to calibrate but not quite how to do it.

Re: Cheap Chinese Power Meter made wireless

Posted: Saturday 25 November 2017 17:15
by bilbolodz
I've made a "config reset". Now not correct are only
- "Reactive Power": 0 "VAR"
- Power Factor: 100%

Re: Cheap Chinese Power Meter made wireless

Posted: Friday 19 January 2018 17:25
by Arek84
I have a similar cheap energy meter with SPI, it looks like ECH1650
miernik1.jpg
miernik1.jpg (273.36 KiB) Viewed 9694 times
but unfortunately it does not work with espurna-1.12.1-esp01-ech1560.
connected ESP07 GND => GND, CLK => GPIO04, SDO => GPIO05
[THINGSPEAK] Async ENABLED, SSL DISABLED
[SENSOR] ECH1560 @ GPIO(4,5)
[SENSOR] -> current:0
[SENSOR] -> voltage:0
[SENSOR] -> apparent:0
From the description on the board it is CS5460.
Is it possible to make an espurna working with cs5460?

Re: Cheap Chinese Power Meter made wireless

Posted: Tuesday 17 April 2018 18:27
by Kapee
I made an adaptation to my 3rd powermeter.
The used wemos D1 mini has several unused ports, so I added a transistor + relay to switch the output power.
Now I can switch on or off the output power by Node-Red.
Pwrmtr3 .jpg
Pwrmtr3 .jpg (78.88 KiB) Viewed 8660 times