Hardware - Prota04/purv-black-box GitHub Wiki
MIPI‐CSI camera
The visual evidence component of the Embedded RTOS Black Box relies on a high-speed MIPI-CSI (Camera Serial Interface) camera. Unlike USB webcams, MIPI-CSI cameras connect directly to the dedicated hardware image pipeline on the Raspberry Pi's Broadcom SoC, offering significantly lower latency, higher bandwidth, and reduced CPU overhead.
For this project, the system utilizes a camera module equipped with the Sony IMX219 sensor (standard for the Raspberry Pi Camera Module V2). This 8-megapixel sensor is highly capable of providing high-resolution, low-latency video feeds, making it ideal for capturing critical moments immediately following a vehicular accident.
Hardware Integration and Architecture
The IMX219 sensor connects to the Raspberry Pi via a flexible ribbon cable to the dedicated CSI-2 port. This physical connection bypasses the USB bus entirely, feeding raw sensor data directly into the Unicam (Universal Camera) hardware block on the BCM283x SoC. The Unicam block acts as the hardware bridge between the MIPI-CSI sensor and the system's memory. It handles the low-level MIPI protocol, packet assembly, and direct memory access (DMA) transfers, ensuring that video frames are moved from the sensor to the Raspberry Pi's RAM without requiring intervention from the ARM CPU cores.
Sensor Configuration for the Black Box
To maximize the fidelity of the captured crash scene, the camera is not configured to output compressed formats like JPEG or H.264. Instead, the system is configured to capture 10-bit packed Bayer RAW data (pRAA / SRGGB10P) at a resolution of 1920x1080 (1080p). The IMX219 outputs a raw Bayer pattern (specifically SRGGB). By capturing 10-bit data, the system preserves 1024 levels of intensity per color channel. This maximizes the dynamic range and ensures that no data is lost to lossy in-camera compression algorithms.
Role in the System
In the context of the Black Box, the MIPI-CSI camera acts as the "eyes" of the system. While the LSM9DS1 IMU detects the physical dynamics of the crash (impact G-forces and rollover angles), the camera provides the contextual visual evidence. Because the camera hardware pipeline is kept in a continuous "warm" state (streaming in the background), the system can capture a frame of the accident scene within milliseconds of the impact being detected, ensuring that the exact moment of the crash is preserved.