Menu

inversion of the on/off command

gph.giraud
2023-06-13
2023-06-15
  • gph.giraud

    gph.giraud - 2023-06-13

    Hello Robert
    I just made myEsp relay to control the opening of my observatories and I have a problem: everything works fine but the controls are reversed. When powered up the relay sticks and in NINA when the switch is on the relay takes off and when it is off it sticks
    What do you think ?
    Best regards

     
  • brownrb

    brownrb - 2023-06-14

    Yes,
    Look at the relay connections.
    There is the Power + Ground
    Then there is a group of 3 green terminals
    NO
    COM
    NC

    On some boards it might be
    OFF
    COM
    ON

    If your connection is currently
    NO
    COM

    then change it to
    COM
    NC

    First try that.

    Regards
    Robert

     
  • Philippe

    Philippe - 2023-06-15

    Hello Robert
    thank you for your reply
    The solution does not suit me because the unpowered relay provides an ON contact under these conditions and, on the other hand, the indications in the driver are incorrect.
    I modified the firmware so that the relay works in the correct direction:
    in the setup: "digitalWrite(RELAY1_pin, 1)"
    in "void writerelay1(byte newstate):"
    "{#if defined(ENABLEESPNOW)
    " slavemessage. relay1state = newstate;
    "#endif
    "relay1state = newstate;
    "if (newstate == 1){newstate = 0;}
    "else if (newstate == 0){newstate = 1;}
    "digitalWrite(RELAY1_PIN, newstate);
    }
    "byte readrelay1()
    {
    " return relay1state;
    }"
    the relay operates in the correct direction.
    cordialement
    Phil

     

Log in to post a comment.