How to extend serial communication on Raspberry Pi?

Thread Starter

choikyungho9

Joined Apr 5, 2021
1
Hello I would like to get distance data by attaching multiple lidar distance measuring sensors.

like the picture below.

1618836326090.png

However, the Raspberry Pi appears to communicate one-to-one with the sensors of the TXD and RXD.

How do I configure my test circuit if I want to do serial communication with 5 TF MINI sensors on the Raspberry Pi?
 

Yaakov

Joined Jan 27, 2019
3,517
How do I configure my test circuit if I want to do serial communication with 5 TF MINI sensors on the Raspberry Pi?
You are going to have to use something as a mux (multiplexer) to receive the data and deliver it to the one UART on the RPi. Or, use something else to collect the data and send cooked data to the RPi.

A board like a Teensy 4.1 has many serial ports and could be a good option.
 

Irving

Joined Jan 30, 2016
2,104
Are you sure the link to the TF sensors is an asynchronous serial interface? That sounds potentially very slow for what is usually a fast data stream. Do you have a link to the TF sensor datasheet?
 

Yaakov

Joined Jan 27, 2019
3,517
Are you sure the link to the TF sensors is an asynchronous serial interface? That sounds potentially very slow for what is usually a fast data stream. Do you have a link to the TF sensor datasheet?
It appears to be I2C, actually. The RPi does have I2C kernel support but I don't know if the TF Mini supports five addresses.
 

Irving

Joined Jan 30, 2016
2,104
Ah, if thats the case there are I2C extenders that resolve addresses externally - we've used a similar approach to address multiple ultrasonic range finders that only have a fixed address.
 

Yaakov

Joined Jan 27, 2019
3,517
Ah, if thats the case there are I2C extenders that resolve addresses externally - we've used a similar approach to address multiple ultrasonic range finders that only have a fixed address.
It seems that the original TF Mini wasn't even really LIDAR, and the Plus is UART based, so...
 

Yaakov

Joined Jan 27, 2019
3,517
Ugh, too many posts, sorry... Looking at the photo, those look like the original, but I guess we just need to see what he is actually using.
 

Irving

Joined Jan 30, 2016
2,104
yes. 115kbps is giving ~1200 samples/sec though they recommend no higher than 500Hz frame rate. The baud-rate can be increased using standard rates but it doesn't say how high it'll go. Depending on required # of sensors and frame rate per sensor there may be limits on mux arrangements. Using 115k baud rate, max frame rate is around 200 or so for 5 sensors.
 
Top