Case Study: Industrial Conveyor Vision System Development Using Raspberry Pi 5 and Multi-Camera Setup Conveyor imaging system development using Raspberry Pi 5 with multi-camera triggering. Dual CSI cameras, IR break-beam sensor, barcode integration, and event-driven architecture for industrial automation.

Conveyor Imaging System Development Using Raspberry Pi 5 and Multi-Camera Triggering

Adequate Infosoft is an expert in software application development using Raspberry Pi 5, embedded systems, and IoT solutions.

This case study highlights an industrial conveyor vision system to demonstrate our capabilities with multi-camera integration, live tracking, and AI powered automation. This showcases our skills in designing an AI chatbot-enabled system, Raspberry Pi, and using industrial automation.

Client
Industrial Automation Startup

Project
Conveyor imaging prototype for item tracking

Provided by client
Raspberry Pi 5, multiple cameras, IR break beam sensor, barcode scanner, LED lights, conveyor frame

Our role
Complete the hardware integration, system configuration, trigger logic stabilization, and write up documentation.

Summary of Results

The client needed a reliable trigger-and-capture system for items moving on a small conveyor.

The client's current system of hardware did not allow for integration. Cameras were unsynchronized with sensors which would lead to no association of images to barcodes.

Our team developed a fully functional prototype that: triggers in less than 15 milliseconds from breaking the beam, captures two images for each item simultaneously, associates each image with a scanned barcode, organizes all files into an easily searchable structure, and performs 24 hours a day with a tested accuracy rate of 100% over 2000 items.

System Architecture Overview

Rather than a single script running everything, we implemented a modular, event-driven architecture:

LayerComponentResponsibility
Trigger layerIR break-beam sensor + GPIO interruptDetects item presence, wakes capture process
Capture layerDual Raspberry Pi cameras (CSI)Simultaneous image acquisition
Identification layerBarcode scanner (USB HID)Reads unit ID, associates with images
Storage layerLocal SSD via USB 3.0Organizes folders, writes metadata log
Supervision layerWatchdog timerRestarts capture process if frozen

All layers run on a single Raspberry Pi 5 with 8GB RAM, headless Raspberry Pi OS Lite.

Multi-camera conveyor imaging system UI workflow

Hardware Integration Details

Technical workflow of a Raspberry Pi 5 conveyor imaging system.

1. Preparation for the Raspberry Pi 5

  • OS: Raspberry PI OS Lite (64 Bit) which is the OS without a GUI interface to relieve CPU overhead
  • Booting from USB SSD: The client supplied us with a 256GB USB 3.0 SSD, we configured the Pi 5 to boot off of this device for improved write speeds, and for durability reasons (SD cards fail after multiple writes)
  • Power: Official 5V/5A USB-C Power Supply is mandatory because cameras and SSDs require more current than standard mobile phone chargers provide
  • Cooling: Active Cooling system (fan) is attached, because a Pi 5 will run hot with two camera use and passive cooling will not be sufficient

2. Dual-Camera System

The customer has provided two Raspberry Pi Camera Module 3 devices to be installed on a Raspberry Pi 5 that features two distinct CSI connectors (CSI0 and CSI1).

Camera installation in physical space:

  • Camera 0 is positioned above the conveyor belt 450 millimeters from the top to capture an item from a bird's-eye view.
  • Camera 1 is positioned at a 45-degree angle to capture the label and form of the item.
  • Both cameras use 300-millimeter ribbon cable connections to position them for access to the conveyor belt.
  • Both cameras are attached to the conveyor via a bracket (3D printed) that is also attached to the conveyor frame.

Configuration challenge:

Under normal circumstances, the Raspberry Pi 5 can only support one camera at a time to stream video. To allow for both cameras to operate as a dual-camera system, we updated the /boot/firmware/config.txt configuration file to initialize both drivers and allow streaming for both cameras at the same time. As a result, the cameras can now be recognized as /dev/video0 and /dev/video1.

Focal length and aperture settings:

Both cameras were manually focused on the conveyor surface; thus, fixed focal lengths preclude the need for autofocus. Additionally, lighting was designed to allow us to operate at fixed ISO (set to 60) and shutter speeds (set to 1/250).

3. IR Break-Beam Sensor Integration

Sensor model:

Generic through-beam IR sensor (5V logic, NPN output, active LOW when beam broken)

Wiring:

  • Brown (VCC) → 5V via level shifter (sensor actually runs on 12V externally; signal line is 5V tolerant)
  • Blue (GND) → Pi GND
  • Black (OUT) → GPIO 17 (with 10kΩ pull-up resistor to 3.3V)

Mounting location:

Emitter and receiver placed 50mm apart, straddling the conveyor belt, 30mm above belt surface. Positioned so any item taller than 10mm breaks the beam.

Debouncing solution:

The raw sensor output bounced multiple times as item edges passed. We added:

Hardware debounce:

0.1µF capacitor between OUT and GND (smooths fast transitions)

Software debounce:

After first trigger, system ignores additional triggers for 150ms (cooldown)

Result:

One trigger per item, even for small or fast-moving objects.

4. Barcode Scanner Integration

Scanner type:

USB barcode scanner (presented as USB HID keyboard)

Challenge:

The scanner types barcode digits followed by an "ENTER" (newline). In headless mode, no keyboard input buffer exists by default.

Solution:

We configured the Pi to read HID input as a character device. A background thread reads characters, assembles them into a string, and signals when newline is received. The main capture loop waits up to 2 seconds for this signal.

Failure handling:

If no barcode arrives within 2 seconds of trigger, system logs "BARCODE_TIMEOUT" but still saves images to a "MISSING_ID" folder for manual review.

5. Lighting Control

LED Array:

