I'm trying to build a cheap device to measure water level in a tank using HC-SR04 sensor and ESP-01 which send the data to MQTT topic. I used the same code with ESP-E12 which works just fine. As I'm trying to drive the cost down with ESP-01, I faced a problem with I/O pins. I searched the web and found some contradicting info about which pins could be used in this case.
Coming to the ESP-01, I used a USB adapter to program it and the code uploaded successfully. Here I'm just showing the Ultrasonic sensor part which I believe I have issues with.
0.54 cm
20.21 cm
23.09 cm
24.06 cm
25.35 cm
26.28 cm
29.75 cm
30.79 cm
32.51 cm
34.17 cm
36.37 cm
20.54 cm
132.86 cm
133.49 cm
128.43 cm
123.33 cm
120.11 cm
120.55 cm
remember the ESP-01 uses 3.3V logic - if connecting it to a 5v device use a potential divider on any ESP-01 inputs
in addition (from ESP8266_01_pin_magic) GPIO0 and GPIO2 need to have pull-up resistors connected to ensure the module starts up correctly. The ESP-01S has 12K resistors on the board for GPIO0, RST and CH_PD
are you using a ESP-01 or ESP-01S?
what ultrasonic sensor are you using ? some may require 5V power
how are you programming the device, e.g. using a programmer module?