The Naked Scientists

The Naked Scientists Forum

Author Topic: Can a digital camera be used as a spectrometer?  (Read 39725 times)

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #25 on: 10/05/2009 11:45:19 »
Please show me the "optics" of which you speak in the setup decribed here (which I cited earlier).
http://www.exo.net/~pauld/activities/CDspectrometer/cdspectrometer.html
I maintain that I could put a digital camera where the eye is on that setup and get a picture of the lines. I could transfer the picture to a PC and measure the position of the lines (with a ruler or software).
If I started with a fluorescent light I would be able to see the mercury lines and I could use them as calibration points. I could set up a table of wavelength vs position on the pc screen.
I could then change the light source to a neon light or some such and I could measure the wavelength of the neon emision lines.
I doubt that I would get better than 2 significant figures but I could do the job.
I don't actually plan to do this because Waquinn has already done it- probably better than I could.
I'd also like to reitterate his point that a CD with a pitch of 0.74 microns is a rather better grating than the 9 one with a pitch of about 3.3 microns.
 

lyner

  • Guest
Can a digital camera be used as a spectrometer?
« Reply #26 on: 10/05/2009 13:05:43 »
Is there anything about the period of a grating that makes it "better"? The quality of a grating is in it's uniformity, surely.
The grating I quoted was the her first I saw in a quick search and it is true that the dispersion would be greater with a finer one.
You can buy what is called a spectroscope which is much the same as the CD version but it uses transmission rather than reflection. It is sold as a scope because that is what it is.
The optics I refer to could be some simple collimator to reduce flare. A lens would ensure more light getting through. Sunlight and fluo tubes are very bright. To analyse the spectrum of a dim source - such as a home made discharge tube, you need more help - including sharper lines from a regular grating.
 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #27 on: 10/05/2009 15:43:30 »

Is there anything about the period of a grating that makes it "better"?

