Mains Power Monitor

Use this section to discuss your embedded Flowcode projects.
chipfryer27
Valued Contributor
Posts: 1147
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Mains Power Monitor

Post by chipfryer27 »

Hi

I've just built myself a Mains Power Monitor as documented in the Free Apps.

Whilst testing it on my w8.1 laptop things went fine so I connected it around the Live tail in the Evil Lab. Wanting to measure over the course of a day or week this project seemed to fit the bill but I ran into a couple of issues.

Not wishing to leave that particular laptop tied up I first ran on a little W7 Netbook using the supplied Flowcode Runtime etc. After eighty something minutes the Netbook crashed. Figuring it was something auto-updating or whatever (hasn't been used in months) I restarted around 4pm. Next morning I discovered that it had crashed again after approx 4.5 hours.

Figuring that I was probably asking too much, I then used a W7 i5 Laptop that has FC installed (and runs it fine).

I had problems running the app developer file though. The little drop down box that you select your Network Interface wouldn't populate and was incredibly small. I could not get it to work at all. However by using the runtime it appeared to work fine. Network Interfaces populated and selected. Job done, or so I thought. Again after approximately 4.5 hours I ran into problems. This time the displayed "work panel" went "blank" i.e. no gauges etc are displayed at all but the Properties box is still shown. If I enable the Console I can see the Console Writer still updating every second as does the TCP/IP-NetworkComms1 so I assume it hasn't crashed completely.

Whilst I didn't expect too great an accuracy, comparing the displayed current versus that on a current clamp couldn't really be considered in the same ball park. Monitor claimed 0.327A versus 0.21. That's quite a difference (~50%) and I trust my clamp more than the module. The Power Factor also seemed a bit questionable at 0.56. The only thing I had connected and running were an Emergency Light, the router and a laptop.

However I did appreciate that I was at the lower limits of the module capabilities with the above so I switched on a few more PC's, the radio and the bay lights. The difference in current was then negligible at 3.12 versus 3.10 and the PF become a more realistic 0.93.

Has anyone else built one of these or had issues when monitoring for a few hours?

Regards

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Mains Power Monitor

Post by medelec35 »

Hi.
Yes. I built one.
I have even got a version that uses a TTGO ESP32 to directly display values including a resettable consumed energy reading.
I have also got a domestic smart meter and the smart meter matches the power monitor within a couple of watts and pf, voltage, current etc matched really well.
It has been running for weeks.
Martin

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Mains Power Monitor

Post by chipfryer27 »

Hi

That was going to be my next step, to include a display making it stand-alone, but I probably will wait until I can get it running a bit more stable the way it is first.

I also had initial problems with range. The ESP I'm using is one of those off amazon or such like and when mounted on a PCB near the router everything was fine but when I moved it to the tails, about eight metres away with only a single sheet of Gyproc between, the router couldn't see it. I had to create a PCB that is more large holes than board for it to work. First time actually deploying an ESP so it was interesting to note.

Glad to hear that yours has been running fine (I assume over WiFi ?). Quite possibly my issue is something laptop related but why it only affected the display is anybody's guess. I did have a Norton AV issue recently. Usually it doesn't cause much problems but recently they have annoying pop-ups every few hours "helpfully" informing that I don't have all features enabled, do I want to fix this? I don't and haven't yet found a way to stop it bothering me. I use this laptop to control my little CNC machine and if Norton pops up it screws the program. The code still gets sent and processed but it fails to acknowledge it has finished, requiring it to be reset/restarted. This then requires very, very careful resetting of home positioning. Turning off Norton completely allows me to complete a board without any issue. I'll try again with AV off to see if I can narrow down the display problem.

Regards

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Mains Power Monitor

Post by medelec35 »

Mine was running over wifi for months, the only issue was randomly losing connection with the broker.
This is an image from my standalone version side by side with my smart meter IHD.
Power monitor vs smart meter ihd.jpg
Power monitor vs smart meter ihd.jpg (129.38 KiB) Viewed 2004 times
The voltage in my area is always high.
The value is correct as my DMM also shows the same AC voltage.
This project is still WIP.
In the past, I reset the energy value via one of the buttons on the TTGO first thing in the morning.
Made a note of the energy value from the IHD.
later in the evening compared my energy monitor's total energy consumed with the IHD version and they were a perfect match!
Martin

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Mains Power Monitor

Post by chipfryer27 »

Hi

I like those TTGO boards :) However I should stop drooling and resign myself to using up everything I've "acquired" under the guise of needed for PoC so when I get around to it mine will probably have an eentsy-weentsy monochrome display of sorts. Possibly two as I have three kicking around... I can't recall why but I also seem to have many more 2 x 16 LCD displays than I ever thought I would. Really no idea why I got them though but I'm sure they were essential at the time.... :)

