DIY Spectroscope Experiment With a CD and a Box
Table of Contents

DIY Spectroscope Experiment With a CD and a Box

A DIY spectroscope experiment with real results: see mercury's bright lines in a fluorescent tube, the gap in a white LED, and why you never aim it at the sun.

Point a cardboard box at a filament bulb and you see a smooth rainbow. Point the same box at a fluorescent tube and the rainbow is gone, replaced by a handful of separate bright coloured lines, floating in the dark, with nothing between them. Those lines are mercury atoms, and their positions are fixed by quantum mechanics. This DIY spectroscope experiment costs nothing beyond an old CD and shows a child the single most important measurement in astronomy: how we know what distant things are made of without going there. One rule overrides everything else here. You never aim a spectroscope at the sun.

Key Takeaways

  • A cereal box, a 0.5 mm slit and a piece of CD make a spectroscope good enough to resolve mercury’s emission lines in a fluorescent tube.
  • A filament bulb gives a continuous spectrum. A fluorescent tube gives discrete lines. A white LED gives a blue spike plus a broad hump with a visible gap near cyan.
  • A DVD works better than a CD, because its grooves are 0.74 µm apart rather than 1.6 µm, which roughly doubles the spread.
  • Never point it at the sun. No sunglasses, exposed film, smoked glass, welding glass below shade 12 or stacked filters make that safe. Use blue sky or sunlight bounced off white paper.
  • Best for ages 10 to 15, with an adult doing the cutting.

What You’ll Need

ItemHow muchWhere to get itIf you don’t have it
Cereal box1, the taller the bettern/aAny opaque box 20–30 cm long; longer gives better resolution
CD or DVD1An old disc you can cut upA DVD is better. A rewritable disc works; a printed label makes cutting messier
Craft knife and scissors1 eachn/aAdult only. Snapped disc edges are sharp
Black electrical tape1 rolln/aTwo strips with a 0.5 mm gap make the best slit
Black paint or black paperEnough to line the boxn/aA thick black marker on the inside walls
Ruler and protractor1 eachn/aFold a paper square for 45°, then estimate 60°
Light sources to test4–5Filament or halogen bulb, fluorescent tube or CFL, white LED, candle, street lampA phone torch counts as a white LED
Phone camera1n/aPhotographing through the eyehole captures lines your eye sees but forgets

Time: prep 30 min, observing 30 min and then weeks of opportunistic looking Cost: nothing Mess level: low, though cutting a disc flakes off bits of coating

Do the Experiment: A DIY Spectroscope Experiment

Step 1 - Cut a 0.5 mm slit, and take it seriously

At one end of the box, cut a rectangular hole about 3 cm tall and 2 cm wide, then tape two strips of black tape across it so their straight edges leave a vertical gap of about 0.5 mm. Hold it to a lamp: the gap should be a barely visible hairline. Slit width sets your resolution, and a 2 mm slit turns every line into a smear.

Step 2 - Cut the disc and mount it at 60°

An adult cuts a wedge roughly 4 cm square from the disc, using scissors and accepting that the coating will flake. At the opposite end of the box from the slit, cut a slot in the bottom at about 60° to the box’s long axis and slide the disc piece into it, shiny side facing up toward the slit end.

Step 3 - Cut the eyehole and black out the inside

Cut a 1.5 cm viewing hole in the top face, directly above the disc, angled so you look down at the disc surface. Line every interior surface with black paper or paint. Then tape every seam shut. Any light that gets in other than through the slit will wash the spectrum out.

Step 4 - Test it on a filament bulb and predict

Point the slit at an incandescent or halogen bulb from about 1 m and look through the eyehole at the disc, moving your eye around until a band of colour appears off to one side. Before testing anything else, ask: “Will a fluorescent tube look the same as this bulb, or different?” Most people expect the same.

What you should see: A continuous rainbow, red through violet, with no gaps and no bright lines. A candle flame gives the same thing, weighted toward red. These are thermal sources: hot matter radiating across all wavelengths.

