Hello, i am beginner at esp8266 and it's my first time use ESP8266. I used ESP32 before. When i run my code in my ESP32 it works, but in ESP8266 got this message. I got error message from serial monitor: ~ld
����n�{��g|�d�lc�e�|s�l�g��n�l��s�d�l��
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
no idea why ESP32 and ESP8266 should be different
for GPIO interrupt you require a good rising or falling edge - try INPUT_PULLUP
the yf-s201-water-flow-measurement-sensor documentation states "Output type: 5V TTL"
the ESP32 and ESP8266 use 3.3V logic and can be damaged by 5V logic input
use a potential divider or level converter on the input signal
you will need to measure the pulse frequency to determine the flow rate
Anyway. If it does not yet work as expected you should start with very basic tests.
Do you have any kind of a 5V power-supply?
If not
As third best alternative use your ESP8266 but there is a danger if you shortcut the 5V-pin of your ESP8266 you can destroy the USB-port of your computer.
You should run a very basic test.
Connecting GND and GND of the power-supply
connect 5V pin of your flowmeter with 5V
measure the voltage between gnd and signal-pin of your flowmeter with a digital multimeter
If you blow air gently into the flowmeter.
Does the voltage change on the digital multimeter ?
Try if you can make the flow-sensor stop with signal-voltage HIGH (aproximately 5 V)
Try if you can make the flow-sensor stop with signal-voltage LOW (aproximately 0 V)
Use the voltage-divider as shown above to protect your ESP8266 against to high voltages.
Next test:
write a testcode that does nothing more than printing the logic state of your input-pin to the serial monitor.
if you disconnect the YFS201 and take the GPIO4 pin alternately to 3.3V and GND via a resistor does the count change?
what specific ESP8266 board are you using ? give a link or a photo?
Can you explain to me how this message is helping to analyse your problem?
This is a way too short information to be really useful.
Post exact that complete sketch that you used in your test.
If you have modified the code repeat the test.
Then post the complete sketch
Assuming youuse a code that configures the IO-pin into mode INPUT_PULLUP
What happends if you do a test not with your sensor but with just a wire or a button
where you have one end of your wire connected to the IO-pin and then make temporarily contact to ground of the ESP8266
YF S201 is sensor for water flow, and measure volume of water. I use this sensor on my valve, when i connect my sensor through ESP32, it can read from sensor with my code. e.g (Volume =200mL). But if i use ESP8266 V3, with voltage divider (in my esp32 i use this too), this sensor cannont read my sensor. The output just stuck in 0mL. I tried to print the pulse, as the result the volume stay with zero value.
Additionally, i do not have modified my code (I modify only the pin). I use my D2 and i write GPIO4.
I will try your advice about test without my sensor. I will report in here. Thankyou