I am using an ESP8266 to run a small app and that’s working just fine. I’d like it to power off in 60 seconds to save the battery. To do this I’m using a Pololu PSW03C triggered by setting connected pin13 HIGH to the OFF pin of the PSW03C. This is all fine and works as expected EXCEPT that at power-on, there seems to be a small spike on pin13 that prematurely triggers the PSW03C to power-off. I know the PSW03C is working correctly as I physically disconnected the wire to the OFF pin, let the ESP8266 start, reconnect the wire from pin-13, let the ESP do it’s thing, then it powers-off as expected.
relevant code is:
const int offPin = 13;
void setup() {
pinMode(offPin, OUTPUT);
digitalWrite(offPin, LOW);
}
void loop() {
// do stuff
// wait one minute
digitalWrite(offPin, HIGH); // Power off
}
Any ideas how I can prevent the premature power-off ?