Public Lab Research note

Hypersperctral imaging using DIY kits

by amirberAgain |

Read more:

A couple of years ago a friend showed me how a hyper spectral camera works. I cam to the realization such an instroment can be built very easily. I have noticed that when using the Public lab's mobile spectrometer it is possible to see variations in lighting when rotating the spectromter jig. I wish to share this project with others.

So far I have been able to mainly use this camera to produce images for fun and interest, I hope to be ale to use it in the future to detect objects based on thire spectral signiture. I attach a link to the SW exe and source file. for the exe file first download LabVIEW runtime engine 2011. Several example files are attached.

SW and example image files can be found at: either download the "Build HSI.7z" or the folder under the same name.

Runtime engine can be dowloaded at:

Example video showing how to use the SW can be found at:

Further explenation on Hyper Spectral Imaging (HSI) and perliminary explenation on using the SW is found under the DIY HSI ppt file.


spectrometer hyperspectral


Thank you for posting this, Amir!

When I saw your note I immediately thought "I have to look up that guy who posted to the spectrometry list in 2014" and it was you!!

Yes, it sure been a while, thank you for noticing. It took me some time to get it done, but then another 18 months or so to finally decide I'm putting it out there. hope someone can find a use for it!


Hi Amir,

I gone through your ppt about hyperspectral imaging and it is really very simple and easy to understand. I am into recycling of plastic, i think we can use your concept of hyperspectral imaging for identification and sorting of various plastic at low cost. can you help me developing this product. you can mail me on

thank you

I am planning on buying a kit to see if it will help me with my bees during the winter. Bees cluster for warmth and the ability to see the heat signature from outside the hive will provide many benefits. I hope to check and track cluster size and movement without opening the hive. I also have a garden, so learning how to check plant health is interesting as well.

Hi shaikhgous, thank you for expressing interest! I would be happy to help as best I can, please feel free to ask here Abby thing I can help with. I'd be happy to hear more about your initiative.

Hi roborob, for thermal signature you would benefit from using a thermal camera in the FLIR region of the spectrum. Look for the Lepton camera for ~300$ US.

Hi and thanks for the reply. $300 is way out of my budget. I only need to "see" into a pine box with walls only about 1/2 inch thick. The bee cluster is less than a foot from the walls on the inside. I also would like to incorporate a Raspberry PI (or clone) for data capture and storage. Would you happen to have any suggestions for a DIY solution? Anything would be helpful at this point.
Best regards, rob

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

The option I suggested is based around a rpi, but it's expensive. Alternatives you should probably check are either placing a temperature sensor in the hive or using a FLIR like photodiode. In any case, the set up described in this post would not suite your needs.

Hi amir,

I have modified the webcam by removing the ir filter from it, I have IR Pass filter which i can use with it. Can you give me step by step procedure how to capture the photos of different objects on one background using the spectrometer. I have seen the DIY spectrometry kit and I can make the spectrometer

I have another question. Would this kit be good for testing and measuring LED lights (wavelength, lumens, etc)? The first objective would be to validate claims made by companies that sell grow lights. The second would be to measure LED lights where specificatipns are not given. I want to build LED grow lights in a custom configuration. However I want to buy some sample LEDs and test them before committing to a larger purchase.

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

is it possible to make a lightweight Hyperspectral camera that can be flown using a drone if we aim for s specific bandwidth?

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

@Indianajuns It is my impression this setup is light enough to be placed on a drone, but would require work adapting it mechanically. @roborob It is my impression that the Public Lab's regular spectrometer would be better suited for this.

Hi @amirberAgain would you be interested in putting together the necessary hardware to improve this design?

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

Hello @maykef do you have an example you are thinking of?

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

A field scanner for agriculture applications mounted in a sprayer or drone

Not sure I got you, The required HW is basically the PLab spectrometer where I have used a rainbow symphony grating instead of a CD grating for better optical quality. not much more to it in terms of HW.

@amirberAgain Your HW setup is pretty much interesting, I wonder if it can be upgrade to something more durable/precise, e.g. replacing the grating with a prism and using a more sophisticated monochrome camera.

Forsure, thou, I wouldn't change the grating to a prism. option 1 Holographic diffraction grating from Edmond optics pack of 15 <20$US Option 2 Other options here:

As for cameras, the options are endless and there is definitely what to gain from using a good monochrome camera.

@amirberAgain This is a great post! I am new to hyperspectral imaging, but I am investigating using the technique to separate samples generated in our lab. One question: Do the measurements of the pipe matter or could it be just any pipe. Thanks!


Hi @kimoyerr, As long as you get the first order diffraction to the camera the pipe's shape is of lesser importance(that's what I think). My first prototype was the paper/cardboard spectrometer with a different grating. Since the BOM cost is so low I'd recommend you try to make it work, feel free to post here if you want specific advice or even better - share your success!

Thanks @amirberAgain! I will try out different things. Excited to get my hands dirty!

Hi @amirberAgain, thank you so much for sharing this. I've been searching on the web how I can make my own hyperspectral imaging camera and I'm so excited to find your post. I'm making orders for the parts following your instruction in the DIY HSI.pptx file (page 8) and wanted get your confirmation that I'm ordering the right stuff. I'm planning to order these: - Desktop Spectrometry Kit 3.0 - Spectrometry Slit Upgrade Pack - I already have a webcam so I don't need to order a new one - I'm not sure which grating I should order. You mentioned that you ordered one from rainbow symphony. I went to the online store and there are many types of gratings. Do you have any recommendations which one I should get? - If there are anything that I'm missing from my cart or if you have any advice in terms of building, please let me know.

Thank you so much!

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

I'm also wondering if it's possible to make an image that are only shown at a specific wavelength. The image might not be visible with human eyes, but it's shown through a HSI camera. Do you have any idea if this is possible and what I could do to make an image? Thank you!

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

Hi @planet, it's always fun to hear this kind of feedback. Please note that I only used the desktop spectrometer as a "reference design", you can use it as is while filming many frames, or a video you will later need to split to images. If you find that you want to have a wider FOV then rebuilds the enclosure such that you could image the full width of the slit. If you want images with better optical quality and without the curviness which is caused by the DVD material look for a grating with the same number of grooves, if you get a slightly higher or lower lines/mm you may need to adjust the angle between the slit and the camera. It is most definitely possible to show images from outside the visible range, I didn't put is an option in my SW, but you could either change it to suite you, or use the generated RGB image and post process the unwanted color channels out.

Please write back if you have questions, or if you were able to do anything cool with it.

Also consider some of the work people have been doing with Raspberry Pi cameras to upgrade various spectrometry kits!

You must be logged in to comment.