• Hi!

    Just wondering, is the portal connected to the inverter via modbus? If so you might be able to use an Espruino with a Modbus adaptor to just 'snoop' on the traffic between the two?

    But if not then yes, what you'd planning should work. You'll get an AC signal out of the current transform clamp (I'd check what kind of voltage it outputs just to see if it's safe to connect direct to the Pico or if you need to use some resistors to divide it down).

    Since it's AC, you'd want to put two resistors between the 3.3v and GND to give you a 1.65v signal that you could connect one side of the clamp to, and then connect the other side to the Espruino's ADC.

    To get a basic reading you'd want to find the peaks (although to to it properly you'd want to use the Waveform class at maybe 1000Hz and then use E.sum and E.variance on the result). I guess simply you could do something like:

    var hi = 0, low=1, r;
    while (r=analogRead(AC) > hi) hi=r;
    while (r=analogRead(AC) < low) low=r;
    var power = hi-low;
    

    I think commercial offerings measure the voltage and the current at many points over the AC waveform, then multiply them together and sum them all (because just looking at current it's actually very difficult to tell which direction the current is flowing). It's possible with Espruino but is probably a bit heavyweight and means fiddling with mains.

    Another option (if you have access to the wires from the PV converter) is to put something like this in-line: https://www.ebay.co.uk/itm/Reading-Energ­y-Meter-LCD-5-30-A-Single-Phase-DIN-Rail­-Kilowatt-KWH-230V-BI042/162894990103?ep­id=16016024547&hash=item25ed4c4b17:g:nRg­AAOSwnsRafddf

    Cheap, and it has a really simple isolated output on it. Basically it shorts out for a fraction of a second for every 500W/h of energy going through it, so all you have to do is count the times it shorts out - it's super easy, safe, and calibrated.

About

Avatar for Gordon @Gordon started