Encoding message in a 40khz signal

Hi, I am trying to find a way to send the time a pulse is emitted from one arduino connected to a 40khz transducer to another. Has anyone managed this? Is it possible?

Thanks!

No idea what you wanted. Can you explain what's involved, what is connected to what else?

So there will be two arduinos, both connected to a 40khz transducer, and I just want to send a message from one to the other.

It's basically to measure the distance from one to the other.

How far apart are the two arduinos? Can they be connected with wires? Does the message need to be sent wirelesly? What is the accuracy of the timing required? What delay can be tolerated?

I wonder if this Thread about 38kHz IR transmission is relevant?

...R

Will the message being sent include the time it was sent, and will the receiver be in-sync time-wise with the sender so it can determine the time difference from when the message was sent to when it was received?

Is the 40 KHz sonic, or RF?

cattledog:
How far apart are the two arduinos? Can they be connected with wires? Does the message need to be sent wirelesly? What is the accuracy of the timing required? What delay can be tolerated?

At the moment as close as necessary, I am seeing if it is possible.
Has to be wireless, and the accuracy will be coming from a GPS receiver, which i believe goes down to milliseconds, so need to send 00.000 if possible.
And the delay is also not so important, if you mean seconds between transmissions?

CrossRoads:
Will the message being sent include the time it was sent, and will the receiver be in-sync time-wise with the sender so it can determine the time difference from when the message was sent to when it was received?

Is the 40 KHz sonic, or RF?

Sonic, and yes they will be in sync. Just need a way of sending the time the pulse is sent in the transmission.

Rather than try and re-invent the wheel, I would get two cheap and readily available ultrasonic ranging modules, such as the HC-SR04

And then modify them as follows:

On one remove, or some-how disable the receiving transducer.
On the other remove or disable the transmitting transducer.

Then with one connected to each Arduino, and pointing towards each other, trigger them simultaneously.
When the one that can receive only gets a signal, it won't know that it wasn't sent by itself.

Obviously because the ultrasound only takes a single trip, rather than a return trip, you will need to divide the results of the distance measurement by two.

gimp:
Has to be wireless, and the accuracy will be coming from a GPS receiver, which i believe goes down to milliseconds

Microseconds.

Then with one connected to each Arduino, and pointing towards each other, trigger them simultaneously.

How is that going to happen then?

Grumpy_Mike:
How is that going to happen then?

I left that up to the user to decide. It could be done wirelessly or by a wire from one Arduino to the other.

If they were connected by a wire, you could just measure the length of the wire (unless it was slack), lol.

The answer was actually given in reply #6, GPS time sync.

Robin2:
I wonder if this Thread about 38kHz IR transmission is relevant?

...R

Only just seen this, thanks! exactly what i was looking for.
So thinking i can just place this NOR gate etc before my amplifier?