Thank you for reading Mariusz Białończyk! Your doubt is in its place. Since I hooked up the sensor to 5V power then the TTL output levels of the ECHO pin will reach 5V. While pins typically have internal protection, this would still expose them to potential damage. No need to mention, it didn't matter in the simulation. As such, there are two options to address this; either a voltage divider like you indicated to shift the 5V range to a 3.3V range or use a 3.3V compatible device. However, for the latter, I think the accuracy is not as good as the 5V sensors. I adjusted the diagram in Wokwi to include the voltage divider.
Hi, First of all, much thanks for sharing this! I was planning to use it in my application using pure ESP32 and JSN-SR04T. I found samples/examples but not in Rust - and suddenly I encounter this site! :) A working implementation will help me a lot, thanks!
I have one doubt/question regarding the wiring: You are powering up the sensor from 5V. This means that the internal logic on the ECHO and TRIGGER pins is also 5V, right?
I saw on several applications the same wiring as yours, but isn't it, that the
echoshould go via some level shifter?, eg like here: https :// camo.githubusercontent.com/aef16862dcee3db4696e1d14a25ed97a27f16ed6ada8edf5de1c8b1d06859323/68747470733a2f2f692e696d6775722e636f6d2f384f4a395451432e706e67I don't know - maybe the ESP32 pins are capable of handling this (if so - it is probably not preferred during long run?), but I am only asking what is the proper way of doing the wiring...