Can I use my doorbell transformer to measure voltage for real power measurement?

Ok so I’m now monitoring everything in near real time and updating my Vrms/Irms/etc every 20 crossings of the AC wave. Seems to work pretty well! :sunglasses: Neat seeing my values on the LCD updating ‘live’

2 Likes

I’m having an outlet added near my panel that I can plug this into… should I have one outlet for each 120V leg coming into my house? I just thought of it now but would the voltages be different on each one?

Yes and yes. For the second yes, the word on the street is the voltage difference between the two legs won’t be much, because the installer will have tried to balance the loads so that each has roughly the same load - but of course in practice this will never be the case.

So for what it will cost to have 2 installed rather than one, go for it. It’s only materials and the time to wire 1 socket extra to pay, no extra travelling and it won’t take any longer to run 4 wires than 3. Then you can get a proper reading for everything, 120 V loads on either leg and by measuring both voltages at the same instant and adding, you can use the right voltage for your 240 V loads.

Just be careful when you have both legs in the same place. 240 V doesn’t worry me, we have 240 V L-N and L - E, but if you’re not used to it, it’s that much more danger you need to be aware of.

1 Like

Excellent. I’ll get one per side. Thanks!!

@Robert.Wall I’d like to measure THD with my device since I have a GenerLink and can power my home from a generator and I think it’d be useful to see the THD of the generator when it’s running. I’m going to do some reading to see how to calculate it but I figured I’d ask you first in case you knew of any existing code on here or something that may keep me from reinventing the wheel :slight_smile:

As far as I can recall, I’ve never seen anything to measure THD here using OEM kit. And the reason is that generally, we can’t sample fast enough or store enough data (until we started using the -DB series processor).

I’ve used either a Windoze PC Oscilloscope and laptop sound card or, since I got a real DSO, this to sample the waveforms and then move the data into a spreadsheet. There’s a link to it somewhere :thinking: ZMPT101B, powerfactor and current shown - #52 by Robert.Wall but this only does the harmonics individually - though it’s trivial to sum them. This is how I measure transformer phase error.

I haven’t got a feel for what the ESP32 can do, so I can’t offer a suggestion as to whether it’s doable or not.

1 Like

thanks for the info. I think I have the processing power but maybe not the memory if a lot of data has to be stored. There are options to add up to 16MB of external memory and of course flash and stuff like that but I didn’t do that on my board. I’m currently sampling my current&voltage sensors around 2400 SPS each. I can probably get a bit more out of them with some code optimization. They max out at 3300 SPS.

Theoretically, with this sample rate, you should be able to measure up to the 20th harmonic, which shouldn’t be there at all, so lets say the 17th or 19th. If you can run at this speed for a cycle, and then process the data, you may well be able to get a good indication of the total.

sounds like something to experiment with while I wait for my PCB’s to arrive from China :smiley:

I do something similar in my energy monitor, although I tend to focus on the Current waveforms rather than the voltage. That produces pics like these.

I get 24-bit values from my ADCs at 8K SPS. When I want to look at distortion I fetch 480 of them, so about 3 cycles worth at 50Hz, and then ship them off to a “server” for FFT processing. Actually, the above pics were from an earlier version that could only do 4K SPS. The latest version does 8K.

I found some generic fft code on the interwebs to do the maths. I’ll post a pointer soon.

Thanks for the info. I’ve not done any work with FFT processing. Is doing it onboard an ESP32 out of the realm of possibilities or is it too compute intense? I see a few FFT libraries made for the ESP32 so I’m guessing it’s doable in some fashion.

I think that just comes down to how much free time your processor has, and how urgently you want the results. I’ve got 36 I-channels and 3 V-channels, each of them spewing out 8,000 24-bit numbers every second. There’s no way I’m doing continuous FFTs in realtime on all that data. My FFTs are strictly “by request”. I pick a channel of interest and request the data. The only realtime aspect of that is capturing the data. After that, the capture gets sent off via UDP to a “server” which comes to life when it sees the incoming capture, does all the maths and then uses gnuplot to create the pics, and then emails them to me. The server is currently an ancient original retired RPi so not high performance by any stretch, but it can take as long as it likes to do its thing.

Been making good progress.

Designed and had a PCB made (don’t laugh at my through hole and breakout board goodness, I don’t have the gear to do surface mount yet :cry:)

Currently designing and printing an enclosure for it.

I have it broadcasting an MQTT message every second with the power stats. Stuffing those into InfluxDB and using Grafana to create a power dashboard. Also incorporated the data from my weather station as well. Still a WIP but coming along nicely

Data overload when I have everything plotted

2 Likes

There’s nothing wrong with through-hole - I assembled a few emonTx V2s, emonGLCDs and NanodeRF. When I started, pcb layout routing was done by hand, the tracks and pads laid down with black tape on draughting film at twice full size, photographed and reduced to final size.

1 Like

It’s pretty wild that now we can have a custom PCB manufactured and in our hands in a week eh?

Looks neat and clean. It does the job. Nothin’ wrong with that.

thumbs_up thumbsup

1 Like

been running my unit long enough to be able to compare with what my utility reports as my energy use. White boxes are the official numbers from them. I’m quite happy with the accuracy. I’m wondering if I should tune my calibration values slightly to try to dial it in even closer?

Where did you obtain your calibration values? If they ultimately came from numbers on component data sheets, remember every component has a manufacturing tolerance, and those in the signal chain will affect the calibration in varying amounts. If you’re lucky, some will send it wrong one way and others the other way, and overall the effect will be small. But there’s no guarantee of this. All you can do is either use components with the tightest tolerances (when it might still be wrong but less wrong), or adjust the calibration afterwards against a known good standard.

In your case, unless you beg, borrow, steal or hire a “known good” instrument (this could get expensive), your best option would be to tweak the calibration over time to agree with your supplier’s meter. This might not be totally accurate even so, but the metering accuracy data should be available to you from whoever regulates the suppliers where you live. Or as I’ve written many times here “Your supplier’s meter is by definition totally accurate, even if it isn’t.” (because it’s readings are accepted as being the truth, and are the basis of your bills).

Yeah that’s kind of my thought… the power company’s gear is what I’m being billed on so that’s where I think I’d like to align my readings even if they don’t necessarily align 100% with my test rig setup (which in itself is going to be inaccurate to some degree). I measured every resistor with my meter to get it’s resistance before soldering my board and I’m using those measured values while calculating my calibration constants. I’m sure those values fluctuate a bit with temperature.

I think what I’ll do is what you said and just slowly tweak the calibration over time to align with the utility’s readings. I can export the readings from the utility so it might be a fun project to feed that data into my system and have it automatically adjust itself to keep in alignment. Have it self correct and self validate :sunglasses:

This has been such a fun project. I’ve learned and am learning so much. I can’t stress enough how much I value you and @Bill.Thomson sharing your knowledge with me.

1 Like