hc sr04 with 1 wire for trigger and echo?

I read that you can use one pin for both trigger and echo. I tried it with techel's library and it didn't work.

I have downloaded the latest ( 1.8 )

For wiring, I did a simple "Y" connector with pin15 of the esp splitting to the sr04 echo and trigger.

As per the release notes

v1.4 - Released 7/14/2012 - You can now interface with all but the SRF06 sensor using only one Arduino pin. Added support for the Parallax PING)))™ sensor. You can also interface with the SRF06 using one pin if you install a 0.1uf capacitor on the trigger and echo pins of the sensor then tie the trigger pin to the Arduino pin (doesn't work with Teensy). To use the same Arduino pin for trigger and echo, specify the same pin for both values. Various bug fixes.

So this library should support one wire.

I am using the geekcreit esp32 dev board.

Library used

https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home

Can you get it to work the "normal" way, with one pin for trigger and one pin for echo?

How are you powering the HC-SR04? I think it is supposed to operate on 5 volts, not 3.3 volts.

Also, when operated on 5v, the echo pin will output 5 volts, which could damage the ESP32...so you'd need a voltage divider on that pin.

yes, I have working fine. I power it from vcc into the esp32 which is 5v.

Good catch on the echo pin output voltage. I wouldn't of caught that.

I have heard that even though the pins are 3v, it is 5v tolerant. But none the less I should put a couple of resisters in there for a divider on the way back into the esp.

Perhaps the 3v out going to trigger bridged with the 5v out is causing the issue.

Maybe the "one pin" method uses timers - NewPing doesn't support timer use with non-AVR controllers. Seems unlikely that is the problem.

Suggest asking the moderators to lock this thread and posting your question here:

The author of NewPing seems to monitor that thread.

DaveEvans:
How are you powering the HC-SR04? I think it is supposed to operate on 5 volts, not 3.3 volts.

There are 3.3V versions. I'm using these sensors without any issues on the ESP8266, all operating at 3.3V.