Step 5 - Look at a fluorescent tube or a CFL

Point it at a fluorescent tube, from a few metres if necessary.

What you should see: Separate bright lines with dark space between them, sitting on top of fainter broad bands. With a good slit you should pick out a violet line, a blue line, a strong green line and a yellow pair. Those are mercury emission lines; the NIST Atomic Spectra Database lists the strong visible mercury lines at 404.7, 435.8, 546.1 and the close pair at 577.0 and 579.1 nm. The broad bands come from the phosphor coating on the glass.

Step 6 - Look at a white LED

Point it at an LED bulb or a phone torch.

What you should see: A bright narrow blue region, a dip, then a broad yellow-through-red band. The gap near cyan is real: a white LED is a blue chip plus a yellow phosphor, and nothing fills the middle. This is the same spectral hole that spoils LED-lit prism rainbows, and it explains why some objects look slightly wrong under LED lighting.

Step 7 - Observe the sun safely, by not looking at it

With your back to the sun, point the slit at a patch of clear blue sky well away from the sun, or at a sheet of white paper lying in sunlight.

What you should see: A bright continuous spectrum, brighter than any lamp. With a DVD grating, a slit under 0.5 mm and a steady hand, you may catch narrow dark lines crossing it, which are Fraunhofer absorption lines from elements in the sun’s atmosphere. Many home builds will not resolve them, and saying so beforehand is better than pretending.

What’s Actually Going On

Your spectroscope has two parts: a slit that defines a narrow line of light, and a diffraction grating that spreads that line out by wavelength. The grating is the disc.

A CD stores data in a spiral track, and the tracks are extremely regularly spaced. That regular spacing is what matters here; the data is irrelevant. For CD, the track pitch is 1.6 micrometres, which is 625 tracks per millimetre. For DVD it is 0.74 micrometres, or about 1,350 per millimetre. When light reflects off that corrugated surface, the wave bouncing off one track travels a slightly different distance from the wave bouncing off the next. For a given wavelength, there are specific angles at which those path differences are a whole number of wavelengths, so the waves arrive in step and add. That condition is the grating equation, d sin θ = mλ. Different wavelengths satisfy it at different angles, so white light fans out into a spectrum. Y. Kruglyak set out the compact disc as a classroom diffraction grating in Physics Education in 1991, and Fumitaka Wakabayashi and Kiyohito Hamada published the higher-resolution DVD version in the Journal of Chemical Education in 2006.

Run the numbers and the DVD’s advantage is obvious. At 550 nm in first order, a CD gives sin θ = 0.55/1.6 = 0.344, so θ = 20°. A DVD gives sin θ = 0.55/0.74 = 0.743, so θ = 48°. More than twice the angle, for the same wavelength, means the spectrum is stretched further and closely spaced lines separate.

Here is the point most explanations miss. A grating and a prism both make rainbows, but by different mechanisms and in opposite orders. A prism works by dispersion: the refractive index of glass is higher for blue than for red, so blue bends more. A grating works by interference: the grating equation puts longer wavelengths at larger angles, so red is deviated more than blue. Hold your spectroscope and a prism side by side and the colour sequences run opposite ways relative to the undeviated beam. That is a checkable prediction and it makes the mechanisms distinguishable rather than interchangeable.

Why do the lines exist at all? Electrons in an atom can only occupy particular energy levels. When an excited electron drops from one level to a lower one, it emits a photon whose energy, and therefore wavelength, equals the difference between the levels exactly. Those differences are a property of the element, so the pattern of lines is a fingerprint. Mercury vapour in a fluorescent tube always emits at 404.7, 435.8, 546.1, 577.0 and 579.1 nm, in every tube ever made, anywhere. Hot dense matter like a filament has so many interacting states that the levels smear into a continuum, which is why a bulb gives an unbroken rainbow.

