---
title: "Diffraction-Grating Spectrometer Interactive Lab | Sandbox Physics"
description: "What sets how finely a grating spectrometer can separate two close wavelengths?"
canonical_url: "https://sandboxphysics.com/labs/diffraction-grating-spectrometer/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/diffraction-grating-spectrometer/"
last_modified: "2026-10-27"
---

Optics 059 · Diffraction, Fourier optics, and computational imaging

# Diffraction-Grating Spectrometer

**What sets how finely a grating spectrometer can separate two close wavelengths?** Resolving power is the number of illuminated grooves times the diffraction order: light twice as many grooves and you separate lines half as far apart. A wide slit or large pixels smear each line and waste that. Blaze tilts the groove faces to send most light into one order. Different orders can land at the same angle, so a filter or a known order is needed to identify the wavelength.

Light follows the front-side path of a reflection-grating spectrometer. Resolve the sodium lines, change the number of grooves and the entrance slit, inspect the blaze facets, calibrate the detector pixels and use a filter to diagnose overlapping orders.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Reflection from a finite number of grooves is scalar, and the facet response follows Casini and Nelson. The slit is averaged uniformly and incoherently, the camera maps angle ideally, and records have 4096 finite pixels. The response is relative, not the absolute grating efficiency. Sodium lines use NIST wavelengths in air; source weights are illustrative, other sources are synthetic, and ultraviolet and infrared lines appear in false color. Gain is explicit, and ideal references are kept separate from recorded pixels. Coatings, polarization, aberrations, noise and a Maxwell solver are not included. The microscopic groove view is a separate drawing at uniform magnification, not a floating detector. When the two arms nearly coincide, they block each other; no Littrow beam splitter is modeled.

Physics tutorial

## Audit the physics of Diffraction-Grating Spectrometer

**Background** A grating turns colour into angle by matching the phase between neighbouring grooves: $d(\sin\alpha+\sin\beta)=m\lambda$. A reflection grating does not send these rays through its opaque back. The source and the camera that receives the diffracted light are both on the side the outward normal points to.

**Why it matters** What sets how finely a grating spectrometer can separate two close wavelengths?

Start with the essentials

- **Focus question**: What sets how finely a grating spectrometer can separate two close wavelengths?
- **One-sentence intuition**: A given angle does not pin down a unique wavelength: $m_1\lambda_1=m_2\lambda_2$. Different wavelengths in different orders can land on the same pixel. You need to know the order, or use an order-sorting filter, before you assign a wavelength.

### Core mathematical model

#### Reflection geometry with signed angles

$$
\begin{aligned}\sin\beta_m&=m\lambda/d-\sin\alpha\\\beta_0&=-\alpha\\|m\lambda/d-\sin\alpha|&\le1\end{aligned}
$$

The normal is the positive laboratory horizontal axis, and the grooves are vertical. The direction toward the source and the outgoing direction both have positive normal components, while the incoming propagation direction points toward the grating. The zero order follows ordinary reflection. An order whose sine falls outside this bound has no propagating ray.

#### Peaks from summing a finite array of grooves

$$
\begin{aligned}t&=\frac d\lambda(\sin\alpha+\sin\beta)\\A_N(t)&=\frac1N\sum_{j=0}^{N-1}e^{2\pi ijt}\\J_\lambda&=E_\lambda\,|A_N|^2\end{aligned}
$$

All the whole, uniformly illuminated grooves add their complex amplitudes. An integer phase gives a principal maximum, and the first null lies one over the groove count away. Every order, its side lobes and its width come from this one array sum, multiplied by a scalar facet envelope. The normalization is fixed; it does not follow whichever pixel is currently brightest.

#### Blaze is reflection from the groove facets

$$
\begin{aligned}\alpha+\beta_b&=2\varphi\\b&=d\frac{\cos\alpha}{\cos(\alpha-\varphi)}\\E_\lambda&=k\,\operatorname{sinc}^2\!\left(\frac{\pi b}{\lambda}S\right)\\S&=\sin(\alpha-\varphi)+\sin(\beta-\varphi)\end{aligned}
$$

The sawtooth is drawn with equal magnification in both directions. It has a right-angle apex, and the blaze angle sets its facet normal. The Casini–Nelson scalar facet integral uses the illuminated length of the facet, not its projected width. A shadow factor weakens outgoing directions that neighbouring facets hide. This relative scalar response is not a calibrated efficiency for a metal grating, and it does not solve for polarization.

