Powering ESP with a Low-Level trigger

Thread Starter

MMM**MMM

Joined May 30, 2022
91
I am in the process of creating a reed switch module for door opening detection, and I am encountering a challenge. The reed switch available to me is a normally open switch, meaning that when the door is closed, the switch will be closed due to the presence of a magnet. As a result, the ESP will always be powered on.

It is essential to note that I have exhausted my efforts in attempting to find a normally closed switch, but unfortunately, it is not available. Previously, I sought assistance through a similar thread where I asked for a solution to power the ESP when the trigger is high, and that issue has been successfully resolved. However, my current requirement demands the reverse scenario, and I am seeking suggestions on how to modify the design to achieve this new objective. Any guidance or recommendations in this regard would be greatly appreciated.
 

crutschow

Joined Mar 14, 2008
33,310
As the only option appears to be the relay being closed when the door is closed, then you need to look at options for the circuit with the switch closed.
Exactly what will the reed switch be controlling (what is the ESP)?
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
As the only option appears to be the relay being closed when the door is closed, then you need to look at options for the circuit with the switch closed.
Exactly what will the reed switch be controlling (what is the ESP)?
The reed switch is just used as a trigger (it does not directly power the ESP), the ESP is a microcontroller, and the one I am using is ESP8266 12E. Anyway, the type of the ESP does not matter
 

ericgibbs

Joined Jan 29, 2010
18,211
hi,
I don't think a recommendation by the reed relay manufacturer is a trivial solution
or unreliable.

E

You could buy an TOKIN N/C reed from RS Components of the type shown in that image
 
Last edited:

Thread Starter

MMM**MMM

Joined May 30, 2022
91
The solution is quite limited as it's designed specifically for a single sensor with certain dimensions. If I were to change the sensor, for example, to use a float sensor instead, this approach would no longer be suitable. The same applies if I want to use another reed switch with different dimensions, as I would need to change the magnets accordingly. Therefore, this solution is not very versatile or modular; it only works for a specific sensor configuration.
Thus, I will use it ONLY if this is the last possible solution. By the way, I would prefer to implement a better solution, even if it costs more.
Again, this is a good solution, but it will not help me with the rest of the home automation modules I want to create.
 

BobTPH

Joined Jun 5, 2013
8,062
All you need you need is a pull up resistor. Connect the switch from the resistor to ground. The other side of the resistor to B+.

Now the junction of the resistor and switch is high when the door is open, low when the door is closed.
 
Last edited:

crutschow

Joined Mar 14, 2008
33,310
Anyway, the type of the ESP does not matter
Didn't say or imply that it did.
But when you throw unknown acronyms into a discussion, you need to define them.

Since all the relay does is act as a trigger, I see no reason that a normally-closed one can't work just as well as one that is open.
Exactly what is the problem other than a trivial required logic inversion?
You have implied there is one but it's not apparent what you think that is.
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
What is it triggering? A single transistor + a resistor can make a logic inverter, which is what you need.
Is this what you mean?
1689621491335.png

I have connected a 10M base resistor to reduce the amount of current drawn as much as possible as I need a very low power consumption. If you have suggestion regarding this circuit, please tell me about. Thanks for your contribution.
 

Thread Starter

MMM**MMM

Joined May 30, 2022
91
Didn't say or imply that it did.
But when you throw unknown acronyms into a discussion, you need to define them.

Since all the relay does is act as a trigger, I see no reason that a normally-closed one can't work just as well as one that is open.
Exactly what is the problem other than a trivial required logic inversion?
You have implied there is one but it's not apparent what you think that is.
Hi crutschow, I really appreciate your contribution, but I really cannot figure out how using a relay will solve the problem. I will be very glad if you could just show any schematic to help me figure it out.
Also, I think that "ESP" is very familiar to anyone, it is probably the most used ESP for home automation. Sorry for assuming so, I will always write in a more detailed manner.
Regarding a logic inversion, this is exactly what I need, but the problem is the power consumption. I need the least power consumption solution (for example no consumption while the switch is closed by the magnets, this is not applicable for a simple transistor logic inverter as it always consumes power when the switch is closed).
 

bertus

Joined Apr 5, 2008
22,228
Hello,

You will not see any change with a 10M (R23) base resistor.
For hard switching the base current should be about 1/10 of the collector current.

Bertus
 

crutschow

Joined Mar 14, 2008
33,310
I really cannot figure out how using a relay will solve the problem.
I was referring to the reed relay you want to use.

You can use the signal from the reed relay to control a CMOS inverter gate or a MOSFET transistor, as they have only insignificant leakage current at their input/gate.
A 10meg pull-up or pull-down resistor at the circuit input will draw such a small current that it allow even the smallest battery powering the circuit to last essentially as long as its unpowered shelf life.

For example 10 megohm across a 3.3V battery will draw <3mAH per year.
What battery do you expect to use to power the circuit?
 

sghioto

Joined Dec 31, 2017
5,073
I am in the process of creating a reed switch module for door opening detection
If it's just connected to an input on the ESP then a simple arrangement of the reed switch should suffice for either Low or High switching requirements.
Switches shown in the closed position.
1689639292236.png
1689639338758.png
 
Last edited:

BobTPH

Joined Jun 5, 2013
8,062
Is this what you mean?
View attachment 298514

I have connected a 10M base resistor to reduce the amount of current drawn as much as possible as I need a very low power consumption. If you have suggestion regarding this circuit, please tell me about. Thanks for your contribution.
No, read my post again and see if you have connected it as I suggested. I would draw a schematic, but I am on my phone.
 
Top