inharang2220
Posts: 9
Joined: Thu Mar 11, 2021 7:02 am

How to connect multiple sensors to TXD and RXD pins of Raspberry Pi?

Mon Apr 19, 2021 1:24 pm

I want to connect multiple lidar distance sensors to my Raspberry Pi. (Like the picture below)


Image

It is not intended to be connected identically as above, it is only for testing multiple distance measuring sensors. (Connect at least 5)

The lidar distance measurement sensor has 5v, TXD, RXD and GND pins. When I looked, it seemed that the TXD and RXD pins of the Raspberry Pi communicate with the sensor one-to-one.

(If multiple connections are connected, the Raspberry Pi turns off.)

If I try to connect 5 sensors to 1 Raspberry Pi, how do I connect TXD and RXD?

fivdi
Posts: 400
Joined: Sun Sep 23, 2012 8:09 pm
Contact: Website

Re: How to connect multiple sensors to TXD and RXD pins of Raspberry Pi?

Mon Apr 19, 2021 6:21 pm

A Raspberry Pi 4 has 6 UARTs which should make it possible. (Although UART0 and UART1 appear to use the same pins.)
See https://www.raspberrypi.org/documentati ... on/uart.md
See also https://www.tomshardware.com/reviews/ra ... ,6122.html
They are all 3V3 rather than 5V.

User avatar
thagrol
Posts: 4739
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: How to connect multiple sensors to TXD and RXD pins of Raspberry Pi?

Mon Apr 19, 2021 7:41 pm

fivdi wrote:
Mon Apr 19, 2021 6:21 pm
A Raspberry Pi 4 has 6 UARTs which should make it possible. (Although UART0 and UART1 appear to use the same pins.)
Correct but it's slightly more complex than that. Only one of those is availble to the user. The other is connected to the bluetooth controller.

Disabling bluetooth in config.txt doesn't change that.

Pi without onboard bluetooth can still only use one of those two UARTs as the alternate pins aren't available. Plus one of them is a mini UART and can affect CPU clock (or the CPU clock can impact it's speeds).
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

inharang2220
Posts: 9
Joined: Thu Mar 11, 2021 7:02 am

Re: How to connect multiple sensors to TXD and RXD pins of Raspberry Pi?

Tue Apr 20, 2021 9:15 am

Thank you everyone so much.

I found a way and solved the problem.

I activated the Raspberry Pi's UART 2~4

I was able to operate 5 lidar sensors.

Maybe somebody is interested in this

viewtopic.php?t=244827
I think you can refer to it.


Thank you everyone.

Return to “Interfacing (DSI, CSI, I2C, etc.)”