Strange cyclical voltage fluctuations on esp32 with sct013-030

I’m struggling to understand what’s going on there. I rather wish you’d give me raw numbers instead of the plots where I don’t know what the scaling is - both ways. Is the X axis seconds or what?

That of course is true, but what you’re measuring is quite a low voltage, and it’s all dependent on electrical noise not making its way into the ADC. One possible source is the 3.3 V or 5 V supply you’re using for the ESP32, a second is the ESP32 itself will generate some noise, that must be adequately decoupled, and the third major source is other equipment. Anecdotal experience says that a plugboard construction almost always has a problem with noise, so I’d expect to see a residual value even when there is no current flowing.

The “inverse” relationship is down to averaging - I think it’s trying to tell us that even 100 ms averaging time is too small. Our standard for the emonTx using emonLib is 300 ms. If you do extend it, check that you aren’t getting overflow in the accumulators, and if necessary increase the size of the variables in emonLib. Alternatively, you could put a delay inside the analogRead loop, so that you are sampling the current rather slower than every 12 µs. You could afford to push that out to something like 10 times that and you’d still have more than enough accuracy.