How to make sure an relay is really switched?



  • Hi all!

    I am using running a serial gateway connected to OpenHAB, using the examples provided in the forum. I can switch an array on and off using the OpenHAB Controller.

    For a start my question is general in nature because I might not have understood something correctly. When I switch the array from the interface the rule I am using is sending the command and then updating the status in the interface. What I am wondering is, what if something goes wrong and the transmission is dropped or there is a bug so the array doesn't really turn on or off? Is there some way to check for this, only updating the status if the node reports success?

    Is this done on the controller or the gateway?

    I am getting "ack"'s back on the sensor node for data I send from the node to the gateway but haven't figured out a way for the other direction.


  • Hero Member

    Maybe use a double pole relay and use the second pole as the trigger to send a "success" message back? Or perhaps monitor the voltage difference between the contacts on a single pole relay, and send a "success" signal back when voltage goes to zero (indicating closure) or from zero to non-zero (indicating opening)? There may be better ways, and hopefully others will chime in with suggestions.

    I can see how that could be useful. e.g. If you sent a command to close an irrigation valve (or anything "mission critical"), you may want positive confirmation that the relay closed, not just confirmation that radio received a wireless command to close the relay.


  • Hardware Contributor

    Having an independent sensor on the thing being controlled is really useful if you can get it. That way the sensor gives you good information (is it on/off) as well as checking that the relay actually worked. FYI in the case of valves, I found some nice (but cost $30) actuated valves on aliexpress that have an independent sensor signal that tells you when the valve is open or closed which is really convenient (see this thread for info)


  • Admin

    @sharky0815 said:

    I am getting "ack"'s back on the sensor node for data I send from the node to the gateway but haven't figured out a way for the other direction.

    You can enable ack from controller side as well. Have a look at the serial protocol.

    No changes is needed in the sketch.



  • Ok, good ideas, as I am working on a ventilation project I thought I'd query the rpm of the fans as a hardware failsafe.

    Regarding the software ack @hek , I am not clear on this, is it up to me to react on not getting an ack or does requesting an ack automatically make sure the message is repeated until it gets trough?


  • Admin

    No, enabling ack does not repeat any transmissions. If you want this you have to code it in the controller.


Log in to reply
 

Suggested Topics

  • 3
  • 1
  • 24
  • 3
  • 2
  • 10

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts