I am doing latching circuit using ESP01.
In short, once motion is detected, EPS01 will be turned on with 3.3V.
Now it should do stuff and select GPIO2 OUTPUT to HIGH, this opens MOSFET which cut off power supply for ESP01.
I noticed problem with ESP01 GPIO.
In case pin have some load (10k pull down resistor prior mosfets gate) measured voltage on pin is 1.3V, when I leave GPIO2 open (no load) everything seems to be fine and I am measuring expected 3.3V.
Could you please help me clarify this?
Any proposal for a solution.
In case you would need code, it is very simple:
void setup() {
Serial.begin(115200);
pinMode(PIN, OUTPUT);
setup_wifi();
mqtt_client.setServer(MQTT_SERVER, MQTT_PORT);
mqtt_client.setCallback(mqtt_receive);
Serial.println("setup(): State on pin " + String(PIN) + " is: " + String(digitalRead(PIN)));
}
/***************/
/* Main loop() */
/***************/
void loop()
{
mqtt_connect();
mqtt_client.loop();
digitalWrite(PIN, HIGH);
Serial.println("loop(): Current state on pin " + String(PIN) + " is: " + String(digitalRead(PIN)));
delay(100);
}