💬 Door, Window and Push-button Sensor
-
Thanks for fast reply, actually 900nA is to big number and i prefer to use xxx_POWER_PIN to cut the power of the NRF module.
I am building switch powered with CR2032 battery and i want to extend battery live as much as possible, for a switch is not needed to keep radio alive, i need it ON only when transmit signal -
Thanks for fast reply, actually 900nA is to big number and i prefer to use xxx_POWER_PIN to cut the power of the NRF module.
I am building switch powered with CR2032 battery and i want to extend battery live as much as possible, for a switch is not needed to keep radio alive, i need it ON only when transmit signal@tiana 900nA on a cr2032 is 27.9 years battery life. The self discharge of a cr2032 is around 250nA.
But yes, use the power pin setting if you want to.Would be interesting to see how long sleep times are needed to make up for the extra time needed to wake up the radio from power off compared to sleep. The mcu and the radio will need to be awake for 100ms longer time when starting from power off than when starting from sleep.
-
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);