CROPOpen Robotics Chair for Crop Protection FR

DIY tutorial · multispectral imaging

Build a bio-inspired multispectral imager

From Raspberry Pi to UV-G-B pollinator vision: a practical guide to build an accessible optical platform, then adapt it into a field sensor inspired by bee vision.

Infographic showing human vision, bee UV vision and a UV sensor for strawberry monitoring.
Adapting an optical chain to reveal signals invisible to the human eye.
LevelIntermediate to advanced
Active time2 to 6 hours
ApproachPublished DIY + UV variant
ApplicationPlants, materials, robotics

Why see beyond visible light?

Humans mostly see the world in red, green and blue. Many animals, plants and insects interact with light signals that we do not perceive directly, especially in ultraviolet or near-infrared bands.

A multispectral imager observes the same scene at several wavelengths instead of using a single RGB image. This can reveal differences in surface, composition, maturity, stress or reflectance that are invisible to the naked eye.

For flowers, ultraviolet is especially interesting: pollinators such as bees use UV-G-B signals that humans cannot directly see. Building such a sensor turns a biological insight into an experimental tool for agriculture, robotics and environmental observation.

Scientific basis: a published DIY platform, then a bio-inspired adaptation

This tutorial builds on two complementary sources.

Reproducible DIY base

Raspberry Pi multispectral imager

Lopez-Ruiz and colleagues propose a compact, low-cost system using a Raspberry Pi, a Raspberry Pi NoIR camera, a touchscreen, an LED panel and OpenCV processing. Their prototype illuminates the sample with eight wavelengths, approximately 385, 455, 525, 590, 655, 700, 850 and 950 nm, to produce reflectance signatures and usable histograms.[1]

Field UV-G-B adaptation

Pollinator-inspired sensor

Heath, Imran and St-Onge developed a Nature-Inspired Detector, or NID, to detect strawberry flowers using a compact camera sensitive to near UV. The sensor targets a range close to bee vision, approximately 300 to 650 nm, and is integrated on a drone with deep-learning detection.[2]

Tutorial angle: the Raspberry Pi version teaches the basics; the UV-G-B version shows how to specialize the system to reveal invisible floral signals.

What you will build

You will build, or at least prototype, a portable multispectral imager inspired by a published Raspberry Pi approach. This first version lets you control light, capture several spectral images and extract simple signatures.

You will then see how to turn the same logic into a pollinator-inspired UV-G-B field sensor: a more specialized camera, sensitive to near UV, suitable for integration on a robot or drone and compatible with object-detection algorithms.

Recommended materials

Educational and accessible Raspberry Pi version

ItemRole
Raspberry PiControls acquisition, processing and image storage.
Raspberry Pi NoIR cameraCaptures images without an IR-cut filter, sensitive to visible and near-infrared light.
LED panelSequential illumination at multiple wavelengths.
Translucent diffuserReduces LED directionality and improves lighting uniformity.
Dark enclosureControls lighting conditions and limits stray reflections.
Python / OpenCVCaptures images, computes intensity and histograms, and exports data.

Advanced UV-G-B field version

ItemRole
Modified monochrome CMOS cameraBase sensor sensitive to near UV, blue and green.
Bayer filter removalAvoids standard RGB filtering and improves monochrome signal relevance.
Microlens removalReduces UV absorption or distortion.
Schott WG280 glassReplaces internal UV-blocking filters and protects the sensor.
X-NiteBP1 external filterKeeps the useful UV-G-B range while blocking red and infrared light.
3D-printed mountSupports integration on a drone, mobile robot or test bench.

Caution: removing the Bayer matrix, microlenses or internal filters is delicate. For a scientific camera or reliable prototype, use a specialized supplier rather than modifying the sensor yourself.

Two possible recipes

Recipe A

Laboratory DIY multispectral imager

Goal: build a tabletop imager to explore materials, fruit, leaves or surfaces.

  • Easy-to-source components.
  • Excellent educational starting point.
  • Compatible with the practical Instructables spirit.
  • Works best under controlled lighting.