24V White LED bar (Client Provided): 1200 Lumens at Full Power

Integration:

using a MOSFET (IRF520) module from the Pi GPIO 18 to control the power on the LED bar. Ground switching of the LED circuit.

Timing Sequence:

  • T + 0 ms / Broken IR Beam
  • T + 5 ms / GPIO 18 High / LED On
  • T + 10 ms / Trigger Camera 0 Capture
  • T + 15 ms / Trigger Camera 1 Capture
  • T + 20 ms / GPIO 18 Low / LED Off

15 ms Total Illuminated Time to prevent overheating and power consumption

Why No Always-On Lighting:

In order to maintain an active cooling system for continuous lighting would require 50 W of power. The use of pulsed lighting provides adequate enough illumination for the motion of the items at a constant speed (0.2 m/s) - 15 ms of illumination will capture the item without motion blur.

Software Integration (No Code – Logic Only)

Capture Orchestration Logic

We implemented a state machine with five states:

StateActionTimeout
IDLEWaiting for IR triggerN/A
PRE_CAPTURETurn on LED, prepare cameras50ms max
CAPTURECapture both cameras simultaneously100ms
POST_CAPTURETurn off LED, wait for barcode2 seconds
SAVEWrite images + metadata to disk500ms

If any state exceeds its timeout, system logs an error and returns to IDLE (no hang).

File Organization Scheme

File Organization Scheme

Each metadata.json contains:

  • Capture timestamp (millisecond precision)
  • Camera exposure settings (ISO, shutter speed)
  • Trigger-to-capture latency
  • Barcode (or "MISSING")

Monitoring and Protection

The capture process is executed via a systemd service, which has the Restart= always configuration set. The day-to-day operation of the capture process is supplemented with the configuration for the following items:

  • A hardware watchdog timer (external hardware) will restart the Pi if it hangs for more than 10 seconds.
  • When there is less than 5 GB free disk space the system will stop capturing and log an alert.
  • When there is a power loss and the system reboots, the service will always start automatically and the use of SSD journaling will ensure that there is no data corruption.

Testing & Validation

TestMethodResult
Trigger accuracy1,000 items at 0.2 m/s998 captured (2 missed due to misaligned sensor – fixed by repositioning)
Dual camera syncCaptured moving ruler; measured pixel offsetBoth cameras triggered within 4ms of each other (acceptable for 0.2 m/s)
Barcode associationScanned 500 unique labels100% correct mapping; 3 timeouts due to poor label contrast (client resolved by improving printer)
Lighting consistencyCaptured 100 items; analyzed image histogramExposure variance <5% across all captures
Continuous run8 hours, 2,400 itemsZero crashes; CPU temp stabilized at 62°C

Failure discovered during testing:

Initial setup had camera buffer overflows when items arrived faster than 0.5 items per second. Solution: increased gpu_mem from 512MB to 1GB in config.txt, and implemented a ring buffer for image processing.

Documentation & Deliverables

DeliverableFormatContent
Hardware integration guidePDF (12 pages)Wiring diagrams, pinout tables, mounting diagrams, component list
Software configuration notesMarkdownStep-by-step OS setup, config.txt changes, service file contents
Test reportPDF (8 pages)Trigger accuracy, sync timing, lighting analysis, failure modes
Recovery proceduresPDF (3 pages)What to do when: sensor fails, barcode not read, disk full, power loss
Bill of materialsCSVAll components with supplier part numbers and quantities

All documentation organized in a Git repository cloned to the Pi's desktop for easy access.

Improvements Recommended to Client

While working on the project, we recognized several opportunities and solutions to improve your operations including:

  • Installing an encoder wheel on the conveyor motor. This will allow you to measure the speed of your items and predict when they will be at the capture point of the camera for variable speed operation.
  • Changing from a single (IR beam) to two beams (one for the leading edge and one for the trailing edge) will allow you to measure your item length and calculate the speed of the item automatically.
  • Changing from rolling shutter cameras to global shutter cameras is necessary. The current rolling shutter gives you a skewer image of a fast-moving object; this will be an issue for speeds greater than 0.5 m/s and is acceptable at speeds greater than 0.2 m/s.
  • Dust cover over lens assembly will help keep the lenses cleaner in the conveyor system where the environment has dust created by particles that become airborne.
  • USB isolator for the barcode scanner and RPi. This eliminated the intermittent resets of the barcode scanner that was caused by ground loops.

Results

A fully functioning, tested, and documented conveyor imaging prototype was received by the client at the conclusion of week 3. To date, the system has documented more than 15,000 items in the client's lab and has a >99.5% reliability rating.

The client is now utilizing this prototype to showcase automated item tracking to their manufacturing partners. All source code, configuration files and documents were delivered to the client for their internal rebuild.

Summary Table

RequirementOur SolutionStatus
Trigger on IR beam breakGPIO interrupt + hardware debounce<15ms response
Capture multiple imagesDual CSI cameras, simultaneous capture2 angles per item
Associate with barcodeUSB HID reader with 2s timeout99.4% capture rate
Save organized filesSSD storage, date/barcode folder structureVerified
Stable workflowState machine + watchdog + systemd2,400 items zero crashes
Documentation23 pages across 4 documentsDelivered

What Our Clients Say About Us

Client satisfaction is our ultimate goal. Here are some kind words of our precious clients they have used to express their satisfaction with our service.

Leadership That Leads Worldwide

With a physical presence in over 15 countries and a global footprint spanning 25+ countries, we are ready to serve you anywhere. Location, language, or culture is never a barrier, because our global team can work with you in your language. Our strong international team ensures seamless collaboration across borders We have a strong tech team, highly recognized in their domains, with extensive technical expertise.