Parallel UART connection for 2 Ping2 sonars

Hello. We have 2 Ping2 sonars and not enough USB ports to connect them into. Knowing that the Ping Protocol is based on a master-slave architecture, does the devices only respond to messages with their own target device id? And with that would it be possible to connect them in parallel?

Hi @thndr0 -
This is unfortunately not possible, as the Ping2 communicates via TTL Serial - this is not a bus compatible communications protocol like RS485 or ethernet.

Maybe you could use a USB hub or other serial ports - does your platform have hardware serial ports? The Raspberry Pi 4 has a bunch, and some are broken out by the Navigator.)

Hi,
firstly thanks for your reply.
We are aware that UART isn’t a bus communication protocol. But the Ping protocol which shouldn’t have any issues if it was connected in parallel, since it is a half-duplex master-slave protocol. When the master device doesn’t send any command, then Ping device won’t send anything. So both devices wouldn’t send messages simultaneously, because they will receive and respond to messages in order, controlled by the master device.
Looks like Ping protocol implements a device ID system, and if it is correctly implemented a sonar must ignore the incoming messages whose destination ID doesn’t match with the regarding sonar.
This is the specific point we would like to learn about. Is the ID mechanism implemented in the Ping2 firmware and does it ignore the messages with the wrong ID.
If it does, the only remaining difficulty for us to overcome, is the TX pins of the sonars connecting in parallel and including the risk of a short circuit between two TX pins, which we plan to overcome by using some diodes or a sort of logic circuitry.
We considered about the concerns and these were the concerns we’ve found about using them in parallel. And the only point that we don’t have information about it is the implementation of the device ID system in Ping firmware, if it is ignoring the messages with a wrong destination device ID. So we would like to be informed about it. We have UART ports on our device, but we want to cut on the number of them, because we wish to use them for other devices. And it would create the nice opportunity for us to add as many sonars as we want and don’t without of the need for more UART or USB ports.

Also if there are any other concerns which comes to your mind, please tell us about it so we can avoid it or find a way to overcome it.
Thanks in advance for your answer.

Hi @thndr0 -
Unfortunately the documentation states that the device ID is not a currently supported firmware feature. Apologies!

More correctly, ping protocol specifies a device ID system (i.e. the protocol includes fields that such a system would theoretically require to function). As @tony-white mentioned, the potential filtering functionality of those fields isn’t implemented at moment, on either side (in the firmware, or in our interfacing libraries/software).

I’ve just raised an issue to track this, although given our current development projects, combined with the fact that most users don’t need the feature, it seems unlikely we’ll be able to prioritise it in the near future - sorry!

Once you’re able to communicate with multiple sonars, the main usage concern is around interference between them, which there’s some extra discussion about in this thread :slight_smile:

1 Like