Sj3rd
Posts: 1
Joined: Sun May 12, 2019 1:46 pm

2 RX/TX accesoires

Sun May 12, 2019 1:52 pm

Hi,

Im new to working with a raspberry pi, and Im working on a project which uses a GPS and a battery monitor. The battery monitor uses a serial connection with TX (so uses RX on my pi), and the GPS also uses TX (so uses RX on my pi).

How should I wire up the 2 cables. Both on one pin wont work I guess, but can I just put them on different GPIO I2C pins and initialize them on those pins?

Kind regards,
Raspberry Pi Rookie

Andyroo
Posts: 4466
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: 2 RX/TX accesoires

Sun May 12, 2019 8:11 pm

I2C is not the same type of serial port as the TX/RX port.

Do you have links to the devices - most GPS units are standard serial (RS/232 at either 3.3V or 5V) but battery monitor can be anything under the sun.

You also need to check the voltage on the GPS and battery monitor - 5V will kill the Pi :cry:
Need Pi spray - these things are breeding in my house...

User avatar
PeterO
Posts: 5005
Joined: Sun Jul 22, 2012 4:14 pm

Re: 2 RX/TX accesoires

Sun May 12, 2019 8:17 pm

If they are not logic level signals (3.3v or 5v) the using a couple of USB-RS232 dongles would be one way to do it.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

1wire
Posts: 5
Joined: Mon Oct 01, 2018 7:42 am

Re: 2 RX/TX accesoires

Tue May 28, 2019 1:44 pm

I have a similar question, so I am going to post it into this thread.

One UART of my Pi Zero (or Raspi3B, no matter) is already occupied by a power metering device.
Now I want to install an additional communication with a peripheral (Arduino Nano, or ESP8266), which has to be isolated by an optocoupler.
How can this be achieved most easily?
I guess, Rx/Tx is the signal that can be passed through an optocoupler most easily; low Baud rate is enough. But then, can I activate a second serial port in the Raspi, perhaps over USB, in addition to the usual UART pins?
Alternatively, SPI or I2C is considered, but SPI requires more wires to be coupled, and I2C deserves a more expensive optical coupler.

In short: Can I use more than one (asynchronous) UART (Rx/Tx) port in the same time on the pi?

edit: The choice of using a Pi Zero or a Raspi 3B does matter. If using a Pi Zero, the only USB port might already be used (e.g. by a permanent USB stick), so that a GPIO solution would be generally more flexible.

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