Using HCSR 04 for communication

HCSR 04 is a distance measuring Ultrasound Module. Can we use that for communication by interfacing to an Arduino at both receiver and transmitter side? If yes how?

With regards

Probably, but not at very high data rates.
Maybe ten or twenty bits per second.


If I have a temperature sensor interfaced to Arduino, can I send measured data?
Anyway measured sensing data is very small, so can we?

How long have you got to complete your project?


If I have a temperature sensor interfaced to Arduino, can I send measured data?
Anyway measured sensing data is very small, so can we?


Why the HC-SR04? Is there a reason you can not just use some transducers and make your own circuits?

You can make a basic oscillator to drive the transducer at the 40KHz...
Use a 40Khz Crystal oscillator circuit. This will pulse the transducer, causing it to make a sound.

You can then send data by simply using a fast switching transistor to turn the transducer on and off.

Data can be sent via an arduino pin to the binary using shiftout()

A checksum and a pre-amble sequence may be things you need to look in to. Check out "Manchester Encoding".

Just had a look myself out of interest, but an Astable 555 circuit will produce 40KHz with 100ohm resistors and a 170nF capacitor.

Use that maybe?

I am a if anything I am saying is really dumb, then someone please intervene :P.

Looks like someone got there first:

Without modifying the HC-04 it would be very difficult because you would have to develop a scheme that first synchronizes the two communicating nodes. The reason is that the HC-04 works by emitting a pulse and only then listening for a return, thus it isn't normally listening for arbitrary transmissions.

From the schematic linked below, it seems like it would be possible to tap into the HC-04 "Signal" net and directly detect any received transmission. Then one would have to develop some protocol (OOK, PPM, etc) for message exchange. It's kind of an interesting possibility though the practical value vs RF communications isn't obvious to me. Maybe underwater comms?

For what it's worth, this topic piqued my interest enough to spend a few hours exploring it.

Based on information here ( I modified a pair of HC-SR04 devices by removing the microcontroller from the transmit device adding wires to directly control "TX1", "TX2", and "HVoff" and the receive device to add a wire to directly read "Signal". My HC-SR04 had a somewhat different component layout from that pictured in the link, but the signals at U1 were the same.

Ultimately I was able to demonstrate reliable detection of a sequence of transmit bursts over a distance of a couple meters inside my workshop before it became unreliable.

I tried a couple approaches to FSK signaling, but FSK only worked over very short distances. I believe this is because the receive transducer is sharply resonant at a particular frequency so it essentially output that frequency (after detection) unless driven by a very strong input signal. The practical result is that one is limited to OOK or PPM signaling schemes.

The other discovery, which is probably obvious in retrospect, is that the receive sensor sees a lot of echoes so a nominal 200 microsecond transmit burst results in a detection burst that may last several milliseconds. This duration is probably highly dependent upon the environment (a modest-sized room in this case) but the net result is that one has to wait for a burst to die down before transmitting the next. Thus signaling rate is limited to something on the order of 100 bits per second.

"Signal" is nominally a binary 40 kHz burst so my symbol detection logic (eventually) was simply to look for some small number of cycles with about the right period. This rejected most noise events and was sufficient to detect FSK at very short ranges.

If someone else were to pursue this, the modification to the transmit device is probably unnecessary to start. The standard device produces an 8 cycle 40 kHz burst (200 microseconds) and I didn't find the ability to produce longer or different frequency bursts particularly helpful for this application.