Diffraction Grating Virtual Lab: Measuring a Wavelength

Updated 2026-10-07

This diffraction grating virtual lab turns the spectrometer practical into one every student can run. Laser light falls on a grating with 300 lines per mm. Students turn the telescope until the crosshair sits on each order, read the angle on both sides of the central maximum, and average the two readings. A graph of sin θ against the order n is a straight line through the origin, and its gradient gives the wavelength from d sin θ = nλ. The scale has a small random zero error, so averaging both sides is not just a ritual: it is what makes the answer right. Every value below was read from the simulation.

Wave interference and diffraction
  • AQA A-level Physics 7408, 3.3.2.2 (Diffraction): the diffraction grating equation d sin θ = nλ; required practical 2, interference by a diffraction grating.
  • NSW HSC Physics, Module 7 (The Nature of Light): quantitative investigation of interference using diffraction gratings.
  • AP Physics 2: physical optics, interference from multiple slits and diffraction gratings.

Simulic is not affiliated with or endorsed by AQA, NESA or the College Board.

Before the lab (5 min)

Ask students to commit to a prediction, on paper or as question 1 of the class link:

"The grating with 300 lines per mm is replaced by one with 600 lines per mm. What happens to the first-order maxima?"

Many students expect closer lines to squeeze the pattern together.

Method in the simulation

  1. Click the Grating tab. Keep Laser, Lines per mm N at 300, Spectrometer and Find λ (d known). Tick Hide the answer and leave Measurement errors ticked.
  2. Drag the telescope close to the n = 1 line above the straight-through beam (the + side). Use ◀ and ▶ until the line sits on the crosshair, then press Record reading.
  3. Measure the n = 1 line on the − side the same way.
  4. Repeat for n = 2, 3 and 4.
  5. Read the gradient of sin θ against n under the table. Calculate λ = d × gradient, with d = 1/N = 3.333 µm.
n θ₊ reading (°) θ₋ reading (°) θ = (θ₊ − θ₋)/2 (°) sin θ
1
2
3
4

the Grating tab with Laser, Lines per mm N 300, Spectrometer, Find λ (d known), Hide the answer and Measurement errors ticked, after recording orders 1 to 4 on both sides: the telescope on the n = 4 line on the − side, the table with θ = 10.93–10.95°, 22.30–22.33°, 34.72–34.73° and 49.43°, and the straight plot of sin θ against n with gradient 0.1899 (the θ₊ and θ₋ readings depend on that page load's zero error)

Expected results

The zero error changes with every page load or Reset, so the raw readings differ between students, but the averages do not.

n 1 2 3 4
θ₊ (°), run 1 11.05 22.40 34.85 49.55
θ₋ (°), run 1 −10.80 −22.20 −34.60 −49.30
θ (°) 10.93 22.30 34.73 49.43
sin θ 0.1895 0.3795 0.5696 0.7596
  • Zero error in run 1: +0.10°. A second run had +0.30° (θ₊ = 11.25°, θ₋ = −10.65°), yet gave the same θ values within 0.03°.
  • Gradient: 0.1899 in both runs, so λ = 3333 nm × 0.1899 = 633 nm. With Hide the answer unticked, the simulation confirms a 633 nm laser.
  • Highest order: d/λ = 5.27, so five orders appear on each side; the fifth sits at 71.7°.
  • 600 lines per mm: the first order moved to 22.3°, and only two orders were visible.

Questions for students

  1. (Prediction, asked again after the lab) What happens to the first-order maxima with 600 lines per mm instead of 300?
  2. Which is the dependent variable?
  3. What is θ for the second order?
  4. What wavelength does your gradient give?
  5. Why average the readings on both sides?

Answers for teachers: (1) They move to larger angles (10.95° to 22.3°) and fewer orders are visible. (2) The angle θ of each order. (3) Accept 22.15–22.50°. (4) Accept 627–639 nm. (5) A zero error shifts both readings the same way, so it cancels in (θ₊ − θ₋)/2.

Common misconceptions

  • "More lines per mm squeeze the pattern together." A smaller slit spacing d gives larger angles: sin θ = nλ/d.
  • "The angle doubles from order 1 to order 2." sin θ doubles; the angle goes from 10.95° to 22.33°, and order 4 is at 49.43°, not 43.8°.
  • "One side is enough." In run 2, θ₊ alone gave 11.25° for the first order, which would give λ = 650 nm.

Extension

  • Choose Sodium lamp and measure orders 1 to 3: the gradient of 0.1768 gave λ = 589.3 nm for the sodium D line.
  • Switch to Screen and metre rule, measure x₊ and x₋ for each spot and use tan θ = x/D to compare the two methods.

FAQ

Yes. In the link's starting values, set Screen to Grating and tick Hide the answer (Grating). Keep Laser wavelength λ (Grating) at 633 nm and Lines per mm N (Grating) at 300 so the answers match.

Why do θ₊ and θ₋ differ by a few tenths of a degree?

With Measurement errors ticked, the scale zero sits up to 0.4° away from the straight-through beam. That is exactly the error that averaging removes.

How precisely can students set the telescope?

The fine buttons move it in 0.05° steps, and Record reading only accepts a position close to a line. Careful students land within 0.05° of the centre.

Electron diffraction and the de Broglie wavelength – diffraction tube, double slit, electron microscope Models of the hydrogen atom – light and spectra

For diffraction of electrons, see the electron diffraction virtual lab. For another optics practical, see the Malus's law virtual lab.