ESP01 connection problem

I am making a project where i need to control two relays with ESP01. Schematic is bellow:

Sketch is:

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "*********";
char ssid[] = "***********";
char pass[] = "*************";

#include "Arduino.h"
#include "PCF8574.h"
PCF8574 pcf8574(0x20, 0, 2);

  int pinValue1 = param.asInt();
  pcf8574.digitalWrite(P7, pinValue1);
  int pinValue2 = param.asInt();
  pcf8574.digitalWrite(P6, pinValue2);
void setup() {
  Blynk.begin(auth, ssid, pass);
  pcf8574.pinMode(P7, OUTPUT);
  pcf8574.pinMode(P6, OUTPUT);

void loop() {;

Power supply i think is ok. It is 5V/3A with AMS1117 regulator. When i power it up, blue LED on ESP01 blink and i can see its IP address on my router. After that i can change state from my phone. But, after a minute or two (sometimes 10 min, sometime 10 sec), i can not change state from my phone. When i check in my router i can see that it is not connected in my local network. After a reset it shows up again. Sometimes it take few resets.

Whole project is on a PCB already soldered, so there shouldn’t be bad contact. I double check joints, but there is always BUT. If any suggestion, please tell me. Or what should i check…

I posted this in a couple of places in hope more people can see it.

1 Like

Have you used the PCF8574 library in a simpler project with Blynk?


Yes, with Uno and it works fine.

Try it with an ESP-01 using the same pins as in your circuit.


1 Like

I removed PCF8574 IC from its slot -> the same
I change few other ESP01 (3 of them) -> the same
This kind of issue i never had in my projects, but i haven’t used ESP01. I have few NodeMCUs in walls working like a charm for year and a half. I just take a close look in my router. ESP01 is online and just suddenly it goes off. In a 10 sec or so, it is back. I don’t have any other issue with disconnecting with other devices in my home. That includes few PCs, phones, tablets and as mention few NodeMCUs in walls.

Router is Asus RT-AC1200G+ and it is about 6 meters far away.

Your schematic doesn’t show +3v3 being applied to CH_PD.
Is this an oversight?


I missed that and connect it with a wire. It is connected. It was first what i noticed and change it.

I connected it width a wire, but i can see some use 1K resistor. Tried both. No luck