Case Study: Custom AI Powered Smart Camera Complete Turnkey Development Case study: AI-powered smart camera with NXP i.MX, edge AI, firmware, PCB design, cloud & PLC integration. End-to-end vision system by Adequate Infosoft.

AI-Based Camera Development with NXP i.MX, Firmware & PCB Design

This case study will show the full development of a custom AI-powered smart camera solution, from the idea stage to the final product, by Adequate Infosoft.

Our team provided firmware development, custom hardware engineering, PCB design, AI cloud integration, mobile connectivity, prototyping, enclosure development, and production support to provide a scalable, smart surveillance product that meets the client’s needs.

Client: Industrial automation startup (North America)
Project Goals: Create a custom smart camera to detect defects in fast-moving production lines (at 120 units/minute). Results:Deployed a production-ready system to 3 factories, achieving 99.7% accuracy in detecting defects.

ai-based-camera-development-nxp-imx-firmware-pcb-design

Challenge

The production line already used human inspectors to check for quality and detect defects. The inspectors sometimes missed 15% of defects (wrongly placed labels, surface scratches, and missing parts) due to their inability to quickly look at the images as they moved through the line.

Both commercial machine vision options did not meet the requirements of the client due to one of the following reasons:

  • Too expensive
  • Too large (could not fit in the 100mm x 80mm available space)
  • Missing specific features (need for custom lighting control, edge AI, and real-time cloud alerts)
  • The common area lights do not turn off and waste energy
  • An overflow of the water tank went unnoticed until it started flooding into the common room
  • Misunderstanding with the monthly bills for utilities between members because there is no meter for each unit separately.
  • There is no early warning system for gas leaks or electrical issues.

The customer required an AI-enabled compact and custom-built smart vision camera that must:

  • Collect high-resolution photographs (5MP) at a rate of 120 images per minute;
  • Perform real-time defect analysis at the edge without requiring the cloud for its primary functions;
  • Provide control over its integrated LED lighting (utilising strobing for production line synchronisation);
  • Send alerts and images of defects to a cloud-based server for analytical purposes;
  • Continuously operate 24/7 in a rugged industrial environment (0oC - 50oC, dusty).
  • Connect to a factory Programmable Logic Controller (PLC) for use as part of a rejection mechanism.

Adequate Infosoft was selected to develop the entire system through consulting, engineering, and manufacturing capabilities through hardware design and firmware development and producing the software for the cloud platform along with training the artificial intelligence models, this was all to be completed in a timeframe of less than 4 months.

custom-solar-powered-wildlife-camera

Our Solution: End-to-End Smart Camera Platform

Hardware & PCB Design

We designed a custom, compact PCB integrating all required components into a 90mm x 70mm form factor.

Hardware Architecture

Hardware Architecture

Key Hardware Specifications

Component Selection Rationale
Image Sensor OnSemi AR0521 (5MP, 2592x1944) Global shutter (critical for moving objects), excellent low-light performance
Main Processor NXP i.MX RT1060 (Cortex-M7 @ 600MHz) Real-time performance, industrial temperature range, rich peripherals
AI Accelerator Google Coral Edge TPU (4 TOPS) 4 trillion operations per second for real-time inference
Memory 512MB DDR3 + 8GB eMMC Frame buffering + firmware storage
Connectivity Gigabit Ethernet (W5500) + optional 4G Factory network integration + remote access
I/O 4x optically isolated inputs, 4x relay outputs PLC trigger input + reject output
Illumination High-power LED driver (up to 2A, PWM controlled) Synchronized strobe lighting for clear images
Power 24V DC industrial input, 5V/3.3V onboard regulation Standard factory voltage
PCB Layers 8-layer, controlled impedance, ENIG finish Signal integrity (MIPI, DDR), industrial reliability

Critical PCB Design Challenges & Solutions

Challenge Our Solution
MIPI CSI-2 signal integrity Matched trace lengths (0.5mm tolerance), 100Ω differential impedance, ground shielding between pairs
High-speed DDR3 routing Fly-by topology with on-board termination, length matching within 2mm
Thermal management (Coral TPU) 4x4mm thermal pad under device, 9 thermal vias to bottom-side copper pour, aluminum enclosure contact
EMI/EMC compliance Split digital/analog grounds, ferrite beads on power rails, shielded enclosure with gasket
Industrial environment Conformal coating on all PCBs, wide-temp components (-40°C to 85°C rated)

PCB Layout Statistics:

  • 8 layers, 90mm x 70mm
  • 1,247 components, 2,845 nets
  • 3 months of layout effort (including 2 re-spins for optimization)
  • Passed thermal, signal integrity, and EMI simulations before fabrication

