Cheap Chinese Power Meter made wireless

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

SweetPants

Re: Cheap Chinese Power Meter made wireless

Post by SweetPants »

wvries wrote:Hi SweetPants

Would you be so kind to also send me a mesage with your code ?

Got all stuff in and ready to do some work on it.
send you a PM
SweetPants

Re: Cheap Chinese Power Meter made wireless

Post by SweetPants »

josbo12 wrote:Hi SweetPants,


I am working on the same project, but it does not work very well, you could publish the code?

Thanks
send you a PM
Ningaloo
Posts: 1
Joined: Monday 27 March 2017 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by Ningaloo »

Hi SweetPants,

guess what. I like to receive your code too.
I use this power meter on a solar microinverter. It seems to measure power in both directions.
It would be nice to send the data to domoticz
SweetPants

Re: Cheap Chinese Power Meter made wireless

Post by SweetPants »

Ningaloo wrote:guess what. I like to receive your code too.
send you a PM
Kapee
Posts: 13
Joined: Sunday 09 April 2017 21:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by Kapee »

I also want to make this power meter wireless.
The ESP8266 version that I want to use is the Wemos D1 mini.
Hope I also can get the code.
I will send a pm to Sweetpants (edit: not succeeded)
Kapee
Posts: 13
Joined: Sunday 09 April 2017 21:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by Kapee »

Still no reaction from Sweetpants, hope he will come back to this topic once more.
Not possible to send a pm to Sweetpants by myself . . .
edit: after this post reply, I can :D
Kapee
Posts: 13
Joined: Sunday 09 April 2017 21:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by Kapee »

Unfortunately I am not familiar with the C compiler for the software, so I could not use the software from Sweetpants, sorry for that.
Normally I work with Arduino ide and the last couple of month I use the wemos D1 mini.
I wanted this wemos D1 mini build in in the cheap Chinese power meter and flashed with the Arduino ide.
As level shifter for the signals from the power meter print to the wemos, I used two resistors as a devider (5V -> 3.3V)
So back to the Blogspot of Kalle Hagström and make use of his routines for the power meter.
I succeededd and after all it was not a hugh problem to implement the routines.
A big advantage the solution with the wemos is 'Over The Air' (OTA) flashing and no push button(s) for flashing.
As I said before I don't use Domoticz, but I make a dashboard with Node-red.
20170512 nodered.JPG
20170512 nodered.JPG (34.69 KiB) Viewed 5591 times
20170512 pwrmtr.JPG
20170512 pwrmtr.JPG (36.29 KiB) Viewed 5591 times
pj-r
Posts: 140
Joined: Wednesday 17 December 2014 17:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by pj-r »

How accurate this is with inductive loads like motors?
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors
SweetPants

Re: Cheap Chinese Power Meter made wireless

Post by SweetPants »

pj-r wrote:How accurate this is with inductive loads like motors?
Don't know, but what do you expect from a 11 euro device :mrgreen: :mrgreen:
littlewouter
Posts: 4
Joined: Monday 15 May 2017 11:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by littlewouter »

I got exited by this threat and ordered this KWH meter. However, the model I received is different inside:
IMG_20170515_175131.jpg
IMG_20170515_175131.jpg (207.33 KiB) Viewed 5526 times
IMG_20170515_175107.jpg
IMG_20170515_175107.jpg (143.34 KiB) Viewed 5526 times
As the pictures show, the pins SGND, VCC and FREQ still exist, however now there is TX, RX and an unlabeled pin. I measured the pins and the FREQ pin still outputs a 50Hz frequency, TX does outputs something and the unlabeled pin outputs 12V when the socket is connected to the grid.
The TX and RX pins indicate that it's a serial connection and therefore I connected it to a serial program. However, no commonly known baudrate outputted something useful unfortunately. I will now order a logic analyzer to understand the signal.
The PCB seems different than the older KWH-meters. I'm not sure if the IC is changed, my IC was somehow damaged so I couldn't read the text on it.
SweetPants

Re: Cheap Chinese Power Meter made wireless

Post by SweetPants »

