Wake up ESP8266 with multiple GPIOs

Thread Starter

José Alfredo Sánchez

Joined Feb 1, 2017
20
I am building a ESP-07 based IOT device, that detects the status of 4 doors. The device must connect to WiFi and send an http request, when 1 of 4 doors is opened. The battery consumption should be minimal, so I thought of using deepsleep () or something similar to keep the device asleep most of the time, or keep it completely off (like most Dash buttons does).

I have studied several options, but almost all use a single GPIO to wake up the device. One option I have thought is to use a latch circuit that turns on the (previously turned off) device using a single GPIO.

schematics.png

My question is:

Can I use more than one GPIO, that is, one of 4 GPIOs to activate the latch circuit? Any ideas?

I have the problem of knowing which of the four doors has been opened!

Thanks in advance.
 

DNA Robotics

Joined Jun 13, 2014
647
I got this from one of the links below. You should confirm it.

GPIO16 is connected to CH_DP for deepSleep.
and pulled low during deepSleep.
if CH_DP goes high the chip wakes up.
for what reason the high signal comes from does not mater.

So GPIO16 (D0) is the only pin that will wake up the chip. If you wire your switches to pins other than GPIO16, and also wire them all to GPIO16 through diodes, any that go high will wake it up. Then you can check the other pins to see which one triggered it.

https://randomnerdtutorials.com/esp8266-deep-sleep-with-arduino-ide/
https://github.com/esp8266/Arduino/issues/1488
 

GopherT

Joined Nov 23, 2012
8,009
You'll have to use some external glue-logic OR gates to get the unit to turn on. then send the signal from each door to separate input pins to determine which door.
 

Thread Starter

José Alfredo Sánchez

Joined Feb 1, 2017
20
Thanks for your replies!

That is an amazing idea! So I can use a bunch of diodes to have all door switches trigger two pins: the shared wake-up pin GPIO16 (D0), and a unique one for each switch.

I have no idea how I could do that. Any idea of what a circuit with these characteristics would look like?

Thanks in advance.
 

Thread Starter

José Alfredo Sánchez

Joined Feb 1, 2017
20
I got this from one of the links below. You should confirm it.

GPIO16 is connected to CH_DP for deepSleep.
and pulled low during deepSleep.
if CH_DP goes high the chip wakes up.
for what reason the high signal comes from does not mater.

So GPIO16 (D0) is the only pin that will wake up the chip. If you wire your switches to pins other than GPIO16, and also wire them all to GPIO16 through diodes, any that go high will wake it up. Then you can check the other pins to see which one triggered it.

https://randomnerdtutorials.com/esp8266-deep-sleep-with-arduino-ide/
https://github.com/esp8266/Arduino/issues/1488
Yes! My setup looks exactly like that.
 

Thread Starter

José Alfredo Sánchez

Joined Feb 1, 2017
20
You'll have to use some external glue-logic OR gates to get the unit to turn on. then send the signal from each door to separate input pins to determine which door.
I have several options. I don't know if an TTL-CMOS OR gate like CD4072 works with 3V3 logic. A simple circuit with diodes or resistor looks better. Any ideas?

Thanks!
 

Thread Starter

José Alfredo Sánchez

Joined Feb 1, 2017
20
Hello!

I have an idea. What if I connect each door using a DPST (double pole single throw) switch?

This would be the scheme using two single switches.

doors.png

My idea is to use the same switch to connect at the same time the RESET PIN and the corresponding pin to each door (for example, GPIO12).

Would there be problems if two doors open at the same time? Would not the RESET pin be overloaded when two switches are connected to VCC?
 

Thread Starter

José Alfredo Sánchez

Joined Feb 1, 2017
20
Hi!

I have made a small card to connect my ESP8266. It is supposed to connect the GPIOs corresponding to the 4 doors I mentioned. My idea is to use, as I said before, a simple switch on each door, to connect each one to GND and the corresponding pin. I have connected each pin (GPIO12, ..., GPIO15) to the inputs of the 74HC32 and the output to the RESET (so that any of the doors can wake up to the ESP8266 of deep sleep.)

74HC32 is already connected to GND and VCC.

Click here to see the schematics --> https://goo.gl/6Dv9zM

My question is: Ok what I have done?
 
Top