Homebrew IoTaWatt

Maybe, is input 0 still configured as a VT?

Here’s an hour and a half of a production IotaWatt with two VTs:

I deliberately calibrated voltage_2 low so they would not overlap. Voltage 2 is on input 1.

All readings, whether voltage, power, or energy, are the average over the measurement period. In the case of the graphs shown, that period is 5 seconds. So any intermittent problem that causes zero will not necessarily show up as zero unless it is zero for the entire measurement period. The readings of about 190 suggest a zero reading for about 800ms or so during the interval, either as a single outage or a series of smaller ones. If you are sampling say 4 channels, the sample interval for one channel should be around 120ms - so zero for 5 or six of those.

To further complicate the problem, voltage channels are implicitly sampled when an associated power channel (CT) is sampled. So if channel zero is reference for say 4 power channels, but channel 1 (or 2) is not a reference voltage for any power channel, Channel zero will have a much greater frequency of measurement and will be affected much less by any brief duration lapse of say, the bias voltage.

I point this out because these graphs do indicate that channel 0 is affected, just not as much, which is what I would expect it is also a reference for power channels and channel 1 not so much.

To continue this discussion, could you start a new thread titled something like HomeBrew IotaWatt issues or something that distinguishes your project from discussions relating to the production hardware?

@overeasy
I did some more tests but i could not find what’s going wrong when unplugging the VT.
However i found some strange things when using 2 VT (channel 0 and 1, both have 6 CT):

  • unplug channel 0 and keeping channel 1 plugged in ==> everything falls to 0 (replugging without restart does nothing)
  • unplug channel 1 and keep channel 0 plugged in ==> no problem BU when replugging channel 1 everything falls to 0
  • unplugging both ==> everything falls to 0

Another question that i have is about “sharing” VT’s between multiple IotaWatts.
Can i just use a splitter to connect one VT to 2 inputs of different IotaWatt boards or will they create some kind of interference?

I’ve never tried to share a VT, although I think others have done it. Couple of caveats:

Be sure the polarity of all the plugs is the same. In barrel side of the jack sees ground through a 10uf cap (the cap on the bias net), so if the devices were to become connected to a common ground, the AC would short through the caps if different polarity.

I haven’t seen your schematic or board, but since you wired two additional voltage inputs, make sure the polarity of all the plugs is the same.

On my home IotaWatt, with a second VT on channel 14. Configured one of the CT channels to reference the second CT.

  1. Unplug channel zero VT and keep channel 14 plugged in. Channel zero and all of the power channels that reference it go to zero. Channel 14 and the power channel that references it are unaffected. Plug channel zero back in and everything comes back to normal levels. Did this several times.

  2. Unplug channel 14 and leave channel zero plugged in. Channel 14 voltage and the associated power channel go to zero, everything else in normal. Plug channel 14 back in and it reads normal and the associated power channel reads normal. Did this several times.

  3. unplugged both VTs. Everything goes to zero. Plug them back in and everything comes back.

There is something weird going on as either VT comes back (takes a few display cycles because the display has damping), the other seems to dip and increases back to its normal level - sort of in sympathy with it’s IotaMate. I plan to investigate this phenomena, but its not anything like what you are experiencing.

I added the second VT channel, configured some CTs to reference it. Did all of these experiments, and the thing is still running, and has been for ten days straight. No restart has been needed.

Thanks for your reply. A few questions since it seems only to affect my Iota :thinking:
Is your testboard version 4.3 with the seperated bias for the VT’s? (i use 4.1)
How did you connect the second VT?
Could it have something to do with bridging the 10uF caps (C9 on your design)

My schematic i identical to your 4.1 version, only with the part for the VT duplicated 2 more times (and removed 2 CT’s that were connected tot ADC11 and ADC12). Nothing else was changed.

I’m happy to troubleshoot software issues that I can replicate on the hardware. If they turn out to be hardware issues, at least the device is on my bench, with my instruments ( voltmeter, oscilloscope, etc) and I can take a methodical approach.

