Need settling time for sct-013-030 (Used w/Nodemcu)



  • My project involves sensing the current on my washing machine (115VAC). If statements will check for zero amps and 2.5 amps or greater up to 30 amps. Unfortunately during power-up or reset the com port displays some garbage current reading and need to figure out how to allow the readings to settle to close to zero before continuing to on. Here are the initial power-up or reset problematic reading:
    Current ON
    75.01
    Current ON
    16.88
    Current ON
    3.98

    After this settles the reading start to report steady current reading. The only problem if the current does not settle out close to zero from the start it will cause false "IF" statement triggers.

    Here are the results after the current settles out. I turn the load on and off to show the current reading.

    Current ON
    2.51
    Current ON
    2.55
    Current ON
    2.52
    Current ON
    2.50
    Current ON
    2.55
    Current ON
    2.40
    No Current
    0.17
    No Current
    0.04

    Here is the unfinished code.
    https://pastebin.com/kDjx5zQM


  • Mod

    @goddur Hi, and welcome to the forum!
    So what exactly is your question/problem?

    If it is the time until you get a stable reading after reset of the Arduino, you could just count the time until you get a stable reading.
    Then include this delay after startup before reporting the first value and you're done.
    Something like:

    static int startupCycles = 10;   // 10 seconds initial startup delay
    void loop()
    {
       delay(1000);
       Irms = emon1.calcIrms(1480);  // Calculate Irms only
     
       if (startupCycles)
       {
         --startupCycles;
         return;
       }
    
       if (Irms < .2)
       {
          // your original code...
       }
    }
    

Log in to reply
 

Suggested Topics

5
Online

11.4k
Users

11.1k
Topics

112.7k
Posts