The Problem
In my post about low power deep sleep for ESP8266 dev boards I ran into an issue with a low side switch where I was unable to wake up NodeMCU after the first sleep.
The uptime is controlled by TPL5110 timer which has DRIVE and DONE pins. To power down ESP you signal HIGH on DONE pin and that disables DRIVE. However, DRIVE would not go HIGH again.
Turns out WeMos semi-maintains the state of the pins when you turn it off using a low side switch. Which kept DONE signal HIGH enough to not let the timer come out of sleep.
I wanted to explore WeMos pin states in various scenarios. Here they are.
Scenarios
- Default pin states on boot
- Turned Off, with default pin states and modes
- Turned Off, after all pins are set to OUTPUT and HIGH
1. Pin states on Boot
Pin | Default state on Boot | Pin | Default state on Boot |
0 | HIGH, 3.11V | 5 | LOW |
1 | LOW | 6 | LOW |
2 | LOW | 7 | LOW |
3 | HIGH, 1.9V | 8 | HIGH, 3.13V |
4 | HIGH, 3.11V |
2. Turned Off, with default pin states
Pin | Using a Deep Sleep | Using a Low-side Switch |
0 | HIGH, 3.16V | HIGH, 1.9-2.3V |
1 | LOW | HIGH, 1.9-2.3V |
2 | LOW | HIGH, 1.9-2.3V |
3 | HIGH, 1.88V | HIGH, 1.9-2.3V |
4 | HIGH, 1.75V | HIGH, 1.9-2.3V |
5 | LOW | HIGH, 1.9-2.3V |
6 | LOW | HIGH, 1.9-2.3V |
7 | LOW | HIGH, 1.9-2.3V |
8 | LOW | HIGH, 1.9-2.3V |
3. Turning Off, after all pins are set to OUTPUT and HIGH
Pin | Using a Deep Sleep | Using a Low-side Switch |
0 | HIGH, 3.15V | HIGH, 1.9-2.3V |
1 | LOW | HIGH, 1.9-2.3V |
2 | LOW | HIGH, 1.9-2.3V |
3 | HIGH, 1.88V | HIGH, 1.9-2.3V |
4 | HIGH, 1.75V | HIGH, 1.9-2.3V |
5 | LOW | HIGH, 1.9-2.3V |
6 | LOW | HIGH, 1.9-2.3V |
7 | LOW | HIGH, 1.9-2.3V |
8 | LOW | HIGH, 1.9-2.3V |
In conclusion, use a high side switch if you need some of your pins to remain LOW while your NodeMCU is off while power to it is being controlled by an external switch and not a built-in deep sleep.
Leave a Reply