Yes, for a given size of grating a finer pitch means a greater number of lines and, therefore a better theoretical resolution. I realise that for the sort of setup that this thread is on  about the theoretical resolution isn't going to matter. On a more practical note the finer grating will spread the spectrum out further so you have a greater angular separation between any two given wavelengths i.e greater dispersion.
I know what a spectroscope is. As it hapens I have got one (actually, it's a prism rather than grating type). I also know what a spectrometer is and, in my previous post, I gave a brief description of how to use a camera and PC to turn a specroscope into a spectrometer.
The last home made discharge tube I made was a nitrogen laser. I can't say I checked but I really feel that it would have been bright enough to get some sort of measurement of the wavelength, though the fact that it's a UV source would have made that tricky.
 

Offline wolfekeeper

  • Neilep Level Member
  • ******
  • Posts: 1092
  • Thanked: 11 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #28 on: 10/05/2009 15:56:05 »
(I know that, in practice, a better spectrometer would be easier than a strong enough magnet)
How many Tesla do you need for Zeeman splitting?

Supermagnets can give 0.4 Tesla without any sweat at all, and several times that with a Halbach array (not too difficult to build actually if you know a trick).

The world record is over 5 Tesla, but that's complicated.
« Last Edit: 10/05/2009 15:57:42 by wolfekeeper »
 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #29 on: 10/05/2009 19:59:39 »
AA spectrophotometers using the Zeeeman effect typically epmloy fields of about 0.5 to 1 Tesla. On the other hand they have resolutions of about 0.1nm or bettter. Since my guess is that the best we can do resolution wise is about 2nm the field would have to be 20 times stronger.
As I said, the magnet would be more difficult than the spectroscope.
Incidentally I got bored and set up a spectroscope with a CD, some sticky tape and a cardboard tube. YOu can just about resolve the yellow mercury doublet.
« Last Edit: 10/05/2009 23:35:24 by Bored chemist »
 

lyner

  • Guest
Can a digital camera be used as a spectrometer?
« Reply #30 on: 11/05/2009 17:11:30 »
BC, the pitch of the grating merely affects the dispersion - not the resolution. Using a greater throw will give the same spread of any particular order of spectrum. One thing which will affect the resolution is the uniformity of the grating. If you do the sums - the diffraction pattern is given by the Fourier transform of the grating. If it a uniform grating, then the angular pattern for a single frequency (an impulse in f space, if you like) will be a single peak (angular width depending, inversely, upon width of grating). The limit for an infinite grating would be an impulse in 'angle space'. If the grating has a spread of spatial frequencies then so will the angular pattern have a corresponding spread (i.e., your CD).

A very pretty picture, btw, from your spectroscope. Optical spectra are a bit like stars and planets; they are pretty and you can look at them for hours.
 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #31 on: 11/05/2009 20:16:37 »
Thinking in F space tends to give me a headache which is a bit of an occupational hazzard since I'm a spectrosopist.
Still, I will give it a try.
What I said was "for a given size of grating a finer pitch means a greater number of lines and, therefore a better theoretical resolution."
The grating isn't just a regular array of opaque lines or whatever- it also is an aperture.
So you need to regard it as the product of the square wave that is the grating pitch and the top hat function that represents the aperture. That means that the output from illuminating it with a monochromatic source will be the convolution of the FTs of the two functions. The square wave gives the various diffraction orders. For monochromatic illumination these are a set of spikes but the finite aperture means that these are spread out into sin(x)/x function.
So if you have two wavelengths close together the sidebands of the sin x/x of one will overlap the centre sppike of the other.
That's the theoretical limit to the resolution of the grating.
If the hole is big then the side bands are narrow, so big gratings are better than small ones. For a given size of grating, a smaller pitch will spread the different wavelengths further so  you have less of a problem with overlap.

That's a large part of the reason why they use big gratings. The resolving power is proportional to the number of lines.
 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #32 on: 11/05/2009 21:28:25 »
"if you want to see spectral lines you need some optics to produce a good beam of light from a slit"
No, you plainly don't because that's what I posted earlier.
(EDIT
What happened to the post I quoted that from?)
The setup is pretty much the same as the one on the website I cited. I swilled some black paint round the inside of the tube first to reduce stray light.
The slit is just a couple of bits of opaque tape on a piece of clear plasic cut from the packing from something. The CD was the driver software from a printer that no longer worked.
It worked fine with a mercury lamp - no colimating lens. The only optical device needed was the lens in my eye or the camera.

You plainly can see the lines
If I could be bothered I could try to calibrate the distance vs wavelength and make it quantitative. You might want to see if you can get an estimate of the separation of the 2 yellow lines.
« Last Edit: 11/05/2009 21:59:17 by Bored chemist »
 

lyner

  • Guest
Can a digital camera be used as a spectrometer?
« Reply #33 on: 11/05/2009 22:07:04 »
I don't know what you are arguing about, really. You got a result, which was never in doubt. Very pretty.
But you can't argue with the diffraction sums which say that a regular grating beats an irregular one. You could resolve Zeeman splitting, for instance, using a lower magnetic field, if you used a better system.
You can measure lots of things with simple equipment - distances, for instance, with a steel ruler or a vernier caliper. A micrometer only costs a bit more but gives you another decimal place at least. You could use a plastic comb, if you wanted, but you'd need to calibrate it and couldn't rely on the linearity of the scale. That's what the CD corresponds to. For some reason, you insist that the CD's properties make it ideal. They don't.  The alternative doesn't cost much and would work much better, so why do you reject it? A CD 'happens to work', in spite of other factors. A purpose - made grating works better. Is that a surprise? And it doesn't cost as much as the Hubble Space Telescope
 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #34 on: 11/05/2009 22:49:19 »
What I argued about was a post that said "if you want to see spectral lines you need some optics to produce a good beam of light from a slit" which is plainly false and has disapeared.

What I said in the first place was that if you wanted a really cheap diffraction grating you could use a CD.
Have a look; what I said was "The really cheap option is to use a cd as a diffraction grating."
It is.
OK, you could spend more money if you wanted to, but that doesn't detract from the fact that you don't need to spend more money.
Clearly if you want to do more accurate experiments you need better kit and that's generally more expensive but the experimental evidence proves quite clearl that you can build a spectroscope with nothing more than some odds nd ends and a CD. You can point a camera into it and get an image which you could calibrate (there are other ways of doing this tooas Waqunn demonstrated) to make a spectrometer.

The original question asked if you could use a digital camera as a spectrometer.
The answer is yes provided that
1 you don't want a very good spectrometer and
2 you have some bits and pieces that most people have lying about the place.


I strongly suspect that if the OP had wanted a good spectrometer he would have bought one. You can get a reasonable one for a lot less than the cost of that camera (and I bet it came with a CD).
Saying that you can spend 9 on a diffracion grating is like pointing out that you can buy a spectrometer- true, but hardly in keeping with the original question.
 

lyner

  • Guest
Can a digital camera be used as a spectrometer?
« Reply #35 on: 12/05/2009 11:58:33 »
As long as you appreciate your spectroscope for what it is, then that is fine.

I was actually responding to Waquinn's post which includes:
"I have constructed a home made spectrometer using a CD/DVD as a reflection grating.
It is based on a rotating table which has a rectangular piece of CD/DVD attached..
The rotation of the table can be used to read the wavelength, but I use a 2MP webcam to take a video of the spectrum. "

Clearly, he had gone to some trouble and my suggestion for a proper grating was aimed at his design- which is for a spectroMETER. To make it useful, it would also need to work for weak light sources. Experiments which actually use a spectrometer may need to detect a small trace of a gas in the presence of a lot of others. This will require some extra light gathering power and more than a simple slit. If you want to use a digital camera, you don't want to be using high ISO settings or long exposures because this will introduce non-linearity and ruin your measurements.
Also, you  haven't answered my points about the fundamentals of diffraction patterns. They are relevant.

We've had this kind of conversation before. . .  :-\


 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #36 on: 12/05/2009 20:49:36 »
Re "Also, you  haven't answered my points about the fundamentals of diffraction patterns. They are relevant. "
What points?
I have answered the point that the total number of lines is important so a bigger grating or a finer grating is better (the CD wins in both cases).
I answered your sugestion that you should choose the data to give a good grating- the coding is such that the patern comes out nearly random in spite of your efforts.


Are you waiting for me to answer the assertion that a real diffraction grating should give better results. That could be a long wait; I never said it didn't. I said that a CD would give cheaper results that may (for, for example, an educational toy or just to admire the beauty of a set of spectral lines) be perfectly adequate.
 

lyner

  • Guest
Can a digital camera be used as a spectrometer?
« Reply #37 on: 12/05/2009 23:29:08 »
What possible advantage is there in a random grating pattern? Every irregularity will degrade the quality of the spectrum.
A coarser grating merely produces less dispersion. In no way is that 'worse' - any more than a lens with a long focal length is 'worse' than one with a short one. The quality (resolution) is affected by the regularity and total width of the grating.
But, as your final para implies, you are talking scopes not meters. Fair enough. I shan't sell my shares in ACME Optical Gratings yet!
 

lyner

  • Guest
Can a digital camera be used as a spectrometer?
« Reply #38 on: 13/05/2009 00:37:50 »
I didn't actually point out that a CD is curved!! Not a good feature fur a grating.
 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #39 on: 13/05/2009 08:04:33 »
I didn't point out that the lines in the spectrum I took are straight. The outer edge of te CD does most of the work in this configuration.

Do you understand that the theoretical resolution of a grating increases with the number of lines?

Measuring the pretty picture captured on a digital camera could be an educational toy and thus a meter as well as a scope. Of course, a good grating for a csope is also a good grating for a meter and vice versa. Thtere's no real point going on about the difference.

I will get back to the other point but I have a bus to catch, but the simple answer is called ghosting.
« Last Edit: 13/05/2009 08:07:07 by Bored chemist »
 

lyner

  • Guest
Can a digital camera be used as a spectrometer?
« Reply #40 on: 13/05/2009 12:28:58 »
I have to admit that my 'resolution' idea was based on spatial resolution (as with telescopes and holograms) and not wavelength resolution. I have looked it up - as I should have done at the start! Total number of lines is what counts. That was a bit of side issue, based on my random selection of a single, rather coarse, grating which is cheap. I have seen a 1000 lines per mm (2" square)  available  for 1.90 ! This would have more lines available than a CD and they would all be clean and parallel. Sounds quite good value to me.

But, the lines need to be 'good' lines. I found a picture of a CD surface which shows you what I mean - http://www.stereophile.com/images/archivesart/ACDfig1.jpg. There are random gaps between the pits so there are effectively, a whole set of gratings with multiple spacings (which may not actually matter but which could produce multiple spectra) and each pit has a profile, which blurs the effective width / spacing / period of the grating. The non-uniformities seem to occupy a large proportion of the disc surface. My Schoolboy microscope seems to show (just) a much more obvious surface pattern on manufactured CDs than on CDRs - I guess the CDR marks just aren't as definite.

The point of my remark about curvature is that the whole length of each groove contributes to the light arriving at any one part of a line - for a diffuse source.  You will end up with a change in period of the grating over its height.  This means that you need to have a short slot and /or some collimation to avoid more spreading of lines. I wouldn't expect curved lines on the display- it's a diffraction pattern.

Is the "answer" 'ghosting'? I have read about ghosting and it seems to refer to the effects of non uniform spacing of mechanically ruled gratings. But it may be a general term for spurious responses.

Hope you got a free ride on the bus. Passes are magic.



 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #41 on: 13/05/2009 20:25:50 »
The bus is provided by the people I work for.
The pic of the surface of the CD looks to me like a reasonably good grating - the lines seem straight and parallel. But someone has filled part of them in.

The only periodic feature is the set of "grooves".
The starts and ends of the pits will scatter light and so reduce the available light and also add to the stray lightt- not good,  but they don't stop you being ale to resolve the spectrum.
Ghosting refers to a "wrong period" error in the grooves.
Imagine that you were cutting a conventional grating but, due to some error, the odd numbered lines were cut slightly deeper than the even numbered ones. That would effectively give 2 gratings, one with twice the pitch of the other. In turn that would mean that a single wavelength would appear twice in the spectrum (Strictly, twice for each order) and that would make it difficult to work out what lines were which.
Imagine that your data were such that all odd numbered "grooves" were 1,1,1,1... and the even ones were 0,0,0,...
You would have a grating that had two different pitches- even worse if, for example, the grooves held data that looked like
0,0,0,0,0,1....
0,0,0,0,1,1....
0,0,0,1,1,1....
0,0,1,1,1,1....
0,1,1,1,1,1...
1,1,1,1,1,1...
repeatedly.
You would have a messy looking set of diffraction paterns.
Fortunately, because of the encoding, this can't happen with a real CD as I understand it.

The "random" data on a CD just spoils the s/n ratio. It doesn't affect the position of the lines so, while it doesn't work as a spectrophotometer, it can make a perfectly adequate spectrometer.

I still think 1.90 for a grating is infinitely worse value than 0 provided that the freebie will do the job and two of us have shown that it can.
 

lyner

  • Guest
Can a digital camera be used as a spectrometer?
« Reply #42 on: 13/05/2009 20:45:25 »
We are doing angels on a pinhead now.
The effect of  blurring out the spectrum is, as you say, a bit like a SNR problem. This fills in the gaps, spreads out narrow lines and obscures low level components. When you say "adequate" you mean it makes a mercury spectrum look like a mercury spectrum. Would it reveal a low level trace of a helium spectrum in there, though?
You and I have 'wasted' much much more than  1.90 worth of time (only a few minutes even at minimum wage rates) on this problem.  You could say that one wastes money on Cinema tickets and beer, also. The only way to prove this is to make a comparison. I could send you a grating so that you could replace your piece of CD.
That photo in RD's post shows a strong patterning effect which can only (?) be due to the effects I am suggesting. I bet a simple bit of holographic, regular, grating would not produce that. Your photo looks a bit underexposed - are the original pixel values anything like 255 (peak value)? It would be interesting to see whether there are any artifacts buried near the lines on your picture.

I was really just crowing about my bus pass.  It will give a young chap like you something to look forward to.
 

Offline Bored chemist

  • Neilep Level Member
  • ******
  • Posts: 8657
  • Thanked: 42 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #43 on: 14/05/2009 20:31:05 »
Thanks for the offer but I have a selection of gratings and prisms. I also have a proper spectrometer (I guess you know the sort of thing - slit, colimator, table, telescope and eyepiece with the table marked in degrees with a vernier too.) I have a monochromator lying about too. I collect scientific kit as a hobby, maybe I will play with some of it at the weekend.
I still got a picture of the mercury lines with a cd and a cardboard tube.

Clearly the definition of "adequate" depends on your circumstances and as I have said, in some circumstances a CD is perfectly adequate and free. In much the asme way that you can debate wherther the price of a beer is a waste of money you can debate whether or not I really need all that equipment- clearly I don't but it's my money and I can spend it how I like.
I can also spend my time as I please and that includes pointing out things like more grooves gives better resolution and that there are circumstances where a CD is a perfectly adequte grating.
Incidentally I tried a DVD but it wasn't a good- the diffraction angle is a bit big and you end up with too near grazing incidence.

The picture is underexposed- if I knew how to drive the camera properly...
 

Offline emissonspectroguy

  • First timers
  • *
  • Posts: 1
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #44 on: 11/12/2009 21:07:56 »
I just registered and wanted to post but figured I'd pick a thread that has been
slow for a while.   

My impression of CD or DVD is that there is a blank which has had tracks imposed on
in so that the laser can follow it. Much like the groove in a record the track is
simply the middle line of where the laser follows.

Then upon that track is pits put when the laser records.  Later the same laser,
at lower power, reads the pits. Yet the track is unaltered by the laser. It was
put there by the manufacturer when the CD/DVD was made.

It's this track that creates a grating.  I don't know how the track is imposed on the
plastic. It's put into the clear area of the disk. The pits are created in the
under layer of dye or aluminum in the case of commercially made CD/DVD's.

I have usually found a clear CD, on top and bottom when buying 100 of them. 
This protects the first CD from damage I suppose.  This clear CD is regular
CD without the dye layer.  Looking through it's clear plastic you can see the
effect of the tracks in the plastic.

They cause light to be split into it's wavelengths.

I hope this post will help.

Thank you.
Andre in California


 

Offline retiredchemist

  • First timers
  • *
  • Posts: 2
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #45 on: 24/02/2011 19:36:44 »
Hi, I'm brand new to this forum & am fascinated with your discussion of how one can use a CD disc & digital camera to record spectra.

I'd like to build a homemade flame photometer to measure Na, K,& Li in aqueous solutions (I'd be using a hydrogen-oxygen flame burning electolytically generated gasses)

I'd like to know if anyone has come up with a way to read-out the intensities of the recorded spectral lines.  There's lots of programs (e.g., MS Digital Imaging) that let you you first download and then manipulate/adjust  "pictures"  from these cameras - has anyone figured out a way to get those programs to indicate (with a number) how "bright" any given spot on them is?


 

Offline RD

  • Neilep Level Member
  • ******
  • Posts: 8125
  • Thanked: 53 times
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #46 on: 24/02/2011 23:13:01 »
I'd like to know if anyone has come up with a way to read-out the intensities of the recorded spectral lines.  There's lots of programs (e.g., MS Digital Imaging) that let you you first download and then manipulate/adjust  "pictures"  from these cameras - has anyone figured out a way to get those programs to indicate (with a number) how "bright" any given spot on them is?

It is possible to desaturate the image and pick a pixel or area and give a value for its brightness ...



but you'd have to come up with some constant reference light source to calibrate values.

BTW GIMP is free image manipulation software ... http://en.wikipedia.org/wiki/GIMP
 

Offline retiredchemist

  • First timers
  • *
  • Posts: 2
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #47 on: 25/02/2011 02:37:07 »
Thanks for heads up. I'll download the program you've identified & see if I can figure out how to use it.

I suspect that my scheme will be defeated by these sorts of cameras' automatic exposure optimization software but it'll be fun to try.

What I really need for this project is an old fashioned photomultipier tube. 
 

Offline BenV

  • Neilep Level Member
  • ******
  • Posts: 1503
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #48 on: 25/02/2011 09:04:22 »
If you have a camera that can shoot in RAW, you can get around much of the automated exposure issues.  You may then need more software to interpret the RAW image - I don't know if GIMP can do this.
 

Offline imatfaal

  • Neilep Level Member
  • ******
  • Posts: 2787
  • rouge moderator
    • View Profile
Can a digital camera be used as a spectrometer?
« Reply #49 on: 25/02/2011 11:30:19 »
My GIMP cannot cope with NEF files - which is Nikon's implementation of RAW (I think).  It also doesnt list RAW files as an open option.  Most cameras will come with software that will convert the native raw files to TIFF files which I believe will have the same effect.  It's possible someone has written an add-on for GIMP to interpret RAW. Will check
 

The Naked Scientists Forum

Can a digital camera be used as a spectrometer?
« Reply #49 on: 25/02/2011 11:30:19 »

 

SMF 2.0.10 | SMF © 2015, Simple Machines
SMFAds for Free Forums
 
Login
Login with username, password and session length