Here you are presenting a new problem but you have not resolved the problem of a few days ago where the voltages were randomly dropping. My approach is to assume things like this are related. For example:

In the last round of trying to insulate the software from VTs that were not running, I put in check before sampling the VT. The software looks for two readings from the VT that are 20 counts different with a timeout of 2 milliseconds. That’s not a big difference, and noise could easily satisfy this test.

Now you have this other problem that is intermittent low readings on your VTs that has not been reconciled, but it appears to be a bad connection someplace.

There are tools built into iotawatt to look at the quality of the signals. They are not yet available through the app, but you can get to them with a URL command in a browser. One such tool returns all of the samples on a channel for one cycle. That’s what I used to get to clean signals in my board design.

The op-amp can oscillate. You have substituted different capacitors, have a different board layout, and probably use different tolerance components. 20 ADC counts isnt very much noise. The oscillations are typically at a harmonic frequency of the AC line. You have three phase with several frequencies. If your circuit breeds oscillation, the combinations are endless.

All that said, you might try to find the zero detection code I mentioned (it’s in two places) and increase the number of counts (from 20 to say 200) and see anything changes. Look at the samples for a CT with nothing connected. If the opamp is oscillating, you will see there.

I’m not an electrical engineer. I’ve learned all this through a lot of experimentation over the last year. When you say nothing is different or it’s the same except, you ignore the fact that it is different by virtue of the fact that it is working differently. The differences are enormous.

Found the problem with VT1 taking out everything :slight_smile: … and it’s quite stupid… :face_with_raised_eyebrow:
I was powering the IoTaWatt from my pc, to be able to see the serial terminal.
When powering it from a mains adapter (2A) the problem is gone… unplugging and replugging the VT now gives the same behaviour as yours (falling to 0, coming back and a minor influence on the other one).

Maybe that an extra cap on the 3.3v and 5v line could solve this?

I will monitor the other problem (the missed VT cycles) when powering it from the mains adapter, maybe it’s also power related.

When the rest of the components for the second Iota arrive i’ll give it a try to share a VT between 2 boards. The layout is identical, so gnd should be gnd, but i’ll double check to be sure.

Get a powered USB hub. I have a couple of these from Amazon: Amazon Powered USB hub

Very clean power.

The Iota has been running for 2 hours now and i cannot see anymore spike differences between VT0 and VT1. They must have been power related also.

Nevertheless the problem was not at all in your design or software it has taught me a lot about the firmware. I can’t say that i understand everything (maybe not even half) but it"s very intriguing how it’s put together! Everytime i look at it i’m finding something new and always think 'man thats clever and well done" :wink:
I’ll keep digging :wink:

I should get a usb hub , i know :wink: i moved the one from my pc to the garage to power everything over there a couple of months ago but didn’t replace it.

That’s good. Much as I might like new members to my fan club, I think you have potential to join the team and contribute.

@overeasy : i i would use a shared VT between 2 boards. Would it be a problem if one of them used “BIAS” and the other one “ACBIAS”? Or would it be better to both use BIAS? (changing the pcb to introduce ACBIAS on a blank pcb is doable, but more difficult on an already soldered one)

Moving conversation from IoTaWatt 4.0 Thread to here : IotaWatt 4.0 - #97 by overeasy

I plan to give it a try and see how it goes when all the parts arrive.

The basic idea is using an op-amp to do a differential to single ended conversion. I am also a bit skeptical as I still don’t fully understand how it overcomes the problem you described, as there is still a point where we attach a kind of bias to the AC in the positive input of the op-amp, but apparently with the high impedance between the circuits and the filtering basically offered by the power circuit it eliminates problems. I am sourcing parts now and drawing it up properly.

If it works out, I will certainly post it up. Actually I might post it up once I have completed drawing anyway and see if anyone has feedback.

As also mentioned, there will be problems of loading on the transformer causing distortion in my measurements. Again, I plan to use a few tests to try and quantify the impact of that distortion and see if there is some software solution to model it and filter it out. I have not done my research on this yet, but I think I may need another inline on PCB current measure for the AC line to be able to more accurately model the impact on the 9V AC transformer as I draw more load.

