Not only does the Raspberry Pi 4 boast impressive new hardware upgrades, but beneath the surface, it also comes equipped with supplementary GPIO functions that simplify project development. These extra interfaces enable users to effortlessly expand their peripheral configurations without needing additional equipment. Specifically, the Raspberry Pi 4 provides an abundance of I2C, UART, and SPI interfaces for dedicated use.
GPIO pinouts
Conveniently, the Raspberry Pi 4 contains all the GPIO pinouts, making it easy to reference the specific pin layout. Simply navigate to the command line and enter the command ‘pinout’ to instantly access the full list of pinouts, allowing for improved accuracy and efficiency in your project development.
Below is a list of all the new Raspberry Pi 4 extra pinout features:
GPIO – General Purpose Input Output Pins
These digital pins can act as inputs, where they are configured to receive a digital input signal or as outputs which to put out a digital signal. On the Raspberry Pi a 3V3 logic is applied on each GPIO pin which means 3V3 is HIGH or ON and 0V is LOW or OFF. Thus you can connect and digital component to the Raspberry Pi and either deliver a 3V3 (ON) signal to it or receive a 3V3 digital signal in cases where current is up to 16mA.
I2C – Inter-Integrated Circuit
This is a relatively usual sort of call between apparatuses, and it depends on the presence of a leader and a subordinate. The master in this scenario is a raspberry pi and the slave devices are typical extension inputs that other hardware peripherals would normally offer to your projects. The beauty of I2C is if you have hundreds of devices that need to be tied up to the same master I2C, you can do it using the same two wire interface as long as all the devices are addressing using different I2C address.
sudo i2cdetect -y 1
Where “1” is the master interface. The Raspberry Pi 4 has 6 in total.
SPI – Serial Peripheral Interface
SPI is yet other type of serial communication which is used in transfer of information from one or more devices. It also employs master and slave configuration, though it is primarily used for the connections that are transient between a major or master controlling device and peripheral or slave device such as sensors. As a rule, SPI typically utilizes three wires in raspberry and these are SCLK, MOSI and MISO wires. Before using SPI you need to enable it within the Raspberry Pi configuration menu:Before applying SPI you have to turn this option on under Raspberry Pi configuration settings:
UART-Universal Asynchronous Receiver/Transmitter
Distinguishing it from I2C and SPI, UART is not a protocol per se, but rather a dedicated circuit designed for serial data transmission and reception. Its asynchronous nature eliminates the need for a clock signal, thereby reducing the necessary wires required for data exchange. However, this approach does necessitate the inclusion of additional data packets, such as start and stop bits, to facilitate error checking. In the context of the Raspberry Pi, UART is commonly employed in headless setups, where users forego a graphical interface and instead interact with the device via the command line, connecting it to a desktop, laptop, or other device over UART. This method caters to more advanced users, requiring some expertise in configuring and utilizing the circuit.
One common scenario among Raspberry Pi enthusiasts is to harness the power of the Arduino UNO board in conjunction with the Pi, as the Pi’s analog capabilities are inherently limited. By connecting the two boards, users can leverage the strengths of each, unlocking enhanced analog functionality and broader creative possibilities for their projects.
Source: Raspberry Pi 4 Pinout