💬 Door, Window and Push-button Sensor
-
Hi I notice that there is not sleep in this sketch. Is it not required for this build
-
Hi I notice that there is not sleep in this sketch. Is it not required for this build
-
Hi
Can i connect two sensor contact to this arduino ? First to pin 3 second to pin 4 ? But how modified this sketch to support two sensor contact ?@pepson If you need the node to sleep or want to use interrupts then only digital pins 2 and 3 will do this for uno/promini.
So otherwise 2 options really.
If you just need to know that one of the sensors triggered (but not which one) then you can add sensors in series (for normally 'closed' sensors) or parallel (for normally 'open' sensors).
To use interrupt and know which sensor triggered you'd have to connect both sensor to interrupt pin with blocking diodes to digital pins as well and then on interrupt you can check which digital pin activated the isr.
-
I need connect two contact sensor. And i want to know from two sensor his status...
I need use one to door but second to door garage.@pepson Then just add another sensor from ground to digital pin 2 and change the code you see in the example to accommodate the extra input.
You'll need to add another child id, another button, another bounce function, another presentation, another send and another bounce call.
-
@pepson Then just add another sensor from ground to digital pin 2 and change the code you see in the example to accommodate the extra input.
You'll need to add another child id, another button, another bounce function, another presentation, another send and another bounce call.
-
@pepson said in 💬 Door, Window and Push-button Sensor:
@skywatch
Yes but i dont know how do it.... :-(
I dont know programing.Not an excuse, it's time for you to learn :)
-
Perhaps it would be good to update the example code. I mean the pull-up sequence:
"It is recommended to set the pinMode() to INPUT_PULLUP to enable the internal pull-up resistor." - https://www.arduino.cc/reference/en/language/functions/digital-io/digitalwrite/
The following seems to be obsolete:
// Setup the button
pinMode(BUTTON_PIN,INPUT);
// Activate internal pull-up
digitalWrite(BUTTON_PIN,HIGH);