#### Ideal resolution is only one limit

$$
\begin{aligned}R_{\rm ideal}&=|m|N\\\delta\lambda_R&=\lambda/(|m|N)\\\delta\lambda_{\rm slit}&\simeq\frac{d\cos\alpha}{|m|}\frac w{f_c}\end{aligned}
$$

The Rayleigh spacing applies to an ideal narrow line and a slit of zero width. For a real slit, points across it are uniform and incoherent; each gives its own incidence angle through the ideal collimator, and the intensities are averaged. The slit wavelength width shown is the small-angle geometric full width; it is not added in quadrature to the Rayleigh spacing. The recorded profile also includes averaging over finite pixels.

#### Calibrate the actual receiving plane

$$
\begin{aligned}u&=f\tan(\beta-\beta_c)\\\lambda_m(u)&=\frac d m\,[\sin\alpha+\sin\beta(u)]\\\beta(u)&=\beta_c+\arctan(u/f)\end{aligned}
$$

The camera arm follows the central wavelength in the selected order. The normal of its 12 mm sensor points back toward the camera pupil. The data row and the physical sensor face use the same 4096 pixel records. Enlarged curves stay outside the apparatus, and the colour bands repeat a one-dimensional record vertically so it is easier to see.

#### Overlapping orders, sorted before the grating

$$
\begin{aligned}\lambda_2&=\lambda_1/2\\1\lambda_1&=2\lambda_2\\J_{\rm record}&=\sum_\ell w_\ell T(\lambda_\ell)\,\langle J_\ell\rangle\end{aligned}
$$

The half-wavelength pair is a deliberately synthetic source, not a sodium emission spectrum. Its long wavelength in first order and its short wavelength in second order leave at the same angle. A perfect long-pass filter removes the short-wavelength light before it reaches the grating, and the data for the surviving channel stay the same. The infrared and ultraviolet are shown in false colour; they are not visible light.

### Common difficulties

#### More grooves do not fix every blur

**Typical misconception** The ideal resolving power set by the groove count guarantees that two lines will be separated, even with a wide entrance slit.

**Better mental model** Look at the acquired pixels. Slit averaging, sensor pitch and the chosen angular window can each set the limit. A calculated ideal resolving power is not the measured resolution of an instrument.

### Run the experiment

1. 01

   #### Scene 1: Resolve sodium doublet

   Use sodium. Compare a zero-width slit with a wide slit, change the groove count, and look at the raw profile at the center.

   **What to observe:** More grooves narrow the peaks of the finite array, but a wide slit can still merge the sodium doublet.

2. 02

   #### Scene 2: Blaze without moving lines

   Use blaze. Change the facet angle and look at the groove profile, drawn with equal magnification in both directions; compare it with the fixed tick for the ideal line.

   **What to observe:** Blaze changes the facet normal and the relative envelope, but the line positions from the grating equation stay where they are.

3. 03

   #### Scene 3: Overlapping orders and filter

   Use overlap. Read the candidate wavelengths for each order at the central pixel, insert the 500 nm long-pass filter, and compare both source channels.

   **What to observe:** The filter removes a source channel; it does not delete a diffraction order by number. Overlap means that one pixel cannot tell which order it is seeing.

Physical conclusion

An angle picks out the product of order and wavelength. The finite grooves, the slit and the pixels set the shape of the recorded line, and the blaze changes its relative weight.

## Related experiments and articles

Continue exploring

### Aperture, propagation, measurement

Change one physical assumption at a time: slit count, coherence, aperture shape or propagation distance.

1. [Lab **Diffraction Studio** Start with a focal-plane scan of one, two or many slits.](https://sandboxphysics.com/labs/diffraction/)
2. [Lab **Young Double-Slit Bench** Add unequal amplitudes and partial coherence to two slits.](https://sandboxphysics.com/labs/young-double-slit-bench/)
3. [Lab **Aperture Diffraction Studio** Draw a two-dimensional opening and inspect its complement.](https://sandboxphysics.com/labs/aperture-diffraction-studio/)
4. [Lab **Huygens–Fresnel Propagation Lab** Move the receiving plane from near field toward far field.](https://sandboxphysics.com/labs/huygens-fresnel-propagation-lab/)
5. [You are here **Diffraction-Grating Spectrometer** Connect groove spacing and illuminated count to spectral resolution.](https://sandboxphysics.com/labs/diffraction-grating-spectrometer/)

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