I don't yet have a Smart meter which is why I looked to build the monitor. I'm not 100% certain my dial is correct, although there really isn't much to go wrong with them. I read somewhere, possibly in an article by Barry Fox about electronic meters failing due to faulty components and subsequently recording higher than actual figures. I think it was something to to with capacitors and timing, so if and when I do get another meter my current clamp won't be too far away.

I see your PF is 0.66 which seems a little surprising.

My laptop (with the app gauges missing) recorded overnight and around 26 hours later dumped a file, so it just seems a display issue of sorts. Almost all the data was of little actual use as I was really at the lower limits for accurate recording as mentioned above. Still can't get the app to work using my installed version of AD, but it runs fine when used with the runtime supplied with the monitor. I'm going to reinstall FC when I get a chance to see if that helps.

Regards

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Mains Power Monitor

Post by medelec35 »

chipfryer27 wrote:
Sat Sep 10, 2022 5:50 pm
I see your PF is 0.66 which seems a little surprising.
How comes?
chipfryer27 wrote:
Sat Sep 10, 2022 5:50 pm
Still can't get the app to work using my installed version of AD
If you are struggling then I will see if I can assist you further.
Martin

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Mains Power Monitor

Post by chipfryer27 »

Hi

That power factor would suggest a very large inductive load is connected and if in an industrial setting would almost certainly warrant the installation of PFC equipment. It could just be that the device is at it's lower levels of reading. My PF was 0.5x with almost nothing connected but went to a more realistic 0.95 with a load of a few amps. Switch on some non inductive loads and see if it changes significantly (e.g. electric shower / toaster or such like). SMPS can also sometimes cause strange readings due to harmonics (especially if poorly designed).

Been a few years since I did anything at all re PF, and that was assisting an electrical engineer friend with some correction in a local factory. Off hand I can't remember their initial PF but I don't think it was anywhere near 0.6. I didn't want to be anywhere near the capacitors when initially switched in.... :) If I remember correctly they obtained a grant to be more energy efficient and this formed part of it.

I'll probably try reinstalling FC tomorrow sometime. App works fine on this machine but on the other laptop it will only run if I use the runtime that comes with the app. I'll let you know how I get on.

Regards

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Mains Power Monitor

Post by medelec35 »

That would be true if the power is a high wattage.
As my main lights are LED which uses cap droppers and monitors have high value caps in, the power factor is normal.
If I put the kettle, toaster or oven on the pf goes to 1
Martin

simon-sandtcontrols
Posts: 19
Joined: Sun Mar 21, 2021 3:56 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Mains Power Monitor

Post by simon-sandtcontrols »

Hi,

I haven't looked at the software at all but I am guessing that the PF in this case is capacitive and not inductive, again a guess, that the code hasn't included a way of showing which direction it's gone?

Simon.

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Mains Power Monitor

Post by chipfryer27 »

Hi

If I double click on the file it opens but I cannot select anything for Network Interfaces.

Capture-1.jpg
Capture-1.jpg (144.72 KiB) Viewed 1981 times

If I go to Programs/Flowcode9 and open FAD Runtime I can then load the app and select Network Interface. Same if I run the supplied runtime first.

Capture-2.jpg
Capture-2.jpg (122.99 KiB) Viewed 1981 times

No idea why this is the case but suspect my laptop. I've downloaded FC9 and will reinstall to see if it makes any difference.

Regards

Post Reply