WeMos D1 Mini/ESP8266 Pin States On/Off/Deep sleep/Low side switch

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

  1. Default pin states on boot
  2. Turned Off, with default pin states and modes
  3. Turned Off, after all pins are set to OUTPUT and HIGH

1. Pin states on Boot

PinDefault state on BootPinDefault state on Boot
0HIGH, 3.11V5LOW
1LOW6LOW
2LOW7LOW
3HIGH, 1.9V8HIGH, 3.13V
4HIGH, 3.11V

2. Turned Off, with default pin states

PinUsing a Deep SleepUsing a Low-side Switch
0HIGH, 3.16VHIGH, 1.9-2.3V
1LOWHIGH, 1.9-2.3V
2LOWHIGH, 1.9-2.3V
3HIGH, 1.88VHIGH, 1.9-2.3V
4HIGH, 1.75VHIGH, 1.9-2.3V
5LOWHIGH, 1.9-2.3V
6LOWHIGH, 1.9-2.3V
7LOWHIGH, 1.9-2.3V
8LOWHIGH, 1.9-2.3V

3. Turning Off, after all pins are set to OUTPUT and HIGH

PinUsing a Deep SleepUsing a Low-side Switch
0HIGH, 3.15VHIGH, 1.9-2.3V
1LOWHIGH, 1.9-2.3V
2LOWHIGH, 1.9-2.3V
3HIGH, 1.88VHIGH, 1.9-2.3V
4HIGH, 1.75VHIGH, 1.9-2.3V
5LOWHIGH, 1.9-2.3V
6LOWHIGH, 1.9-2.3V
7LOWHIGH, 1.9-2.3V
8LOWHIGH, 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.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *