Use HC-SR04 separatly as transmitter and receiver

Hello,

I am new at Arduino. For a project, I need to have some ultrasonic measurements between an ultrasonic emitter and a receiver.

So I have tried to work with two HC-SR04, using one as a transmitter and one as a receiver, but I'm struggling.

My first idea was to put them both face to face, run the code, and each will save not the echo, but the signal of the other one (which arrives earlier than the echo). But that didn't work.

My second idea was to desactivate the trigger pin on Arduino A, send a signal with Arduino B, get the time when the signal was sent in Arduino B and the time when sinal was received on Arduino A. But I fail to get the time of reception on Arduino A.

I know that this topic has been discussed previously, but I haven't found any answer. Could somebody help, or provide the name of sensor which can act separatly as a receiver and a trasmitter?

Many thanks!

cuipoune:
My first idea was to put them both face to face, run the code, and each will save not the echo, but the signal of the other one (which arrives earlier than the echo). But that didn't work.

What do you mean "that didn't work"? What results did you get when you pointed them at each other? How far apart were they?

Can you get both of them to work in the way they're intended to work - as distance sensors - when operated separately (not simultaneously)?

If you trigger them both at the same time when they're pointed at each other and more than 4 cm apart (I'd use considerably more than 4 cm for testing purposes...say 40 or 50 cm...to eliminate "aiming" issues), it should work.

I've done it (with a pair of HC-SR04), and it works, provided there are no objects that return a quick echo. Of course the distance reported will be half the distance between the units.

To avoid the echo problem, you can remove (de-solder) the transmit transducer from the receiving unit.

First method should work indeed.

Second method won't work as without trigger, it's not producing an echo.

Many thanks! I have now some results with the first method, but I think I have the pb with one of my sensors.