Will update parts in a few days. The MCP3208 can be substituted for the MCP3008. They are only a few cents more and have 12bit accuracy vs 10 for the 3008. The latest program auto detects which is installed.
There are a few other changes coming in the next board layout (see previous post), so stay tuned. I need to order another batch of three proto boards - probably next week.
Not quite true: The phase shift will be different, depending on the system frequency, because it depends on both resistive components and reactive components - it is the latter that change their value with frequency. Therefore a phase shift measured in a 50 Hz world will be valid anywhere in the 50 Hz world, and a phase shift measured in a 60 Hz world will be valid anywhere in the 60 Hz world. But a phase shift measured in a 60 Hz world will not be correct in the 50 Hz world, and vice versa.
Between several posts, we’ve got qualitative and quantitative statements about this. dBC, can you elaborate when you get access to your data? In particular, I’m curious to know if you are talking about a net phase shift of 1deg or a measured phase shift difference in the CT only? I suspect the former, and at this point think the most significant part of a net difference is probably the VT shift because most of the 50Hz countries I see are high voltage (~230) and most of the 60Hz are 120V. If that’s the case, the IoTaWatt can calibrate the phase shift of the VT. That’s one of the reasons why it was designed to net the factors of the two sources of shift.
Also, as it turns out, determining phase shift between two (basically) sine functions is pretty simple and very accurate. So I’ll be adding a way to measure the net shift as a way to validate the discrete factors. So using a unity power factor load of significant power you will be able to measure the net shift.
That bit I can answer now. It’s the net phase shift but I don’t use a VT, so I think the different phase errors I see between 50 and 60Hz is pretty much all down to the CT. There are anti-aliasing filters in both the V and I paths, but they’re nominally identical, so I wouldn’t expect them to contribute much to the difference.
I take a slightly different approach to measuring the phase error. I feed the IC two perfect sine waves that are 60.000 degrees out of phase, then I measure Real and Reactive energy over a 20 second interval. The difference between 60 and arctan(Real/Reactive) gives me the phase error. The reason for going for such a big phase shift and longish interval is to ensure that both numbers (Real and Reactive) are big before doing the divide, so as to minimise the quantisation errors you get when dealing with small numbers.
Then I just feed the resultant correction into the all-pass filter in the IC. The resolution of that filter coefficient is about 0.000002 degrees, so if your calibration equipment is up to the job, the IC can make extremely fine adjustments in phase error. Unfortunately, it’s a constant adjustment for the entire current range which I suspect is the weakest link by far (well, the ability of your CT to match that assumption is the weakest link). I calibrate at 1/10th the maximum current, so for example I calibrate my 20A CT at 2A.
That sounds like the algorithm described by a guy from TI for their power measurement chip. I don’t recall the product code. I used a variant of that algorithm in earlier testing. What I do now is numerically add the corresponding “slices” of both signals and develop an rms amplitude of a combined signal, and then solve the basic phasor diagram triangle for phase difference of the original two signals, knowing the length of all three sides and using the law of cosines from my pocket ref. It seems to work pretty well when the signal is sliced into 500 pieces. Are you getting the 60 degree signal by combining two of three phases?
I’d like to test one of those CTs at 60Hz, if you could post the make and model I’ll try to pick one up if I don’t already have one.
I agree that the low end phase variation is by far the weakest link, especially in residential power measurement where low currents are more the rule than the exception. Even in my 120V world, I have a few circuits where I double the primary to get more accuracy and less phase-shift at the low end, and 230V doubles the problem watt-for-watt.
The power calibrator lets me set the phase difference between V and I, so I just set that to 60.000 degrees. I’m pretty sure the CT is one of the CTSA010 series from this datasheet: CTSA Series Split Core Current Transformers.pdf (905.2 KB)
Yes, I will be maintaining the schematic using the format now on github. I just ordered a few more boards, and made a few minor changes. I’ll update the schematic soon. There are no new components, only some changes to a few traces and a couple of jumpers to try out some new ideas.
I’m interested in what kind of unit cost you can get from another vendor in modest quantities, and also costs for completed boards. Simple testing software would also be fairly easy.
The 2x15 headers for the nodemcu were from eBay and probably needs a new source. The 2x10 is from Digikey.
Thanks Bill, but they must be female. I’ve got plenty for now, and they are always available for reasonable prices on eBay. It’s just that flywire was putting together a bom for his Eagle version.
I have started a fork with Eagle port of the CAD files. I am trying to minimize board size as well, so using smallest footprint IC’s and and SMD stereojacks in back to back mode. This will require some planning for reflow soldering but can definitely be done, I have done something similar in past projects.The incentive behind this is that my PCB fab house offers price breaks at the 50x100mm range and I am trying to keep it within that limit. Port is not 100% done, may be 85-90% should be complete soon.
2x15 headers are quite rigid but can be hard to find so I am using 1x15 headers which I ususally fudge by cutting the very common 1x40 strips down to size.
If you commit to one or the other of the nodeMCU, you can get by with single headers. There are some subtle differences between the two anyway and I’m not sure my solutions will stand up over time. (USB power vs 5V power, I just tied them together).
Regarding the stereo jacks, they are among the most expensive components, both in cost and PCB real-estate. I’m seriously considering going to screw terminals. The functional downside is that the jacks allow the software to determine if there is a sensor connected. That’s not a huge problem. The device senses zero pretty well.
The main reason for considering screw terminals is that the only CTs that seem to come with stereo plugs are the SCT013s. Even other YHDC units like the SCT019 come with wire leads. I have not seen any solid core CTs with stereo plugs.
I have been acquiring and testing more CTs and IMHO the SCT013s are just not that great. Virtually all of the units I tested have equal or better linearity, and all have significantly less phase-shift. The SCT013s are particularly poor at low current, which is what the IoTaWatt is intended to do - monitor individual circuits.
If you switch to screw terminals, try to make some ground terminals handy as they may be useful when I add software for things like 10K temp, 4-20ma sensors, and open/close switches.
Stay tuned as I am testing running the ADCs at 3.2V, which eliminates the voltage divider on the MISO line. There is also a RTC coming - probably SPI connected. (They are tiny, but the crystals add to the footprint and a coin battery will be needed.
Is there a reliability issue with using USB as a power source?
Seems worthwhile.
.
I’d expect that there would be times when you would want to remove the energy monitor without removing all of the CTs. What is the best way of managing the CT current issue? OpenEnergyMonitor: CT sensors - An introduction
What is the best way of managing the CT current issue?
[/quote]
Make sure the cable is not carrying current, unplug and short-circuit each CT.
(It ought to be safe without because the protection that should be inside should work. But a short-circuit is far safer, because then the CT is working under no-load conditions.)
Right now, the IoTaWatt is using the raw 5V from the USB adapter to power the ADC’s, so the quality of the 5V could be an issue. The next version is equipped to experiment with running the ADCs off of the 3.2V pins of the ESP8266, which should be cleaner. If the speed and accuracy aren’t impacted, and I don’t expect any problems, then the quality of the raw 5V will not be as much of an issue. The eMon people documented a problem with a super cheap adapter, so use your judgement. I’ve been using these from eBay for about $6 US. No problems.
The SCT013-000 CTs have protection diodes, so you can unplug them with impunity. Some other CTs have them as well. You can unplug any voltage type CT with no reservation. When you get to the true CTs without diodes, I guess they should be shunted when unplugged. I have to admit that I don’t bother with the relatively low currents that I use with my office gear, and have seen no noticeable damage or received even the most trivial shock from anything. I have a paper cup with some stereo jacks that have the terminals shorted, and I use them if I am disconnecting a CT from say a main in a panel, or even a CT from a relatively high current circuit (>20A).
One nice thing about the IoTaWatt is that I can change the ESP8266 without disturbing the CTs, and I frequently do. When I want to load new software into a deployed IoTaWatt, I simply upload it to a spare ESP and then swap it into the IoTaWatt. The configuration is on the SDcard, so it boots right back up and picks up where it left off. Takes about 30 seconds.
I wanted to thank you for all the work you’ve put into IoTaWatt. I have a 5,000 square foot house and have been monitoring overall energy usage for a many years now. I started out using rtlamr to decode the rf broadcasts from my meter. When my electric company switched to smart meters, I started looking for an alternative and found openenergymonitor.org.
The community at openenergymonitor.org has been extremely helpful with showing me how to start monitoring usage again along with expanding upon what I’m able to monitor. Due to the size of my house, I had been looking at ways to monitor every circuit in my house in the most consolidated method possible. I have 2 main panels that are almost fully populated along with 2 sub panels. One feeding my basement and the other feeding my garage/shop.
I’ve been playing around with ESP8266 modules for a while now so I figured they’d be the best method for monitoring usage. A quick search for esp8266 brought me to IoTaWatt. I’m eagerly waiting to see where IoTaWatt takes us. Thanks again!
The device currently takes two or three WDT (watchdog timer) resets per day. Research is ongoing to identify the cause. Nevertheless, the board reliably reboots and is running normal within 20 seconds, so not a critical problem.
From posts on the net there seem to have been a lot of issues that went away when people provided more power to the NodeMCU Development Board. I wonder if that is happening here.
One of the things I’m looking into. It’s the hardware wdt, so not much info available. As I write this there is one running on batteries - the gold standard for clean power. I’m still confident this can be solved, but with a mtbf of 12 hours, it will take some time.