Firmware & Embedded Software

Our firmware team wrote efficient, real-time code running on the i.MX RT1060 and Coral Edge TPU.

Firmware Architecture

Firmware Architecture

Key Firmware Features Implemented

Feature Implementation Details
Trigger-to-image latency <50ms from PLC trigger to captured image (optimized sensor register config + double-buffering)
AI inference time <30ms per frame (YOLOv8-tiny on Coral TPU)
Real-time detection 120 units/minute = 500ms per unit → 80ms spare margin
Image capture 5MP at 15fps, auto-exposure with strobe synchronization
Edge storage 8GB eMMC circular buffer (last 10,000 defect images)
Network protocols MQTT (telemetry), FTP/HTTP (image upload), Modbus TCP (PLC integration)
OTA updates Firmware, Edge TPU model, and bootloader updates over Ethernet
Watchdog Hardware watchdog timer with 5-second timeout, auto-reboot on hang
Self-diagnostics Temperature monitoring, frame drop detection, network health checks

Codebase Statistics:

  • 35,000+ lines of C/C++ firmware
  • 5,000+ lines of Python (AI model training + cloud integration)
  • 15 FreeRTOS tasks (prioritized: camera capture = highest, network = lowest)

AI Model Development & Training

We trained a custom defect detection model for the client's specific product line.

Model Pipeline

Model Pipeline

Defect Classes Detected

Class Description Training Samples
label_misaligned Label rotated or shifted >2mm from position 4,200
surface_scratch Any scratch >1mm visible under strobe light 3,080
missing_component Required part absent from assembly 3,500
contamination Dust, debris, or foreign material 3,500

Model Results:

  • 0.5 mAP (mean Average Precision): 97.2
  • Inference time on Coral TPU: 28 ms (5 MP image)
  • False Positive Rate: 0.8% (after twice retraining to lower from 3.2%)
  • False Negative Rate: 0.3% (missed defects)

Training Setup:

  • Google Colab Pro + Tesla T4 GPU
  • 5000 Training epochs (3,200 early stop)
  • Augmentations: rotate +/- 5°, brightness +/- 20%, and add noise.

Cloud Platform & Backend

We built a complete cloud infrastructure for fleet management, data analytics, and remote monitoring.

Cloud Architecture (AWS)

Cloud Architecture (AWS)

Cloud Features Built

Feature Implementation
Device provisioning Zero-touch onboarding (certificate-based, QR code scan)
Real-time telemetry MQTT keep-alive, last will (offline detection), 5-second latency
Defect image storage S3 with lifecycle (30 days hot, 90 days cold, delete after 1 year)
Alert system SNS → SMS/Email (production manager, maintenance team)
Analytics dashboard Defect rate trends, top defect types, machine OEE (Overall Equipment Effectiveness)
Fleet OTA updates Gradual rollout (10% → 50% → 100%) with automatic rollback
Audit logging All configuration changes logged to DynamoDB
Secure access IAM roles, API keys, JWT authentication

Cloud Usage Metrics (3 plants, 25 cameras, 6 months):

  • 4.5 million images processed
  • 2.3 TB storage consumed
  • 99.95% uptime (AWS multi-AZ deployment)
  • Average API response: 120ms

Factory Integration & PLC Communication

The smart camera needed to talk to existing factory equipment.

Integration Architecture

PLC Protocol Implemented:
PLC Protocol Implemented:
  • Port 502 Modbus TCP
  • Trigger input: camera listens for specific holding register (write a ‘1’ to capture)
  • Result output: camera writes defect code to holding register (pass = 0; label = 1; scratch = 2; etc.)
  • Handshake: Camera already written 255 to clear register once rejection mechanism is confirmed as complete

Latency measured:

  • PLC Trigger to camera capture = 15ms (Ethernet Switching Time)
  • AI inference to reject signal = 30ms
  • Reject mechanism activation = 50ms
  • Total line interruption per defect = <100ms (well below line speed tolerance)

Prototyping & Testing

Prototyping Phases

Phase Activity Duration Outcome
Phase 1 Breadboard proof-of-concept (i.MX RT eval board + USB camera) 3 weeks Verified 120 units/min feasibility
Phase 2 Custom PCB prototype (2 units, hand-assembled) 6 weeks Board bring-up successful, MIPI working
Phase 3 Pre-production run (25 units, assembly house) 8 weeks All units passed factory acceptance test
Phase 4 Pilot deployment (2 cameras, 1 production line) 4 weeks 99.7% accuracy in real conditions
Phase 5 Full deployment (25 cameras, 3 plants) 6 weeks Live production, 24/7 operation