Recipe B

UV-G-B sensor for field or drone use

Goal: capture UV-G-B floral signals outdoors and feed an AI detection system.

  • Closer to pollinator vision.
  • Suitable for mobile platform integration.
  • Requires specialized optical components.
  • Requires more rigorous calibration.

Tutorial steps

Understand the spectral target

Define what you want to reveal: UV, visible, near IR or a biologically inspired combination. For pollinators, the key range is near UV, blue and green.

Start with the Raspberry Pi version

Build a tabletop platform with a Raspberry Pi, NoIR camera and LED panel. Capture one image per wavelength, then compare intensities and histograms.

Build the LED panel

Place several LEDs around the camera. In the published approach, four LEDs per wavelength are arranged symmetrically to reduce shadows.

Add a diffuser and dark enclosure

The diffuser improves lighting uniformity. The dark enclosure makes measurements more reproducible by reducing ambient-light influence.

Capture and process images

Automate acquisition: turn on one LED band, capture an image, save it, then move to the next wavelength. Then compute the mean intensity or histogram for each image.

Test with simple samples

Compare leaves, flowers, fruit, plastics or reference surfaces. Look for wavelengths where differences become more visible.

Move to the UV-G-B variant

For a pollinator-inspired version, replace the standard camera with a modified camera that passes near UV and blocks unwanted bands.

Install specialized optical filters

Use UV-compatible internal glass such as Schott WG280 and an external filter that limits red and infrared light, such as the X-NiteBP1 used in the NID prototype.

Mount the sensor on a platform

Design a 3D-printed support that holds the camera at 90 degrees to the scene. On a drone, verify vibration, mechanical clearance and cable routing.

Add AI detection

Capture an image dataset, annotate objects of interest, then train a lightweight model such as YOLOv5. Add negative examples to reduce false positives.

Expected results

With the Raspberry Pi version, you should obtain a simple signature for each sample: intensity or histogram at each wavelength. This is often enough to observe differences between surfaces or materials.

With the UV-G-B version, flowers or some plant tissues may stand out more strongly than in a conventional RGB image. In the NID system, this strategy enabled strawberry-flower detection in aerial images and orthomosaics, while also revealing limits such as false positives caused by fruit or reflections.

Good success criterion: the sensor should not only produce an attractive image. It should reveal useful contrast for a task: classifying a material, detecting a flower, spotting an anomaly or supporting a robotic decision.

Quick troubleshooting

ProblemLikely causeSolution
Images vary stronglyUncontrolled ambient lightUse a dark enclosure or stabilize illumination.
Shadows are too strongLEDs are too directionalAdd a diffuser and make the LED layout symmetric.
Weak UV contrastCamera or lens blocks UVCheck the internal filter, lens and actual transmission.
False positives in detectionFruit, reflections or bright backgroundsAdd negative examples to the dataset.
Blurred drone imagesVibration or exposure time too longStiffen the mount, reduce exposure and improve damping.

Possible improvements

  • Add radiometric calibration with reflectance standards.
  • Synchronize images with GPS, odometry or ROS timestamps.
  • Explore a three-channel camera where the red channel is replaced by UV sensitivity.
  • Move from tabletop acquisition to an embedded mobile-robot acquisition setup.
  • Use newer or lighter detection models for real-time processing.
  • Add “fruit”, “leaf”, “reflection” and “background” classes to better understand false positives.

Scientific references

  1. Lopez-Ruiz, N., Granados-Ortega, F., Carvajal, M. A., & Martinez-Olmos, A. (2017). Portable multispectral imaging system based on Raspberry Pi. Sensor Review, 37(3), 322-329. DOI: 10.1108/SR-12-2016-0276.
  2. Heath, M., Imran, A., & St-Onge, D. (2024). See as a Bee: UV Sensor for Aerial Strawberry Crop Monitoring. Canadian Journal of Remote Sensing, 50(1), 2332179. DOI: 10.1080/07038992.2024.2332179.