It becomes impossible for a user to plug in two or more devices simultaneously with the Raspberry Pi. Serial Expansion HAT developed to avoid this problem from the usage of Raspberry Pi multiple UART devices that makes the transmission possible to more than one device.
Introduction of Serial Expansion HAT
Raspberry Pi Organization designed the device Raspberry Pi with only a UART port to transmit and receive data over serial communication. Many people use the serial ports for the serial communication between two Raspberry Pi but for the multiple connections, Serial expansion HAT performs the system with higher efficiency.
Features of Serial Expansion HAT
- Connectivity - Raspberry Pi connectivity with standard 40 pin GPIO header, compatible with all the Raspberry Pi variants Zero/Zero W/Zero WH/2B/3B/3B+/4B.
- I2C - There is an onboard SC16IS752 that expands UART of 2-channels and 8 GPIO, programmable, through I2C.
- Easy stacking - It is arranged together up to 16 of these modules by setting the address jumper A0 and A1 that would make 32-ch UART. It would enable the user to stack the devices that enhance the efficiency of the task.
- Work position - There are multi LEDs that are connected onboard for indicating the position of work of UART which makes the user understand the status of the device.
- Raspberry Pi GPIO accessible
Detailed specification
Steps To Connect Multiple Serial Devices To Raspberry Pi
One of the common questions that come from the user is “How to connect multiple serial devices to Raspberry Pi?” that became a problem from the start of the Raspberry Pi. Serial expansion HAT is a revolutionary product that assists the user to connect multiple serial devices with single Raspberry Pi that helped the user to modify the assemble. One needs to connect the serial expansion HAT with the Raspberry Pi 4 serial ports or any Raspberry Pi variants that would enable multiple devices to connect with a single Raspberry Pi. The user needs to give the power to serial expansion HAT by the power cable to start it.
How To Configure Serial Expansion HAT?
When one does the placement of the Serial Expansion HAT on the Raspberry Pi serial port that it needs to be programmed for the task. A lot of people are looking online for the Raspberry Pi serial communication python method. One needs to perform the following steps
- Install Python Libraries
sudo apt-get install python-dev
sudo apt-get install python-smbus
sudo apt-get install python-spidev
- Enable I2C Interface
Choose: Interfacing Options->I2C->Yes
- Append this line to end of /boot/config.txt file, execute command:
sudo nano /boot/config.txt
and paste this line
dtoverlay=sc16is752-i2c,int_pin=24,addr=0x48
# addr is different according to status of A0/A1, default 0X48
- Reboot
sudo reboot
- After rebooting, you can execute the command: ls /dev/ to check if SC16IS752 has been enabled to the kernel
- You can also execute the below command to find out the connected i2c device
address: sudo i2cdetect -y 1
Details of Raspberry Pi PPP Over Serial
One of the easiest ways to setup up a connection between the Raspberry Pi and another computer is from the usage of the ETHERNET cable. If there is no possibility of this then one can set up the connection over a serial cable. PPP is the acronym of the Point-to-Point Protocol and in this process a network connection runs over a serial cable that a user can use for copying files onto the Raspberry Pi which makes the work easier for the user.
Steps to operate over serial
Step 1: First the user needs to log in to the Raspberry Pi over the serial cable and run the PPP Protocol Daemon:
sudo pppd noauth
Some garbage will start appearing in the terminal. The user needs to take this as a hint for quitting your terminal and proceed for the further process.
Step 2: Start the Point-to-Point protocol on the second computer. The user needs to use the following command
sudo pppd noauth proxyarp /dev/tty.usbserial-FTGCC2MV 115200 10.0.0.1:10.0.0.2 passive local maxfail 0 nocrtscts xonxoff
replacing /dev/tty.usbserial-FTGCC2MV with the name of your serial port.
Raspberry Pi Zero Serial Communication
The Raspberry Pi zero serial is a UART or Universal Asynchronous Receiver Transmitter to the RS232 serial converter for the Raspberry Pi Zero. The RS232 port needs the MAX3232 interface for the connection with the UART port on the Raspberry Pi. The work of the MAX3232 IC is to converts the 3.3V UART port to RS232 voltages allowing communication with RS232 compatible devices over a DB9 serial cable. A terminal application is used in the process of usage of a null-modem cable the board allows terminal access with Linux on the Raspberry Pi. A user now can use the RS232 port by the access through the DB9 port or the solder points on the PCB.