Rx/Tx are not regular serial ports using a specific baudrate, you have to sample the data against the clock (see original articles http://www.domoticz.com/forum/viewtopic ... 325#p49060)
littlewouter
Posts: 4
Joined: Monday 15 May 2017 11:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by littlewouter »

Yeah I read the other posts about this KWH meter, but the thing is that my KWH meter does not seem to have a clock pin. If there is no clock pin, the only other possibility to communicate data is with a set baudrate. In this way both communicating devices know at which times the 0's and 1's are valid data on the Tx and Rx lines.
SweetPants

Re: Cheap Chinese Power Meter made wireless

Post by SweetPants »

What model did you order?
Kapee
Posts: 13
Joined: Sunday 09 April 2017 21:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by Kapee »

I ordered a second power meter, because I wanted to do some more tests.
I received the same as littlewouter.
It looks like that there is a redesign of the pcb of the power meter. The pcb is much more simple.
But for me it is unclear which chip is used.
Tomorrow I get a separation transformer and will do some measerements on Tx end Rx
Kapee
Posts: 13
Joined: Sunday 09 April 2017 21:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by Kapee »

Well, after a couple of days working on this second power meter, I have it working.
The first thing I did, was to find out which chip was used.
With the help from circuitsonline https://www.circuitsonline.net/forum/vi ... 40#1914040 it turned out that it was a V9261F chip from Vango.
After that I found a soft serial library on Github that could be used https://github.com/plerup/espsoftwareserial
Then I did some measurements with a separation transformer and a logic analyzer.
Pwrmtr2 LA.JPG
Pwrmtr2 LA.JPG (19.96 KiB) Viewed 5252 times
What you see is the RX and TX signal every second. TX is the signal from the V9261F chip. The second burst contains the value for volt and watt.

Then I made the software with Arduino ide including mqtt for the Node-Red dashboard.
Pwrmtr2 (Small).jpg
Pwrmtr2 (Small).jpg (36.05 KiB) Viewed 5252 times
Pwrmtr2 nodered.jpg
Pwrmtr2 nodered.jpg (37.23 KiB) Viewed 5252 times
As a bonus I also made code for the frequency, but here in the Netherlands it is always 50.0 Hz.
SweetPants

Re: Cheap Chinese Power Meter made wireless

Post by SweetPants »

Great job, well done. Are you sharing the code somewhere?
Kapee
Posts: 13
Joined: Sunday 09 April 2017 21:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by Kapee »

Thanks, it was nice to do.
I will share the code here.
Attachments
powermeter.zip
(28.57 KiB) Downloaded 396 times
MaxwellHatcher
Posts: 1
Joined: Monday 12 June 2017 0:30
Target OS: Windows
Domoticz version:
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by MaxwellHatcher »

Kapee wrote:...I will share the code here.
Hi. Wanted to thank you all for this post. Just got a couple more of these and they are the new design. You saved me a lot of work!

I have a dumb question though. Why don't you take power directly off VCC of the PCB?
SweetPants

Re: Cheap Chinese Power Meter made wireless

Post by SweetPants »

MaxwellHatcher wrote:I have a dumb question though. Why don't you take power directly off VCC of the PCB?
As said in teh first post, the on-board PSU does not deliver enough power. When transmitting, the ESP can use 200mA, way too much for this PSU
littlewouter
Posts: 4
Joined: Monday 15 May 2017 11:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Cheap Chinese Power Meter made wireless

Post by littlewouter »

Great work! Thank you.
I got it working and via node-red I translate the MQTT to a domoticz electricity meter.
I understand that the V9261F chip only measures watt and volts and that these are communicated to the LCD unit which keeps track of the kwh's.
So unfortunately it is probably not possible to read-out the stored kwh's in the meter. However, there must be a way to calculate this from the obtained watt measurements, just as the meter itself is doing.
This can be done in the arduino/ESP8266 or domoticz itself. In my opinion it is more useful to do this in domoticz, since then this can keep track of the total, daily and monthly kwh-values. There are probably some scripts already available for this, any suggestions?
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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest