Powering ESP with a Low-Level trigger

BobTPH

Joined Jun 5, 2013
11,516
The schematic is in my previous post.
What I don't understand is why it matters as the ESP can be programmed for high or low inputs.
I posted before I saw that. Yes, that is exactly what I am talking about. It is also the standard way we read switches in a microcontroller. But he never answered my question about what he was triggering, it could be a relay.
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
Hello,

I would like to clarify my intentions and address your questions to ensure a better understanding.

Currently, I am working on modifying the initial design (mentioned in the first post) to incorporate a new feature. Specifically, I am developing a prototype device for home automation, starting with a reed switch door sensor. In the market, I found the reed switch available in the normally open configuration. When the door is closed (which is the typical scenario), the switch remains closed due to the presence of magnets.

Previous suggestions included using a combination of magnets with opposite polarities to create a trigger mechanism. While this solution can work well for the current prototype, it is not a versatile option for future iterations, and it is not good for a limited space. Another proposal involved using an ESP to detect the switch's open or closed state. However, this would require keeping the ESP continuously powered, which is not ideal for power-saving purposes. The current design achieves power efficiency by only activating the ESP on trigger.

Now, my goal is to modify the design to achieve the same functionality, but with the trigger being a high signal instead of low. In my simulations, I have explored various approaches, and a CMOS-based design (using one N-MOSFET and one P-MOSFET) proved to be the most power-efficient.

However, I am facing two issues when connecting the reed switch to VCC:

1) When inverting the high trigger due to the closed switch, the gate of the P-MOSFET becomes low, causing the ESP to power on, which is not desired.
2) The switch should not remain closed after the door is open, resulting in a low trigger. This keeps the gate high, preventing the ESP from powering on, which is also not desired.

Connecting the reed switch to GND is not a viable option, as it would either result in a permanently high input at the gate of the P-MOSFET preventing the ESP from ever waking up (with logic inversion) or cause the ESP to remain powered on continuously (without logic inversion). Similarly, connecting the reed switch directly to VCC without inversion would prevent the ESP from ever waking up.

I hope this clarifies the objective. I am open to further suggestions or insights to achieve the desired functionality while maintaining power efficiency.

Thank you for your assistance and understanding.
 

ericgibbs

Joined Jan 29, 2010
21,442
Previous suggestions included using a combination of magnets with opposite polarities to create a trigger mechanism.
Hi,
I also posted a type of n/c reed switch in my post #6, [ see the PDF] so have you checked the viability of that suggestion?
E
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
As previously mentioned, I am still facing the issue of not being able to find a normally closed reed switch, and the solution involving two magnets is highly restrictive, as it only works with reed switches of specific dimensions. If you have any other suggestions or alternative solutions to address this challenge, I would greatly appreciate your input. This problem may indeed be challenging, but I am determined to find a suitable solution by seeking the expertise of others. Rest assured, I am doing my best to explore all possibilities and come up with an effective resolution. Thank you for your continued support and guidance.
MMM**MMM
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
I believe that the suggested solution still presents the same issue, as using something fixed on the door to close the switch will only lead us back to the initial problem. Even if we manage to find a micro switch that is normally closed (which is not the default), it would only address the current problem without providing a generic solution. In essence, it would be no different from using two magnets. These mechanical solutions are limited to door sensors and do not cater to the broader range of prototypes I wish to create, including a float detection sensor.

I have dedicated multiple days to resolving this challenge, exploring various possibilities and seeking more universal solutions. My aim is to find a solution that can be applied across different sensor types, not just limited to one specific scenario. The quest for a more generic and adaptable approach is what drives my determination to solve this error. I greatly appreciate any insights or suggestions that may help me achieve this goal. Thank you for your understanding and support.
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
Thank you for your ongoing support. However, I am still in the process of finding an electronic solution that is compatible with the other sensors.
 

ericgibbs

Joined Jan 29, 2010
21,442
Hi M,
Please define what you class as an electronic solution ?

These mechanical solutions are limited to door sensors and do not cater to the broader range of prototypes I wish to create, including a float detection sensor.
You appear to have no actual written specification, but a universal 'fit all' idea, of what you are trying to achieve, which makes the posted suggestions unacceptable.

E
 

sghioto

Joined Dec 31, 2017
8,634
The current design achieves power efficiency by only activating the ESP on trigger.
This is the issue. What exacty do you mean by a trigger? Is the reed switch suppose to activate a circuit to power on the ESP directly? Please explain.
1689789809997.png
 
Last edited:

Thread Starter

MMM**MMM

Joined May 30, 2022
91
This is the issue. What exacty do you mean by a trigger? Is the reed switch suppose to activate a circuit to power on the ESP directly? Please explain.
Hi sghioto,

Assuming you have seen the design mentioned in my first post, let's discuss its functionality. When either S3 or S4 is closed, the ESP is powered on. Similarly, if only S4 is closed, the ESP is powered on as well. The ESP is only powered off when both S3 and S4 are open.
Please note that S4 is not a physical switch, but rather serves as a way to simulate a high signal sent by the ESP. On the other hand, S3 is a reed switch that is normally closed.
Now, my objective, as mentioned in my "first" post, is to achieve the exact same functionality but using a normally open switch instead because this is the available for the moment. The difference here is that the normally open switch will mostly be closed, keeping the ESP powered on most of the time. Therefore, it is not as simple as just removing S3 and replacing it with the normally open switch.
I asked this question on a circuits platform, this indicates my preference for solutions that are specifically related to circuits.
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
Hi M,
Please define what you class as an electronic solution ?



You appear to have no actual written specification, but a universal 'fit all' idea, of what you are trying to achieve, which makes the posted suggestions unacceptable.

E
A challenging problem does not imply that it is unsolvable. I appreciate everyone's contribution thus far, but I am still in the process of finding an electronic circuit that fulfills my desired requirements. Any electronic solution would be greatly appreciated.
 

ericgibbs

Joined Jan 29, 2010
21,442
Hi M.
Will your switch device have to work equally reliably on plastic, wood and metal/steel doors.?
[consider metal/magnet could be a problem]

Will the operation of the switch be controlling a life/critical operation [via the ESP mcu of course]

I don't wish to sound negative, but usually challenging can mean you are trying for a universal device and/or you have no actual written specification.

E
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
This is the issue. What exacty do you mean by a trigger? Is the reed switch suppose to activate a circuit to power on the ESP directly? Please explain.
View attachment 298616
Your design should work; I have already implemented a similar one before. However, the issue with this implementation is that it keeps the ESP powered on continuously when the switch is not closed. If you compare this design to the one in the other thread, you'll notice that the ESP is no longer able to power itself on by sending a high signal and shut down by sending a low signal. So, what about the case of keeping the door open for a few hours?
So, while your design is good, it consumes a significant amount of power. I only require the ESP to be powered on momentarily, send a notification, and then shut down (not sleep).
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
Hi M.
Will your switch device have to work equally reliably on plastic, wood and metal/steel doors.?
[consider metal/magnet could be a problem]

Will the operation of the switch be controlling a life/critical operation [via the ESP mcu of course]

I don't wish to sound negative, but usually challenging can mean you are trying for a universal device and/or you have no actual written specification.

E
The switch is typically installed on wood doors, but it can also be installed on metal doors. While I understand your concerns about magnetic interference, this should not be an issue when using a single magnet with a small distance between the magnet and the switch.

Indeed, the switch will control important operations, and in the future, I plan to connect it to an alarm system to detect door openings for safety purposes. However, at the moment, my primary goal is to send a single message to a mobile phone. I am taking an incremental approach, so let's focus on powering the ESP for now, and we can address other features later.
 
Top