Public Lab Research note

This is part of a series on community-microscope-tests.

Raspberry PI NoIR close-up Imaging

by MaggPi | May 11, 2018 04:14 11 May 04:14 | #16326 | #16326

MaggPi was awarded the Basic Barnstar by stevie for their work in this research note.

Objectives include:

-Adjust focus for a NoIR camera lens by using a specially designed tool. -Test the impact of visible/near infrared lighting conditions on NoIR images -Explore the capability of the NoIR camera w/standard lens to maintain focus across a wide 400 to 900nm spectral bandwidth.

Since the Raspberry Pi NoIR v2camera lens is preset to focus at infinity, this typically restricts quality imaging to ranges > 1 meter. Options for adjusting the focus consist of adding external lenses or refocusing the supplied lens. Each approach has its own benefits and disadvantages – external lenses require a separate mount and additional lens purchase, adjusting the supplied lens risks potentially damaging the camera. A good summary of camera and lens performance is available at: and [ and]

The tool method was selected for a series of imaging observations since it permits diverse camera modes ranging from lens-less to multi-lens camera configurations. Three tool designs are depicted below and general instructions are available at: .


Note the initial material selected for the lens adjustment tool did not match the design goals. Picture below shows the importance of selecting the right material for 3d fabrication. Thanks to Treatstock ( who provided an upgraded material reprint at no additional cost.


Camera set-up is shown below. In order to observe visible/infrared (IR) imaging performance of the NoIR camera, florescent white light and infrared (IR) lighting (two 850nm Light Emitting Diodes (LEDs)) were used for illumination. 50cm, 25cm and 3cm camera to object distances were selected to provide different fields of view and magnification. A python picamera program was used to help perform video focus adjustments before recording high resolution images. Images are recorded and shown with the same digital format. Code is available at:


Objects were selected to demonstrate different aspects of imaging across the 400 to 900 nm spectral response of the NOIR camera. Objects include: -5 dollar bill -Raspberry Pi camera box -Public lab stickers -Red Filter - From Infragram Plant Analysis Filter Kit ( -Green Filter – Roscolux Moss Green Filter (520nm center peak) ( -Blue Filter – Supplied with NoIR Camera (

Picture below was taken at 50 cm camera to object distance and show how refocusing the preset NoIR lens permits imaging at < 1m.


Picture below was taken at 25 cm camera to object distance with white and/ or infrared light. The images show how the camera’s overlapping spectral bands provide realistic color (white light), unique infrared features (IR light) and green/yellow color subtraction (IR and white light)


Picture below was taken at 3 cm camera to object distance with white or Infrared (IR) light. The images show that it is difficult to simultaneously focus both the visible and IR images at very close distances with the standard NoIR lens.


I did this Help out by offering feedback! Browse other activities for "microscope"

People who did this (0)

None yet. Be the first to post one!


This is a great post!!!! 🎉

Am I understanding that at 850nm five dollar bills have blank regions?

Great notes on the lens tool!

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Would you like to make this part of a series for your SoC work? You could add a tag to any related work like series:_________ with some unique tagname of your choice, maybe series:raspberry-pi-imaging or series:raspberry-pi-imaging-soc and then there'll be an overall listing of these collected. Try it!

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

@amirberagain @icarito pretty neat!

Reply to this comment...

@stevie awards a barnstar to MaggPi for their awesome contribution!

Reply to this comment...

-warren, yes most bills have ir markings. Believe the bills make a good subject since they have well known spectral features and good detail - -really just getting started, the good news is that i finally got opencv working on raspberry 3b+. I was able to split the images above into RGB channels 5_dollar_bill_picture.jpg


Reply to this comment...

Hi, could you upload the original versions of the color channels you've extracted? So people can see the original data? Thanks!

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

@ warren, Original files attached:





Reply to this comment...

I also think the white +IR light is an interesting study.


Reply to this comment...

Login to comment.