That fingerprinting is the reason spectroscopy matters. Point a spectrograph at a star and the absorption lines tell you which elements are in its atmosphere, how hot it is and how fast it is moving toward or away from you. NASA’s summary of Hubble spectroscopy describes the same measurement your cereal box is doing badly. The gap between them is precision, not principle.

How to Explain It to Your Kid

Ages 5–8: The shiny disc sorts the colours out

Let them tilt a whole CD in sunlight indoors and find the rainbows, then look through the box at a lamp. Say the tiny lines on the disc, too small to see, split white light into all its colours. Then show them a fluorescent tube and let them notice that some lamps have “stripes” instead of a rainbow. That contrast is enough at this age, and it is worth a lot.

Ages 9–12: Different lamps have different spectra

Make it a survey. Build a table of lamps around the house and sketch what each one looks like: filament, LED, fluorescent, candle, phone screen, street lamp. Then introduce the key split between continuous and line spectra and have them sort their own sketches into the two groups. The connection to how LED bulbs actually make white light lands well here, because they will have seen the gap themselves.

Ages 13+: Use the grating equation

Give them d sin θ = mλ and have them calculate the first-order angle for 450, 550 and 650 nm for both a CD and a DVD. Then have them estimate the wavelength of the strong green line they see in a fluorescent tube by measuring its angle, and compare against 546.1 nm. Getting within 20 nm with cardboard is a real result. Then ask the question that makes it astronomy: if a star’s hydrogen lines all appear at longer wavelengths than they should, what does that tell you about the star?

The question to ask: “If I held a red filter in front of the slit, what would happen to the spectrum? Would it get shorter, dimmer, or shift? Decide first, then we test it.”

Why Teaching This Early Pays Off

Spectroscopy is the single most productive measurement technique in the physical sciences, and it is almost entirely invisible in school science before sixth form. Children meet “how do we know what stars are made of?” as a fact to be accepted. Building a spectroscope converts it into a method they have personally used, badly, which is a completely different relationship to the claim.

It also delivers something rare: a direct, household observation of quantisation. Discrete bright lines with darkness between them are not what a continuous classical picture of light and matter predicts. A child who has seen four separate mercury lines in a fluorescent tube has observed evidence for discrete atomic energy levels with their own eyes, in their own kitchen, which is a better starting point for quantum ideas than any analogy.

Keep the claim proportionate. One cereal box will not teach atomic physics, and most builds will not resolve solar absorption lines. What it reliably produces is a lasting habit of looking at light sources and asking what they are made of, plus a table of real observations the child made and recorded themselves.

Before You Start: What Parents Should Know

Best age10 to 15. Younger children can use one an adult has built
SupervisionAdult for all cutting, and adult present whenever sunlight is involved
Real hazardsNever aim it at the sun. A spectroscope invites you to stare at a bright source through a narrow slit, which is exactly the wrong instinct. Solar retinopathy can be permanent and is often painless; NASA’s eclipse safety guidance is clear that only certified ISO 12312-2 filters allow direct solar viewing, and that sunglasses, stacked sunglasses, exposed film, smoked glass, CDs and welding glass below shade 12 do not. Cut CD edges are sharp and the metallic coating flakes; tape the exposed edge. Craft knives are adults only. Do not look directly at a bare fluorescent tube’s electrodes for extended periods, and never at an unshielded UV or germicidal lamp
Don’tDon’t substitute a disc as a “solar filter”. A CD transmits and reflects infrared freely and provides no eye protection at all, despite appearing dark

When It Doesn’t Work

  • A blurry smear instead of lines. Your slit is too wide. This is the dominant failure. Rebuild it with two strips of black tape leaving a hairline gap of 0.5 mm or less.
  • A washed-out, pale spectrum. Light is leaking in. Tape every seam, line the interior black, and view in a darkened room.
  • You cannot find the spectrum at all. The disc angle is wrong, or you are looking in the wrong direction. Move your eye around the hole and rock the box: the spectrum sits off to one side of the direct view, not in front of you.
  • The lines are curved rather than straight. Normal with a CD, because its tracks are circular rather than straight. Use a wedge cut from near the outer edge of the disc, where the curvature across 4 cm is least.

