Wake up ESP8266 with multiple GPIOs

groundFungus:
If you are willing to use an “external” chip, may I suggest a MCP32008 I2C expander?

That should be the MCP23008 :slight_smile: They work really well for me (I2C version).

The interrupt line is optional, you can leave that unconnected if you don’t need the interrupts.
The MCP23017 has two interrupts, one for each group of 8 pins. This are pin change interrupts, and you can switch them on and off for each pin individually. So if you have only one pin of interest, you know which one it is when you get the interrupt without testing the pins for changes.

Oops, Lisdexia this morning.

Maybe a spell checker or auto-correct can help you out :slight_smile:

I don thin any smell checker wood halve cot that.

wvmarle:
It won't be overloaded.

Great! I imagined it but I was not sure.

wvmarle:
But don't mix up a reset state with a power down state. They're not the same. Holding the reset at GND doesn't switch off the ESP, it just lets it sit there waiting for reset to go high again (probably using less power than when fully active but still it's not power down or deep sleep).

Very good observation. I will take it into account. Thanks for your reply!

groundFungus:
If you are willing to use an "external" chip, may I suggest a MCP32008 MCP23008 I2C expander? 3 pins (SDA, SCL, interrupt) for up to 8 switches, interrupt on change of any pin, has internal pullups, very low power. MCP23017 has 16 I/O pins, and there are SPI versions of both chips.

Great! I'm going to investigate a little more about the MCP23008 I2C. I think it's an excellent option when I'm going to add more doors. Thanks for your advice.

Another common port expander is the PCF8574 (also has a 16-port version). A bit cheaper and less features than the MCP23008, but should do just fine for this application.

wvmarle:
Another common port expander is the PCF8574 (also has a 16-port version). A bit cheaper and less features than the MCP23008, but should do just fine for this application.

Sounds good! Thanks again!

wvmarle:
The 74HC32 is rated to work at 3.3V

You could use a resistor ladder - remember that the ADC input is 0-1V, if your module's analog input is 0-3.3V (such as the NodeMCU) it has its own on-board voltage divider as well, which means it will mess up an external voltage divider.

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 to see the schematics

My question is: Ok what I have done?

Looks good to me.

For the PCB: I prefer to design them with as wide traces as possible, less risk of damage. You are using very thin traces for the space available.

wvmarle:
Looks good to me.

Thanks!