Mutiple sensors with Interrupt



  • Hi All,

    I am planning to connect a 8 channel relay with arduino in a room. I am also going to attach a current sensor to each relay to know if someone has switched on a device manually(To know the state of the switch).

    As per my knowledge till now, only pin 2 and 3 of arduino support interrupt. If I have to send a message based on the manual operation of switch, that is current sensor reading the load and sending message to openHAB, how to go ahead with this. Am I missing something, can this be achieved ?
    Please help with any pointers on this.


  • Contest Winner

    @mainali

    you can use several inputs into one pin.

    Check out Nick's Example.

    there also exist "Pin Change Interrupts" which you can google. there are libraries available for using them.

    You may very likely do this completely without interrupts......



  • @BulldogLowell said:

    You may very likely do this completely without interrupts......

    I am planning to use current sensor with each and every switch around the house to know if someone pressed the switch. Is there a better way of doing this, then the one I am thinking.

    Can you please explain, what did you mean by I can achieve this without interrupts.


  • Contest Winner

    @mainali

    It would be easier if you showed the type of sensor, but basically, you would be constantly reading its output, and reflecting changes between HIGH and LOW (if it has digital output) or using analog thresholds.


Log in to reply
 

Suggested Topics

  • 1
  • 6
  • 3
  • 3
  • 1
  • 2

15
Online

11.4k
Users

11.1k
Topics

112.7k
Posts