Here’s how to add a 9-pin serial port to your Raspberry Pi, and it’ll only take you 10 mins. Well, maybe a couple of weeks to wait for the part to arrive from Hong Kong, but once it arrives, it’s only 10 minutes! 😉
Here’s the part you’ll need. It’s an RS232 to TTL converter module containing a MAX3232 chip. The MAX3232 is important, as the older MAX232 won’t handle the 3.3v levels of the Pi, whereas the Max3232 will. It comes with a 4-way cable for connecting the module to the GPIO of your Pi. If you search on eBay for “RS232 Serial Port To TTL Converter Module MAX3232” you should find several. The one I got cost me €3 with free shipping from Hong Kong.
Here’s another view, showing the bottom of the module, indicating the +5V, GND, Tx and Rx pins.
Simply attach the cable to the module, and connect to the 5V, GND, UART Rx and UART Tx pins of the GPIO.
And a closer view of the GPIO connections.
I removed the bolts from the module so that I could plug directly into the serial port of my laptop without a long serial cable.
Once the module was attached to the laptop serial port, I downloaded PuTTY, and attached to the com port (usually COM1) at 115200 baud, 8 data bits, no parity, and no flow control.
Once I applied the settings in PuTTY, I powered on the Raspberry Pi, and saw the entire boot process displayed out the UART of the Raspberry Pi and into PuTTY on the Laptop. A login prompt was displayed, and I could then log in over the UART as normal.
Now to find a project that needs serial port access. I do have a few in mind! 🙂