Building a breadboard to interface a GPS system to a UART on the Jetson TK1 only requires a couple of parts, a GPS breakout board and a Level Shifter breakout board. Looky here:
Background
The Universal Asynchronous Receiver/Transmitter (UART) was invented by Gordon Bell in 1971 to translate data between parallel and serial forms. You can read more about it here: Wikipedia UART article. This can be considered the grandaddy of serial communication, and is popular for a variety of reasons. UART communication is inexpensive, it only requires a couple of wires to send data and there is no need for a clock to be transmitted. In order communicate, both sides need to be operating at the same speed (baud rate, stop bits), the transmitted protocol will synchronize the rest. This type of communication is ubiquitous globally throughout the telephone and computer industries.
Serial Communication on the Jetson
In addition to UARTs, the Jetson TK1 also has two other forms of serial communication available through the J3 headers. Both of these are synchronous in nature, I²C and SPI. You might recall that we interfaced against I2C in the LIDAR-Lite installation article a while back. Both I2C and SPI have a clock that is transmitted over a wire, along with a wire(s) for the actual data itself. The reason for using synchronous serial communication? Speed. Historically transmitting the clock signal limited the distance that data could transmitted reliably.
Another means of serial communication is USB, which is probably much more familiar to most people. This form of communication was invented in the mid 1990s so that manufacturers would have a simple way of interfacing serial devices such as mice and keyboards with personal computers. Over the years the amount of bandwidth that could be transmitted increased exponentially from around 12 Mbs for USB 1.0 to 5 Gbs for USB 3.0. The Jetson has 2 USB ports.
UARTs on the Jetson
The Jetson has 3 UART ports available. The first is attached to the DB9 connector on the board, commonly referred to as the ‘serial console’. It’s easy to identify, it looks like it came from the 1970s. The other two UART ports are accessible through the J3A2 header.
The UARTs on the header operate at 1.8V signal levels. You should note that most popular devices designed to use UART serial communication on systems like Arduinos, Raspberry Pi, etc. work at 3.3V or 5V signal levels. Therefore it is necessary to shift the level to the correct operating voltage between the device and the Jetson. Fortunately this is simple using what is called a logic level converter, or more colloquially, a level shifter.
In our example, we will hookup a GPS breakout to the Jetson TK1 via a level shifter breakout on a breadboard. It will look something like this when we’re done:
Parts
A couple of devices are needed. First the GPS, an Adafruit Ultimate GPS Breakout:
Second, an Adafruit 4-channel I2C-safe Bi-directional Logic Level Converter:
In the video, a Solderless BreadBoard, 400 tie-points, 4 power rails was used, along with some regular breadboard jumpers, along with Hook up Wire – 22 Gauge
.
Additional Tools
There are a couple of tools that are useful for this project:
1) A soldering iron, in the video a Hakko FX888D-23BY Digital Soldering Station was used.
2) Wire strippers, in the video a Hakko CHP CSP-30-1 Wire Stripper, 30-20 Gauge Maximum Cutting Capacity was used.
13 Responses
Hello,
Thank you for your posts & videos! It’s really great that you’ve been working with Jetson over a year and still post your findings regularly!
Did you try to use those level-shifters to sense higher voltages, like 24V DC? Also, how would you go about integrating optocouplers/relays to safely sense/drive external signals?
Andrew
Hi Andrew,
First thanks for reading and watching!
The level shifter mentioned above goes down to 1.8V on the low side, and about 10V on the high side. These devices are generally used to mix 3.3V/5V devices as it is a common voltage with a lot of sensors, flash cards, and displays with devices such as Arduinos and Raspberry Pi.
Personally I would shy away from bringing 24V around the Jetson. Most of the time people build external boards to handle higher voltages/currents for things like driving motors.
I’m not an electrical engineer, so you’ll have to take my answers with that in mind. Hopefully there’s enough of an answer here to get you started looking for a more complete answer.
Typically for relay control, you’ll want to bring in extra power to drive the relays. To control a relay, a common application is a resistor and a transistor (for example, control voltage -> 1K ohm resistor -> 2N2222 transistor with a 1N4001 diode). That’s for simple on/off. To fully control a motor, you’ll need two relays, then there’s half-bridge relays and a whole little kingdom of relay combinations. For controlling several relays, some applications use a Darlington array (such as a ULN2003) which combines the necessary logic and support into an IC chip. A lot of smaller relays work on a 5V control signal, you may have to level shift the 1.8V from the Jetson to get them to play nice.
An optocoupler can be used as a level shifter. This device decouples the input from the output entirely by putting a optical circuit in the middle. It depends on the device selected, but my initial guess would be that 1.8V to control the optocoupler might be on the low side. You may have to level shift 1.8V control signal to 5V to get the optocoupler to respond.
Hope this helps
Thank you for an extensive and prompt answer!
Using transistor to drive a relay sounds like a great idea! As I understand, Jetson provides +5V among via extension pins? Thankfully, the relay is for a simple connection without any motors, so that should do. Didn’t hear about the Darlington arrays, thank you for the tip, I’ll research them.
I will also try a 4N35 optocoupler soon and I think it’s more about the current I can supply it rather than voltage, so I think 10mA should make it respond quite well.
Andrew
J3A1 Pin 1 is +5V, it can supply up to 500mA.
Great video and article!
Correct me if i’m wrong, but i can use the tx/rx pins with 5v from level shifter instead of 3.3v?
Thanks,
Gabor
Thank you for the kind words. You are correct, you can convert the signal level to 5V instead of 3.3V. Thanks for reading!
hi
My problem is “how to open the uart1 and uart2 on jetson-tk1”. I have tried to use pyserial to solve it but failed, and python feedback “could not configure the port” Should I do something about uart1 and uart2? like rebuild the kernel? Thanks.
I have not seen this issue. Please ask this question on the official NVIDIA Jetson forum where a large number of developers and NVIDIA engineers share their experience. Jetson TK1 forum: https://devtalk.nvidia.com/default/board/162/jetson-tk1/
Hello,
Thank you for the informative video and article!
Do you know how accurate the GPS is?
Thanks,
Igor
You are welcome. You can check with the manufacturer for the specifications: https://www.adafruit.com/product/746
Thanks for reading!
Hello,
Would the same parts work for the Jetson tx2? There are no pins for 1.8V or 3.3V
Hello,
Thank you for this informative video and article.
Have you tried to interface this GPS system to a UART on the Jetson AGX Xavier??
Thanks
Anayat
I have not tried it. Thanks for reading!