I design the block diagram of a prototype I want to build.
The system is going to be battery operated and I am looking for low energy solutions
There are 5 x reed switches (RS1...RS5) triggered from a magnet (one magnet for every single reed switch).
The initial state of the reed switch is LOW and the MCU is in deep sleep mode.
When any of the reed switches change state (from LOW->HIGH) the MCU wakes up (through external interrupt) and starts reading the state of the reed switches through the Multiplexer.
It is possible more than one reed switches be HIGH at the same time (basically it could be 2^5 combinations)
In case that all the reed switches return to LOW state, the MCU will jump into a deep sleep state for energy saving.
Do you have any recommendations about this topology? Or any suggestions for improvement?
Hello,
my recommendation is to used a hardwired OR gate using diodes to steer one interrupt input. The REED contact are connected to the data input pins and must be read if an interupt occurs.
I would do it like this. All pins have their internal pullups turned on.
When the reed switch closes, the pin is pulled low to create a LOW interrupt on D2, the MCU (328P/Uno/ProMini in this example) wakes up and reads the 5 pins to read the data states.
The reason I am using the MUX is for expandability. I want the system to be able to handle up to 16 sensors (reed swiches). The MUX is going to be 16channel and I have found this ESP32-S2-MINI-1 module that provides 25 GPIOs and I can use 16 of them as interrupt inputs (I came in contact with Espressiff and they confirmed that)
I would like to suggest you modify your ALARM system to generate an alarm when a reed switch is opened, not when it is closed by a magnet. Otherwise you will NEVER be notified when a reed switch becomes defective, or the fixture it is mounted is moved out of alignment.
Paul