Design question about using interrupts or not
-
Hi All,
Since this is my first post I would like to thank all who made MySensors possible!
In my development environment I have several setups as a proof of concept with all kind of sensors, relays, LCD and so on. It works great and I am about to begin in designing a number of permanent nodes but have some thoughts about whether or not use interrupts.
The node I am working on is based on a Nano and NRF24 radio. On this node there will be following connected: DHT22, DS18b20, LDR(analog), 2 relays and 4 reed switches.
The 4 reed switched are to monitor some doors. A reaction time on those switches of about 0.5 second is enough(i think). So my question is; Should I use interrupts or is it better to (semi) continuously check the switches and occaisionally check and report the other sensors.
I know I could use interrupts but since there are doors to monitor and not several 10.000rpm tacho's I would like to keep it as simple as possible.
Please let me know if you have some thoughts on this.
Kind regards,
Gerard
-
Welcome to the forum @gerard-van-seventer!
If the nodes have a permanent power supply (not batteries), checking the switches will be sufficient. You can probably check them every millisecond if you want - a millisecond is a long time for a microcontroller.
-
Thanks @mfalkvidd for your quick reply.
Indeed it isn't battery powered. I already have a millis() delay loop so checking the swithes is easy then.
Thanks again!
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Home Assistant/MySensors quirks
Development • 12 days ago • OldSurferDude 12 days ago -
MQTT-Help me understand about the MQTT Gateway.
Development • 27 days ago • dpcons 16 days ago -
Radio waking up for no reason.
Development • 4 Jul 2020, 21:09 • Sasquatch 15 Jan 2025, 08:33 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
Adding Listen only device to my system.
Development • 26 Feb 2025, 00:39 • dpcons 26 Feb 2025, 06:26