Take It Further

  • Survey every lamp you can reach. Record a sketch and a phone photograph through the eyehole for ten different sources, including a sodium street lamp if your area still has the orange ones. Low-pressure sodium is nearly a single yellow line, which is the most striking spectrum available to a pedestrian.
  • Calibrate it. Use the known mercury lines from a fluorescent tube at 435.8 and 546.1 nm as two reference points, mark them on a card taped inside the eyehole, and then read unknown lines off your own scale. That turns a demonstration into an instrument.

What to Watch For Over the Next 3 Months

  • Week 4: They look at a lamp through their fingers or a disc without being prompted, and start categorising lights as “rainbow” or “stripes”.
  • Month 2: They notice that clothes or food look different under a supermarket’s lighting than in daylight, and connect it to the gap in the LED spectrum.
  • Month 3: If they ask how a telescope can tell how fast a galaxy is moving, they have arrived at the Doppler shift, and the honest answer is that it measures exactly the same line positions they measured, just more precisely.

Frequently Asked Questions

Why does a fluorescent tube show lines but a bulb shows a rainbow?

Because they emit by different processes. A filament is hot dense matter whose energy levels smear into a continuum, so it radiates at every wavelength. A fluorescent tube excites isolated mercury atoms, and an isolated atom can only emit at the specific wavelengths matching differences between its energy levels.

Is a DVD really better than a CD?

Yes, substantially. DVD tracks are 0.74 µm apart against a CD’s 1.6 µm, so for the same wavelength the diffraction angle is more than twice as large and closely spaced lines separate. The trade-off is that you have to search a wider angle to find the spectrum.

Can I use this to look at the sun or an eclipse?

No. Never point it at the sun. The narrow slit encourages prolonged staring at an extremely bright source, which is how retinal damage happens. For a solar spectrum, point it at clear blue sky away from the sun, or at sunlight reflected from white paper.

Why are the lines in my spectroscope curved?

Because a CD’s tracks are circular arcs rather than straight lines, so the grating is curved. Cut your wedge from close to the outer edge of the disc, where the arc is flattest across a 4 cm piece, and the curvature becomes much less noticeable.


About the author

Ricky Flores is the founder of HiWave Makers and an electrical engineer with 15+ years of experience building consumer technology at Apple, Samsung, and Texas Instruments. He writes about how kids learn to build, think, and create in a tech-saturated world. Read more at hiwavemakers.com.


Sources

  1. Kruglyak, Y. (1991). “The compact disc as a diffraction grating.” Physics Education, 26(4), 255–256. https://doi.org/10.1088/0031-9120/26/4/010
  2. Wakabayashi, F., & Hamada, K. (2006). “A DVD Spectroscope: A Simple, High-Resolution Classroom Spectroscope.” Journal of Chemical Education, 83(1), 56. https://doi.org/10.1021/ed083p56
  3. National Institute of Standards and Technology. “Atomic Spectra Database Lines Form.” https://physics.nist.gov/PhysRefData/ASD/lines_form.html
  4. NASA Science. “Hubble Spectroscopy.” https://science.nasa.gov/mission/hubble/science/science-behind-the-discoveries/hubble-spectroscopy/
  5. NASA Science. “Eclipse Viewing Safety.” https://science.nasa.gov/eclipses/safety/
  6. Georgia State University. “Diffraction Grating.” HyperPhysics. https://hyperphysics.gsu.edu/hbase/phyopt/grating.html
  7. National Research Council. (2012). A Framework for K-12 Science Education. National Academies Press. https://doi.org/10.17226/13165
Ricky Flores
Written by Ricky Flores

Founder of HiWave Makers and electrical engineer with 15+ years working on projects with Apple, Samsung, Texas Instruments, and other Fortune 500 companies. He writes about how kids learn to build, think, and create in a tech-driven world.