Looking for a high definition DIY spectrometer

  • Optical
  • Thread starter fluidistic
  • Start date
  • #1
fluidistic
Gold Member
3,888
226
Hello people,
I am looking for a high definition DIY spectrometer website or resource. If you find a good one please let me know.
I've watched several youtube videos about it, used both googles and duckduckgo but I am left unsatisfied.
There are several things I do not understand, both about the physics itself and about the setups I've seen.

In one tutorial, I have seen they made a dark tube where on one end there was a little slit made with 2 razor blades, and in the opposite end there was a hole covered by a CD surface. IMO both ends comply the same role, i.e. diffract light, so I do not understand the need of both of them.

Another thing I don't understand is about the photosensor. Does it need to be moved (or the prism rotated if a prism is used to diffract the light of interest) so that all parts of the incoming light's spectrum interacts with it? Or would the use of a lens to focus the whole spectrum onto the photosensor do the same job?

I have seen many DIY project with either a webcam or a regular camera photosensor. But as far as I know, these sensors are biased in the sense that they try to mimic the human eye, so that they are about 3 times better at catching green light than red. Is the software used to display the result as a spectrum aware of this bias? If each photosensor is biased differently, how does the software knows how to unbias the raw data?

How does a software translate a picture, or image, into a spectrum that shows the intensity/count of each part of the EM spectrum?
 

Answers and Replies

  • #2
Baluncore
Science Advisor
12,085
6,203
In one tutorial, I have seen they made a dark tube where on one end there was a little slit made with 2 razor blades, and in the opposite end there was a hole covered by a CD surface. IMO both ends comply the same role, i.e. diffract light, so I do not understand the need of both of them.
The CD is a grating that is doing the job of a prism. It separates light by wavelength.
The two blade slit is narrowing the beam of light so as to increase resolution of the wavelength by reducing the size of the source.

How does a software translate a picture, or image, into a spectrum that shows the intensity/count of each part of the EM spectrum?
Without a prism of grating it can only weigh the energy in the three sensitivity bands. It measures Red, Green and Blue bands, to give a very crude estimate of wavelength distribution. The sensitivity of the camera across different bands can be corrected to some extent.

A high resolution spectrometer will need a narrow slit, a diffraction grating and a sensor. You could use a colour or B&W camera as the sensor, then extract the RGB as the brightness, with the pixel position in the image as the wavelength. You will get some IR sensitivity from a CMOS camera.
 
  • #3
fluidistic
Gold Member
3,888
226
The CD is a grating that is doing the job of a prism. It separates light by wavelength.
The two blade slit is narrowing the beam of light so as to increase resolution of the wavelength by reducing the size of the source.


Without a prism of grating it can only weigh the energy in the three sensitivity bands. It measures Red, Green and Blue bands, to give a very crude estimate of wavelength distribution. The sensitivity of the camera across different bands can be corrected to some extent.

A high resolution spectrometer will need a narrow slit, a diffraction grating and a sensor. You could use a colour or B&W camera as the sensor, then extract the RGB as the brightness, with the pixel position in the image as the wavelength. You will get some IR sensitivity from a CMOS camera.
Thank you for the information.
I suppose that the slit cannot be done too thin then, not only because too low intensity will result in more noise in the end, but also because of diffraction which may have a huge impact on what the sensor detects. Is this correct?

A prism would not be appropriate because the diffracted light severely depends on the wavelength and so the UV part is much more spread spatially than infrared. It is not linear like a grating pattern or CD would produce. So, unless the software takes into account that the light comes from a prism, I would have to adjust it myself into the software, I suppose.

I do not really understand the last comment of your last paragraph.
I think for now I'll be using a webcam or 14 M pixels camera or my 64 M pixels cell phone camera.

Do you have any open source software recommendation? Let's say that I build everything and I either film or take a picture. Which software do I use to get the spectrum out of it?
 
  • #4
Baluncore
Science Advisor
12,085
6,203
I do not really understand the last comment of your last paragraph.
CMOS B&W cameras can see into the IR. I do not know when the UV sensitivity falls. You must study the sensitivity spectrum of the camera and the lens used.
The CD grating will also have a transmission spectrum. You must identify the material used if the light passes through the plastic.
Do you have any open source software recommendation?
I know what I would use, but it is not what you should use. What computer languages are you familiar with? Can you find a driver to load an image into a buffer from a webcam that you can then process?
You will need to fix the camera in position, so it is probably better not to use your phone when webcams are so cheap. You need to practice writing code to read and process images, then study the RGB sensitivity to different wavelengths.
 
  • #5
fluidistic
Gold Member
3,888
226
CMOS B&W cameras can see into the IR. I do not know when the UV sensitivity falls. You must study the sensitivity spectrum of the camera and the lens used.
The CD grating will also have a transmission spectrum. You must identify the material used if the light passes through the plastic.
Ok I see, is that because all materials will absorb/emit some light, even the CD grating so that if I want to be accurate in the measurements I need to know where in the spectrum it modifies the orignal signal? Can't I just use the sun as source and see if the CD plastic makes a difference from what the spectrum should look like? I already know about the absorbption peaks by the atmosphere, etc.

I know what I would use, but it is not what you should use. What computer languages are you familiar with? Can you find a driver to load an image into a buffer from a webcam that you can then process?
You will need to fix the camera in position, so it is probably better not to use your phone when webcams are so cheap. You need to practice writing code to read and process images, then study the RGB sensitivity to different wavelengths.
I am familiar with Python but no hardware coding, i.e. driver related things. I was hoping that some people had already went through the hassle to do this, open sourced their code and let us do a calibration of the spectrum we get, using several light sources. I have the Sun and a red laser.
But yeah I see no way that they could know which sensor I use, so I'd need to do a study of the sensitivity of the sensor across the EM spectrum... but that's if I wanted to build a professisonal research related spectrometer, which is not what I want. I just want a simple cheap DIY device that I could potentially improve a little upon. I don't care about IR and UV. If the device is able to tell me the yellow color I see comes from a mix of green and red then I'm happy. But I do want to have some kind of precision (because in particular I want to test a light source that appears blue under certain circumstances but violet under others and I know my brain is making tricks otherwise Maxwell equations wouldn't be satisifed), so using the naked eye + CD is not an option, I need more than just that.
 
  • #6
Baluncore
Science Advisor
12,085
6,203
I am familiar with Python but no hardware coding, i.e. driver related things.
google; 'python opencv save image from webcam'

Can't I just use the sun as source and see if the CD plastic makes a difference from what the spectrum should look like?
Exactly, but you have to get a webcam running with python to do that.
 
  • #8
fluidistic
Gold Member
3,888
226
Quick update. I have finished this DIY project. I used a "Springles" tube and taped a webcam on an end of the tube. Then I used the publiclab website to monitor and get the spectrum I sought.
However having the webcam directly in front of the aperture isn't good in that the publiclab software output is impacted by that direct non diffracted light. Anyway I could get a few spectrums, it was nice, that's about it.
 
  • Like
Likes Tom.G and anorlunda

Suggested for: Looking for a high definition DIY spectrometer

  • Last Post
Replies
3
Views
565
  • Last Post
Replies
12
Views
267
  • Last Post
Replies
2
Views
604
  • Last Post
Replies
10
Views
874
  • Last Post
Replies
7
Views
788
Replies
40
Views
271
Replies
22
Views
1K
Replies
3
Views
756
  • Last Post
Replies
1
Views
611
  • Last Post
Replies
6
Views
820
Top