Testing Results

Test Category Metric Result
Accuracy Defect detection rate 99.7% (vs human 85%)
Latency Trigger to output 48ms average (well under 500ms requirement)
Throughput Units processed per minute 122 (exceeds 120 target)
Uptime Operational availability 99.5% (planned maintenance excluded)
Temperature Internal PCB temp at 40°C ambient 62°C (within spec)
Vibration IEC 60068-2-6 (10-500Hz) Passed no solder joint failures
EMC/EMI EN 61000-6-2 (industrial immunity) Passed all criteria
Power consumption 24V @ 350mA average, 850mA peak (LED strobe) 8.4W avg, 20W peak

Deliverables (Everything We Provided)

Category Deliverable Format
Hardware Custom PCB design files Altium schematics, Gerber, BOM, pick-and-place
Hardware 10 prototype units + 25 production units Assembled, tested PCBs
Hardware Enclosure mechanical design STEP files, 2D drawings
Firmware Production firmware binary .bin + OTA update package
Firmware Source code (escrow) C/C++ (FreeRTOS, drivers, application)
AI Model Trained YOLOv8 model + Edge TPU version .pt, .tflite, .tflite compiled for TPU
AI Model Training pipeline scripts Python scripts + Jupyter notebooks
Cloud AWS CloudFormation templates Infrastructure as code (repeatable)
Cloud Backend API + Lambda functions Python (serverless)
Cloud Web dashboard (React.js) Deployed on AWS S3 + CloudFront
Integration PLC communication library Modbus TCP example code
Documentation Hardware design guide 45-page PDF (schematics, layout, test points)
Documentation Firmware API reference 60-page PDF
Documentation Integration guide (PLC, network) 25-page PDF
Documentation User manual (operators) 20-page PDF
Documentation Maintenance guide 15-page PDF
Testing Validation report 80-page PDF (all test results)
Training Operator training session 4-hour on-site + video recording
Training Technician training session 8-hour on-site + hands-on

Results & Business Impact

Quantitative Results (After 6 Months of Production)

Metric Before After Improvement
Defect detection rate 85% (human) 99.7% +14.7%
False rejects (good units rejected) 3% 0.5% -83%
Annual customer returns 1,200 units 140 units -88%
Inspection labor cost $180,000/year $30,000/year -83%
Line downtime (inspection-related) 15 hours/month 2 hours/month -87%
ROI epriod 9 months

Qualitative Outcomes

Customer Trust

A significant retailer decreased audit intervals when the defect percentage decreased.

Data driven decision making

Daily defect reports established root causes (specific shifts, machine settings).

Scalability

The same camera platform has been implemented for two additional product lines.

Predictive Maintenance

Defect trend analysis allows for forecasting when a packaging machine will require calibration.

Lessons Learned & Future Roadmap

What Worked Out

  • Co-design of Hardware and Software Reduced Integration Time by 2 Months
  • Coral TPU Was an Appropriate Selection, Inference Speed Exceeded Our Need
  • Image Captured using Double-Buffering Stayed at 120 Units/Minute Without Frame Drops
  • Modbus TCP Was Less Complicated Than Originally Anticipated and Did Not Require an Additional Custom PLC Driver

Challenges Overcome

Challenge Solution
MIPI signal integrity on first PCB revision Re-routed with matched lengths, added ground shielding, second spin passed
Coral TPU thermal throttling at 50°C ambient Added thermal pad to enclosure + forced air (small fan)
False positives on shiny surfaces Added polarized lens + adjusted lighting angle
OTA update corruption risk Dual-bank flash + signature verification + rollback timer

Conclusion

Adequate Infosoft has provided a full end-to-end, custom smart camera solution that replaced the client's quality control process.

We created all of the hardware, developed the firmware, trained the AI model, developed the cloud platform, integrated the solution with factory PLCs, and provided deployment support on production lines.

Some of the most significant accomplishments of this engagement include:

  • Defective product detection at 99.7% accuracy
  • More than 120 units per minute of throughput
  • 9-month payback on investment
  • Deployment at 3 manufacturing facilities
  • No hardware failures for 6 months
  • Expansion into two additional product lines from customer

Ready to build your custom smart camera?

Get Free Technical Consultation On Your Custom Smart Camera Contact Adequate Infosoft Now We provide all kinds of Smart Camera solutions including AI Cameras, Firmware Development, PCB Design, Embedded Systems, Prototype Development and Final Production Development for your custom Smart Camera.

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.