Naked Science Forum

Non Life Sciences => Technology => Topic started by: Damo the Optics Monkey on 25/02/2009 11:31:49

Title: Can a digital camera be used as a spectrometer?
Post by: Damo the Optics Monkey on 25/02/2009 11:31:49
This is one of my many ongoing projects (asides from teaching, a few inventions, a Masters and being beat up by 7 year olds).

I have a Canon G10 - a pretty sweet camera with incredible features, detailed here (http://www.canon.com.au/products/cameras/digital_compact_cameras/powershotg10.aspx).

Does anyone know of any other attempts to use a camera as a spectrometer?
Title: Re: Can a digital camera be used as a spectrometer?
Post by: girts on 25/02/2009 15:56:10
I doubt one can get a valuable information out of a digital camera. It probably changes the reading of sensors to fit the human expectations of a picture - makes it more nice to a human eye. I have however no facts behind my biased opinion.
Title: Re: Can a digital camera be used as a spectrometer?
Post by: RD on 25/02/2009 16:09:54
Fitting a transmission type diffraction grating to a camera will split light into spectra.

Cokin make a filter which can be used for this purpose ... http://www.astrosurf.com/buil/us/spe1/spectro3.htm

Or a cheaper option would be these diffraction spectacles ... http://www.mutr.co.uk/product_info.php?products_id=1009604
Title: Re: Can a digital camera be used as a spectrometer?
Post by: Damo the Optics Monkey on 26/02/2009 08:39:24
they are pretty darn cool!  Thank you for the links I will have a closer look at them.

Thankfully the g10 has RAW format as an option
Title: Re: Can a digital camera be used as a spectrometer?
Post by: RD on 26/02/2009 16:49:19
Another source of cheap diffraction gratings ...


Quote
DIFFRACTION GRATING (Experiment Pack)

This pack contains 3 different transparent film holographic transmission diffraction gratings. 1000 lines/mm, 500 lines/mm and a crossed axis grating . The high line density produces a wide coloured spectrum of the observed or projected light source similar to a prism. Make a hand spectroscope. Size 15.2 x 3.8cm sufficient for four 35mm slideholders which can easily be made from the cardboard box. Instructions and experiment sheet included.   
 Ref: OPF0002 | Price: £7.99 |
http://www.greenweld.co.uk/acatalog/Shop_Experimental_75.html
Title: Re: Can a digital camera be used as a spectrometer?
Post by: Bored chemist on 26/02/2009 18:27:30
The really cheap option is to use a cd as a diffraction grating.
Title: Re: Can a digital camera be used as a spectrometer?
Post by: lyner on 26/02/2009 22:12:01
You would need to burn your own CDROM with the appropriate data or you wouldn't get the purity of spectrum from it. The grating must be really uniform even if its dimensions are not known (you could calibrate it).
A pretty looking spectrum from a shiny CD doesn't mean it would be any use as a measuring instrument of any worth. I'm not even sure that you could produce uniform grooves over a wide enough area for it to work.
Title: Re: Can a digital camera be used as a spectrometer?
Post by: RD on 27/02/2009 03:13:35
Quote
The performance of this ultra-low cost spectroscope is comparable with instruments typically costing £80. It uses a CD or DVD as a reflective diffraction grating and clearly shows Fraunhofer lines in the spectrum arising from natural light – and distinctive emission bands from artificial sources such as sodium lamps. Differences between fluorescent lighting tubes – e.g., white light or ‘warm’ light types - can be easily identified by their distinctive emission bands.

 [ You are not allowed to view attachments ]

 
The spectroscope is made from virtually indestructible polypropylene and supplied in flat pack form – taking about 30 seconds to assemble. It comes with a free CD but can be used with any CD (or a DVD for higher resolution).

Nb. The really intriguing aspect of this device is the use of a common place CD or DVD replacing either an expensive prism or specially made diffraction grating.
http://www.mutr.co.uk/product_info.php?products_id=1009497
Title: Re: Can a digital camera be used as a spectrometer?
Post by: Bored chemist on 27/02/2009 06:59:12
For the old fashioned amomng you, you can also use a vinyl record as a grating. LPs work better than singles.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner on 05/03/2009 11:31:51
Excellent for a spectroscope (qualitative) but not for a spectrometer (quantitative).
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist on 05/03/2009 19:28:44
The picture RD has kindly provided gives a set of lines. My guess is thery are the mercury lines (mainly) and I can look up the wavelengths of those.
I could, in principle, get a similar picture of the spectrum of light from some other source and, by comparing it to the mercury spectrum, I could find out what wavelengths were present.

That looks like a spectrometer to me- albeit not a vrey good one.

What would be more of a challenge would be to measure the intensity of the light at each wavelength but, in theory, the digital camera records the intensity at each pixel at each of 3 wavelength bands (or at least soemthing like that).
You could add those together across pixels and along the spectral lines to get a measurement of the intensity of the line.
Then you could do much the same thing with, for example, a tungsten lamp at a known temperature- which gives a known relative amount of light at each wavelength.
From that data you could constuct a calibration of sensitivity versus wavelength.

It would be a total pain in the neck, but you could make a spectroscope, a spectrometer and a spectrophotometer out of that rig.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner on 05/03/2009 23:06:41
I think you'd be trying to make a silk purse out of a sow's earhole, actually; albeit a pretty one. I doubt you could resolve Zeeman splitting, for example - or red shift for a distant star.
Horses for courses, surely.
Title: Can a digital camera be used as a spectrometer?
Post by: Waquinn on 02/05/2009 23:26:54
This is my first time on any Forum, apologies in advance.
I do not agree that a home made spectroscope based on a CD/DVD is totally useless.
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. This is then stacked using RegiStax (to improve S/N), edited and cropped, and finally desaturated using GIMP. I use vspec to convert this image into a profile of intensity. It can easily resolve lines at 542.2nm and 546.5nm. Intensity, of course, can only be compared if the device is calibrated.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist on 03/05/2009 15:48:36
Sounds like an interesting project. Now all I need is a strong enough magnetic field to split a line by about 4.3nm and I can use your machine to resolve Zeeman slitting, thereby refuting sophiecentaur's conclusion.


(I know that, in practice, a better spectrometer would be easier than a strong enough magnet)
Title: Can a digital camera be used as a spectrometer?
Post by: lyner on 03/05/2009 23:47:35
This rotating table sounds more like a piece of lab equipment than a 'kitchen table'.
Seriously, it sounds like the makings of a workable system and a few years ago a digital sensor array would have been a well sexy bit of lab kit.
But I'm not sure where this is taking us. A CD is a handy form of grating but hardly worth considering if you want good results.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner on 05/05/2009 11:29:01
Also, Waquinn, why not use a uniform grating? Any non uniformity in the spacing (due to even basic formatting info) will affect the dispersion and the purity of the diffraction pattern.
Pretty, as I said before, and very informative but a 'scope' not really a 'meter'. Are gratings really that expensive? I seem to remember we had a boxfull when I was at Uni - decades ago.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist on 05/05/2009 20:28:39
I don't supose you had boxfulls of CDs when you were a student but do you understand just how cheap a CD is?
The encoding on CDs is carefully designed to avoid having too much patterning in the pits and troughs so it tends to look like noise in the spectrum. They clearly are not ideal but there's no question that you can use a CD as a good enough grating to resolve the two lines that Waquinn talks of.
Also, I still stand by my assertion that, given a calibration like the mercury spectrum (or, at a pinch, a copy of the red book) you could measure the wavelength of the light.

Nobody is saying that this would be much better than a toy, but for toys cheap is good.
BTW, I meant this red book.
http://en.wikipedia.org/wiki/Red_Book_(audio_CD_standard)
Title: Can a digital camera be used as a spectrometer?
Post by: lyner on 05/05/2009 22:31:55
(A) boxfull of 45s, actually.

Blank CDs are as cheap as chips, I know. The rest of the device wouldn't be free, though, and the incremental cost of a grating seems so low that the benefit would seem to make it worth while.

I don't quite know what you are getting at about the coding of the data on the disc. There is extensive interleaving and redundancy to reduce the effect of isolated, large, faults to produce noise rather than splats. But there is nothing as simple as a regular set of stripes, which is what a  diffraction grating really requires.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist on 06/05/2009 20:33:09
Imagine that I cut a bit from a CD to use as a grating. If the data on it were such that half of it was covered by 1,1,1,1,0,0,0,0,1,1,1,1 etc but the other half had 1,1,0,0,1,1,0,0... then the 2 parts would give seriously different diffraction paters. That would mess up my sppectrum badly.
But the encoding is such that regular large sequences are forbidden so all I see is the basic "pitch" of the tracks and some effectively random noise from the data.

Incidentally, if you look at this
http://www.exo.net/~pauld/activities/CDspectrometer/cdspectrometer.html
Or this
http://www.mutr.co.uk/product_info.php?products_id=1009497

you will see that by far the most expensive part of the putative spectrometer (and I accept that they have built a 'scope rather than a 'meter) would be the camera and the software. But many people have already got that; they also have lots of CDs.
Not many of them have a purpose made diffraction grating (and the cheap ones are pretty cappy anyway).
As I said, if you want a spectroscope as an educational toy the CD is probably the best bet for a cheap grating.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner on 07/05/2009 00:35:27
The fact that the pattern of holes on a CD is random makes things worse! What you need for a good diffraction pattern is a uniform set of stripes and not a set of parallel rows of random tiny holes.  The modulation will produce a serious broadening of any spectral lines, negating the point of having a lot of stripes. You don't need a particularly fine grating, in any case - you can do the sums as well as I can.
I have a feeling that, if you wanted a good, cheap, substitute for a diffraction grating, you might be better off with a bit of holographic wrapping paper or a Christmas decoration- if you chose the right pattern. They have relatively simple patterns on them with large areas of the same spatial period, which is what you want. Just cut out one bit which is all the same and it could give you and excellent result.
BTW, Rapid Electronics will supply a 50X50 mm grating with 300 lines per mm for £9.00. Why not do the job properly?
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist on 07/05/2009 08:07:15
"BTW, Rapid Electronics will supply a 50X50 mm grating with 300 lines per mm for £9.00. Why not do the job properly? "
To save about £6

Title: Can a digital camera be used as a spectrometer?
Post by: lyner on 08/05/2009 00:23:53
Telescope, camera, table, etc + CD  vs Telescope, camera, table, etc + £9

What is the difference in cost as a percentage and what is the difference in performance?  The £6 would be well spent, in my opinion. Most Scientists are after the best possible result for as much money as they can afford.
Title: Can a digital camera be used as a spectrometer?
Post by: Waquinn on 08/05/2009 23:02:16
My spectroscope if definitely homemade. The tracks of a CD/DVD form the reflection grating; the track pitch of a DVD is 0.74um. This is a lot better than 300 lines per mm.
Unfortunately, first results using a DVD instead of a CD were not as good as expected.
 [ Invalid Attachment ]
Operator error I'm afraid. I did not change the settings from the CD.
I am also having difficulty calibrating the amplitude response using a known amplitude profile source (a light bulb) especially in the near infrared.
I agree with other contributors, there is no replacement for the correct tool. However, it does exactly what I need it to do for now to test my prototype. Buying a spectrometer without testing the basic parameters of my design would have been a waste.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist on 09/05/2009 19:45:58
Telescope, camera, table, etc + CD  vs Telescope, camera, table, etc + £9

What is the difference in cost as a percentage and what is the difference in performance?  The £6 would be well spent, in my opinion. Most Scientists are after the best possible result for as much money as they can afford.
Guess what? The person who originally wrote to ask if one can use a camera as a spectrometer already has a camaera.
Unless you want to look at the spectormeter from a long way away I don't see the point of the telescope and I doubt that you will find many households where they don't have a table, and you could use the floor anyway. So what we are looking to compare is the £9 for a diffraction grating and the £2.90 +vat for the spectroscope kit that they sell at MUTR.
In percentage terms that's about 300%.
It's true that most scientists are after the best kit they can afford but I am not sure this is really about scientific equipment, but more along the lines of an educational toy. I still think that a CD will do a pretty good job for no cost.
In any event, Since Waquinn has kindy provided us with a spectrum taken using a CD I don't see how anyone can deny that it's possible.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner on 10/05/2009 10:51:56
BC, if you want to see spectral lines you need some optics to produce a good beam of light from a slit. That is what I meant by "telescope". What other source could be used? The 'slit' also needs to be narrow and bright enough to see and resolve the lines and some optics (albeit simple) will improve matters. Is the proposed / described arrangement just a slot with bright sunlight shining through it?
I never suggested that it couldn't be done with a cheap and cheerful CD but, if you don't do your best, you end up with a qualitative not quantitative result.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner 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.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: wolfekeeper 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.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner 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.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner 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
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner 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. . .  [:-\]


Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner 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!
Title: Can a digital camera be used as a spectrometer?
Post by: lyner 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.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner 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 (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.



Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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.
Title: Can a digital camera be used as a spectrometer?
Post by: lyner 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.
Title: Can a digital camera be used as a spectrometer?
Post by: Bored chemist 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...
Title: Can a digital camera be used as a spectrometer?
Post by: emissonspectroguy 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


Title: Can a digital camera be used as a spectrometer?
Post by: retiredchemist 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?


Title: Can a digital camera be used as a spectrometer?
Post by: RD 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 ...

 [ Invalid Attachment ]

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
Title: Can a digital camera be used as a spectrometer?
Post by: retiredchemist 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. 
Title: Can a digital camera be used as a spectrometer?
Post by: BenV 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.
Title: Can a digital camera be used as a spectrometer?
Post by: imatfaal 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
Title: Can a digital camera be used as a spectrometer?
Post by: imatfaal on 25/02/2011 11:55:41
There is an add-on for raw files and it copes with my NEF files.  I have had no time to play with it but it opens images from both my Nikons.  It is called UFraw  http://ufraw.sourceforge.net/Install.html#MS

I re-iterate I have not tried and tested to any extent - ie dont blame me if it screws up your wedding photos!