My plan is to get everything I need to build standard IoTaWatt 4.0, and also buy bits to experiment on a breadboard. If my experiments fail, then I have all I need to produce something that is known to work so its not a complete loss and hopefully I learn something in the process.

Sounds OK, but can’t be sure without seeing the schematic. Careful of that polarity, especially if you share a DC supply (like both connected to the same USB hub).

I am about to order some CT’s, what CT’s would you recommend perform best with IoTaWatt (probably ones you already have basic calibration settings for)?

I was going to get the SCT-013-000 but reading through some of your comments, you suggested earlier that you found other CT’s performed with better linearity and phase shift, but couldn’t find which models you measured.

I am running in Australia 240V@50hz single phase and will want to monitor on the grid (100A), solar (50A) and then a few individual circuits (20A). If there is no significant difference in accuracy then will probably go for 100A everywhere.

I am going to start with basically vanilla IoTaWatt to get it going then do my homebrew changes from there.

50A solar? How big is your inverter?

Lol yep. It is a gross over estimate :slight_smile: 5kW @ 240V = 20.8A Probably 30A is sufficient.

The SCT013-000 work fine if accuracy is your only issue. I’ve tested a lot of other CTs so that I could put them in the IotaWatt tables to be easily configured.

That said, it does make sense to use a CT that is matched to your current range for better resolution. The solar-edge inverter input that feeds the solar use graphic that I posted uses a $2 HWCT04 solid core CT that has a range of about 41A on the IotaWatt - just about perfect full range on that PV system that puts out just under 8Kw on a cool bright sunny day.

Here are the other factors that would drive my decision:

  1. Price. You can pay a small fortune for a Dent or revenue grade brand name, but at the end of the day, most of the CTs I’ve tested seem to get a result within 1% of a revenue grade meter.

  2. Form factor. This is huge for me because I have a US 200A panel that doesn’t have a lot of extra room inside. The SCT013-000 is big and clunky compared to some of the alternatives.

  3. Ease of connection. Installation goes a lot easier with a healthy length of good quality lead with a 3.5mm stereo jack. The SCT013-000 have that. Few others do. I have resorted to buying inexpensive 3.5mm patch cords to make leads for those cheap HWCT04s.

To round out the choices available, we have been looking at the SCT006 and SCT019 for IotaWatt. They are full range at 33A and 250A respectively. They can be supplied with the same 1M 3.5mm jack that comes on the SCT013-000 and they can have TVS diode protection.

Both of those, along with the SCT013-000 can satisfy most requirements when connected to IotaWatt, and as with all the others, need only be plugged in and configured by selecting it from a menu on the app. No resistor soldering or calibration required.

Not sure when they come available, so using SCT013-000 is still a reasonable choice if your panel has room for them, and since you are a DIY board, you can always up the burdens to increase the resolution. The software lets you specify the value of the burden on each channel and will compute the proper cal factor for an SCT013-000.

For instance, if you put 47 ohm resistors on a few inputs, they would become 42.5A inputs with SCT013-000 CTs with a little more than double the resolution. Just tell the app what values you supplied, and it will do the rest.

Thanks for that I have ordered my Cts and just waiting on everything to arrive.

One other question

How does iotawatt 4.3 currently detect if a CT is plugged into it?

I noticed that you are using 3.5mm TRS socket with switch but the switch is just bringing ADC to BIAS

This means nothing plugged in has same reading as plugged in but no current.

Does Iotawatt currently try and detect plugged in sockets?

No, it does not differentiate between plugged and unplugged. sampling of the input is based on whether it has been configured. If it is configured and nothing is plugged into it, it will simply sample as zero watts.

The reason for the shorting switch is for the case where the burden resistor is removed to use voltage type CTs (external burden). In that case, if one is configured but not plugged in, iotawatt will report zero watts.

Automatically detecting and sampling channels is impossible without knowing the details of what is actually plugged in. That’s what the configuration provides.

Sampling a configured but unplugged channel is really no problem at all.