Prototype Block Diagram review

Thread Starter

nikolakisant03

Joined Oct 21, 2012
21
Hi everyone,

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?

Screenshot_117.png
 

AnalogKid

Joined Aug 1, 2013
9,256
Diode-OR the five switch signals into a single interrupt / wakeup input. The diodes maintain isolation among the switch signals so they can be read independently. You have given us ZERO information about the rest of the system, but most microcontrollers have enough inputs such that you do not need an external mux.

Because almost any input that can pull an interrupt also can function as a GPIO input pin, if your uC has five interrupt inputs you won't need an external diode-OR or mux or separate Digital Read input. Do it all in firmware.

ak
 
Last edited:

Thread Starter

nikolakisant03

Joined Oct 21, 2012
21
Thank you for your response AnalogKid,
I scaled down the block diagram for simplicity, basically, I want to design a flexible system that will support between 2-16 sensors (that's the reason for the MUX). I'm considering the 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)

Diode-OR the five switch signals into a single interrupt / wakeup input. The diodes maintain isolation among the switch signals so they can be read independently
Yes, I like the solution of using OR gates and steer into a single interrupt. However, should I use diodes or it could be better cascading out of the self OR gates?
 

Thread Starter

nikolakisant03

Joined Oct 21, 2012
21
Then I still do not see any reason for any external logic, multiplexer, etc.

ak
If I do not use logic circuit nor MUX then there are not enough GPIOs for my purpose..I need the interrupts to wake up the MCU from deep sleep and then I need to monitor the state of the switches
 

Irving

Joined Jan 30, 2016
1,526
You can use the same pins as both interrupt and monitor...

You can only use the following GPIO with EXT1 wakeup interrupt mode: 0,2,4,12-15,25-27,32-39, but not all may be available (especially #0). A high level triggers the interrupt. After waking you need to configure them as GPIO (they wake as RTC pins) and then you can monitor their ongoing state low/high with digitalRead(gpio_pin_num);
 

Thread Starter

nikolakisant03

Joined Oct 21, 2012
21
You can only use the following GPIO with EXT1 wakeup interrupt mode: 0,2,4,12-15,25-27,32-39, but not all may be available (especially #0). A high level triggers the interrupt. After waking you need to configure them as GPIO (they wake as RTC pins) and then you can monitor their ongoing state low/high with digitalRead(gpio_pin_num);
Thank you for your advice Irving!! Very usefull input!!
 
Top