
This circuit features a Raspberry Pi 5 connected to a pushbutton. The pushbutton is powered by the 3.3V pin of the Raspberry Pi and its output is connected to GPIO 15, allowing the Raspberry Pi to detect button presses.

The Raspberry Pi Pinout Diagram is an essential reference for developers and hobbyists working with the Raspberry Pi single-board computer. This diagram provides a visual representation of the General Purpose Input/Output (GPIO) pins, detailing their functions, characteristics, and how they can be utilized in various projects. Common applications include interfacing with sensors, controlling motors, connecting to other integrated circuits, and building Internet of Things (IoT) devices.

This circuit features a Raspberry Pi 5 connected to a pushbutton. The pushbutton is powered by the 3.3V pin of the Raspberry Pi and its output is connected to GPIO 15, allowing the Raspberry Pi to detect button presses.

This circuit consists of a Raspberry Pi 3B microcontroller connected to a two-pin red LED. The GPIO22 pin of the Raspberry Pi is connected to the anode of the LED, and one of the Raspberry Pi's GND pins is connected to the cathode of the LED. This setup allows the Raspberry Pi to control the LED, turning it on and off by toggling the GPIO22 pin.

This circuit features a Raspberry Pi 4B connected to four individual 2Pin Push Switches. Each switch is connected to a unique GPIO pin on the Raspberry Pi (GPIO23, GPIO22, GPIO27, GPIO17) and all switches share a common ground connection. The purpose of this circuit is likely to allow the Raspberry Pi to detect button presses, with each switch corresponding to a different input signal.

This circuit consists of a Raspberry Pi 4b controlling eight red LEDs, each connected in series with a 330-ohm resistor. The GPIO pins of the Raspberry Pi are used to individually control the LEDs, with the cathodes of all LEDs connected to the ground pin of the Raspberry Pi.
The following table provides an overview of the pin configuration for a typical Raspberry Pi model (e.g., Raspberry Pi 4 Model B). Please note that pin configurations may vary slightly between different Raspberry Pi models.
| Pin Number | Name | Description |
|---|---|---|
| 1 | 3V3 | 3.3V Power Rail |
| 2 | 5V | 5V Power Rail |
| 3 | GPIO2 | SDA (I2C) |
| 4 | 5V | 5V Power Rail |
| 5 | GPIO3 | SCL (I2C) |
| 6 | GND | Ground |
| ... | ... | ... |
| 39 | GND | Ground |
| 40 | GPIO21 | SPI MISO |
Note: This table is not exhaustive. Refer to the official Raspberry Pi documentation for a complete pinout diagram.
Q: Can I use all GPIO pins for general input/output tasks? A: Most GPIO pins can be used for general purposes, but some have specialized functions (e.g., SPI, I2C, UART). Refer to the pinout diagram for details.
Q: What is the maximum voltage that can be applied to a GPIO pin? A: The maximum voltage for a GPIO pin is 3.3V. Exceeding this voltage can damage the Raspberry Pi.
Q: How can I protect the GPIO pins from damage? A: Use voltage level shifters for interfacing with 5V devices, and employ current-limiting resistors to protect against overcurrent situations.
Below is an example of how to set up serial communication between a Raspberry Pi and an Arduino UNO. This code snippet would be run on the Raspberry Pi.
import serial
import time
# Set up the serial connection (adjust '/dev/ttyACM0' to the port where your Arduino is connected)
ser = serial.Serial('/dev/ttyACM0', 9600)
time.sleep(2) # Wait for the connection to be established
# Send data to the Arduino
ser.write(b'Hello Arduino!')
# Read data from the Arduino
while True:
if ser.in_waiting > 0:
incoming_data = ser.readline().decode('utf-8').rstrip()
print(f"Data received: {incoming_data}")
Note: Ensure that the Raspberry Pi and Arduino are connected using the correct TX and RX pins and that the ground pins are connected to establish a common ground.
Remember to consult the Raspberry Pi and Arduino UNO documentation for detailed information on pinouts and serial communication setup.