What makes Raspberry Pi 5 special?
Processor | Broadcom BCM2712 – 64-bit quad-core Arm Cortex-A76 @ 2.4 GHz CPU (8 MB L2) |
---|---|
GPU | VideoCore VII (@800 MHz) with OpenGL ES 3.1 & Vulkan 1.2 support |
Memory | LPDDR4X-4267 variants 2 GB / 4 GB / 8 GB / 16 GB |
Display | Dual micro-HDMI 2.0 (up to 4 K p60 HDR) |
Camera / Display FPC | Two 4-lane MIPI CSI/DSI (22-pin) connectors |
PCIe | One PCIe 2.0 ×1 (FPC) via RP1 south-bridge (supports M.2 HAT+) |
USB | 2 × USB 3.0 (5 Gb/s), 2 × USB 2.0 |
Networking | Gigabit Ethernet (+PoE+ HAT), dual-band 802.11ac Wi-Fi & Bluetooth 5.0 |
Power / Management | USB-C PD (5 V @ 5 A), on-board power-button, integrated RTC with rechargeable Li-Mn coin-cell connector |
Note: Active cooling is strongly recommended; use the clip-on Active Cooler or the official fan-equipped case.
From parts to first boot
Use Raspberry Pi Imager (macOS/Windows/Linux) → pick Raspberry Pi OS (64-bit, Bookworm), click the cog ⚙️ to preset locale, Wi-Fi, SSH, and username, then write to the chosen storage.
# ① Enable SSH by creating an empty file
touch /Volumes/boot/ssh # macOS
# ② Add Wi-Fi credentials
cat >> /Volumes/boot/wpa_supplicant.conf <<EOF
country=ZA
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="MyNetwork"
psk="SuperSecret"
}
EOF
Insert media → power-up → find its IP via router and run
ssh pi@<IP>
.
Secure and update your installation
sudo raspi-config
sudo apt update && sudo apt full-upgrade -y
# Update Pi firmware & EEPROM
sudo rpi-eeprom-update -a
micro-SD vs NVMe SSD (PCIe)
BOOT_ORDER=0x14
if desired.The PCIe link runs at Gen 2 ×1 (≈ 5 Gb/s), ideal for storage or accelerators.
Physical computing with 40-pin header
The 40-pin HAT header follows the classic layout (Broadcom BCM numbering). Voltage is 3 V3 tolerant; avoid 5 V signals without level-shifting.
import RPi.GPIO as GPIO
from time import sleep
pin_led = 18
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin_led, GPIO.OUT)
try:
while True:
GPIO.output(pin_led, True) # .on()
sleep(0.5)
GPIO.output(pin_led, False) # .off()
sleep(0.5)
except KeyboardInterrupt:
GPIO.cleanup()
Hint: Use pigpio for precise PWM, or libgpiod from C for low-latency I/O.
Cameras, displays, audio & USB
Both CSI connectors now expose four data lanes: run two × 13-MP HQ modules simultaneously or drive high-bandwidth sensors. Record 4 K streaming via libcamera or GStreamer.
HDMI audio by default. Analogue 3.5 mm jack removed; use a USB DAC or I²S codec HAT for low-latency audio projects.
Put your Pi to work
Stay cool under load
The clip-on Active Cooler plus PWM fan header keeps CPU < 70 °C at full load and remains <34 dB(A).
# Adjust fan curve (Bookworm)
sudo raspi-config nonint do_fan 65 75 100
Common issues & fixes
dtparam=pciex1
to
/boot/config.txt
.
sudo dtoverlay=rpi5-rtc,power-domain=0
Note: Autofocus motors (CM3) are disabled in total darkness—flash a brief visible LED during start‑up to lock focus, then switch to IR‑only capture.
libcamera-vid -t 0 -n \
--width 640 --height 480 \
--framerate 120 \
--codec yuv420 \
-o - | ffplay -f rawvideo -pix_fmt yuv420p -video_size 640x480 -
This shell one‑liner delivers low‑latency preview at 120 fps; pipe to gstreamer or OpenCV for processing.
#include <opencv2/opencv.hpp>
using namespace cv;
int main(){
VideoCapture cap(0, CAP_V4L2); // /dev/video0
cap.set(CAP_PROP_FPS, 120);
cap.set(CAP_PROP_FRAME_WIDTH, 640);
cap.set(CAP_PROP_FRAME_HEIGHT,480);
Mat frame, gray, thresh;
while(cap.read(frame)){
cvtColor(frame, gray, COLOR_YUV2GRAY_I420); // camera stream is YUV420
medianBlur(gray, gray, 5);
threshold(gray, thresh, 40, 255, THRESH_BINARY_INV);
std::vector> ctrs;
findContours(thresh, ctrs, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE);
if(!ctrs.empty()){
auto c = *std::max_element(ctrs.begin(), ctrs.end(),
[](auto &a, auto &b){ return contourArea(a) < contourArea(b);} );
RotatedRect box = fitEllipse(c);
circle(frame, box.center, box.size.width/2, Scalar(0,255,0), 2);
printf("Pupil @ %.1f,%.1f\n", box.center.x, box.center.y);
}
imshow("eye", frame);
if(waitKey(1)==27) break; // Esc to quit
}
}
Tips: calibrate pupil threshold per user; integrate KalmanFilter for smooth gaze estimation; log box.center to CSV for later ML regression.
11.5 Synchronizing Dual NoIR Cameras
- Attach both CSI cables (CAM0 & CAM1) ➜ enable dtoverlay=imx708_dual in
/boot/config.txt
.
- Use
libcamera-still --list-cameras
to verify dual streams.
- Launch separate
libcamera-vid
instances or aggregate in v4l2loopback for stereo fusion.
11.6 Latency & Power Budget
- CM3 @ 120 fps ≈ 450 mW sensor + 140 mW AF coil (only during focus)([adafruit.com](https://www.adafruit.com/product/5659?utm_source=chatgpt.com))
- 850 nm LED ring (8 × 5 mm) ≈ 120 mA @ 3.3 V; power via 5 V rail & FET driver.
- GPIO‑fan curve: keep SoC < 65 °C to avoid dropped frames.
11.7 Calibration Workflow
- Present nine‑point grid; record pupil center & map to screen coords with leastSquares.
- Store coefficients (A,B,C,D) in
~/.config/eyetracker.cfg
.
- Re‑run quick 3‑point validation routine every session; apply drift‑correction with exponentialMovingAverage.
10. Further Reading & Sources
Official documents & community threads
- Raspberry Pi 5 Product Brief (PDF).
- “Introducing: Raspberry Pi 5!” blog.
- M.2 HAT+ documentation.
- Active Cooler product brief.
- Headless setup forum guide.
- Wi-Fi specification discussion.