Blynk won't show any ultrasonic data using nodemcu

got it work, the code is fine just the order

How do you know the sensor is working? If I recall these sensors needs 5v (to run and trigger). The nodemcu digital out will only go to 3.3v. Did you include a voltage level shifter?

1 Like

I use external psu 5v just for this sensor.
I tested the sensor with arduino mega with simple new ping and works fine.

I should try this without blynk

Are you triggering with 3.3V or 5V?

not sure what you mean by triggering…
I connect d0 (gpio 16) to RST.
looks like my nodemcu board is the problem.
compiling takes 15 minutes and only showing 33% and counting with … then done uploading.

i think my board is bad

The nodemcu runs at 3.3V. The nodemcu output is 3.3V. You are powering the SR04 with 5V; however you are sending it a 3.3V signal from the nodemcu. I’m 99% sure you need to send the SR04 a 5V signal. Build a level converter.

Your mega on the other hand outputs 5V. This is why it can trigger the SR04 without the need for a level converter.

there is an output from nodemcu 5v, Vin and ground, I tested 4.7volt.

I did try using seperate psu 5v just for sr04 with the same result.

I got this massage
WARNING: Spurious .github folder in ‘Blynk’ library

I use 1.6.6 IDE now, using 1.6.13 wont upload.
I think the blynk library folder messup, I have no idea which, could this is the problem ?

after checking the board is fine.
this is the serial monitor shows

à�ÿ-SÿÿStart
[250] Connecting to cc
[4253] Connected to WiFi
[4253] IP: 192.168.0.17
[4253] Blynk v0.4.0 on NodeMCU
[5001] Connecting to blynk-cloud.com:8442
[5310] Ready (ping: 1ms).
High
Low
Sleep
$€/Ð53ÿÿStart
[247] Connecting to cc
[4250] Connected to WiFi
[4251] IP: 192.168.0.17
[4251] Blynk v0.4.0 on NodeMCU
[5001] Connecting to blynk-cloud.com:8442
[5235] Ready (ping: 0ms).
High
Low
Sleep

_____àü=rýÿStart
[254] Connecting to cc
[4257] Connected to WiFi
[4257] IP: 192.168.0.17
[4257] Blynk v0.4.0 on NodeMCU
[5001] Connecting to blynk-cloud.com:8442
[6291] Ready (ping: 1ms).
High
Low
Sleep

i gotta test without blynk

btw I’m using 1.6.7 IDE

It works after changing the code, the sleep mode should be at the last.
:heart_eyes: