3
\$\begingroup\$

I am trying to build what I thought was a relatively simple system (think deadbolt detector), that will fire an event when a simple switch changes state.

Currently, I am testing with an ESP-01 and an ESP32, using deep sleep but the power consumption still seems quite high, because I have to wake the device up every 10 seconds to query the status of the "switch".

I would like to only wake from sleep when the state changes, I can "easily" do this on "close", but I would like to do this on "open" as well like in this question. I need a switch that not only detects open/close, but also sends a pulse to wake up an ESP8266 whenever the (debounced) state changes

I have read up on XOR/XNOR gates, but I am still not sure, how I would implement it.

asked Dec 17, 2018 at 8:18
\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

Perhaps you could use a Schmitt trigger EXOR as specified here. enter image description here

Source: Convert a toggle switch into a momentary response

It will create a momentary high pulse whenever a regular toggle switch (deadbolt) is switch on->off or off->on. You could then wire that ouput to an external wakeup pin for said microcontroller.

As you are specifying multiple microcontrollers I suggest that you look up the external wakeup procedures for the board you are using. Many examples are available such as this one for the ESP32.

Best of luck!

answered Dec 17, 2018 at 10:40
\$\endgroup\$
1
\$\begingroup\$

This is a working prototype that I made. You can see more details about parts, modify and order your own if you want.

This is the schematic:
schematic

Here is a link to my project on jlcpcb: https://easyeda.com/jakibsgaard/low-powered-rising-and-falling-power-on-circuit

I have also a open question where I want to improve the circuit I have made. But that is not required. This has much more information about the circuit I made. Improving edge detector with latching circuit for esp8266

Voltage Spike
93.1k53 gold badges93 silver badges243 bronze badges
answered Sep 3, 2020 at 12:14
\$\endgroup\$
1
  • \$\begingroup\$ Your good, there really isn't a question, the first time I looked at it I thought there was. \$\endgroup\$ Commented Sep 3, 2020 at 18:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.