Diffraction Grating Back
Wave Optics / Interference & Diffraction

Diffraction Grating Simulator

Adjust grating spacing, wavelength, incident angle, and number of slits to compute diffraction angles, angular dispersion, and resolving power in real time. Animated white light rainbow dispersion on canvas.

Parameters
Grating Spacing d (µm) 1.67
Wavelength λ (nm) 532
Incident Angle θi (°) 0.0
Number of Slits N 500
Selected Order m
Diffraction Order m 1
Diffraction Angle θm (°)
Angular Disp. (°/nm)
Resolving Power R
Min. Resolvable δλ (nm)

Grating Equation

$$d(\sin\theta_m - \sin\theta_i) = m\lambda$$

Angular dispersion: $\dfrac{d\theta_m}{d\lambda}=\dfrac{m}{d\cos\theta_m}$

Resolving power: $R=mN$

All Orders (m = −3 to 3)
Order mθm (°)Valid
Intensity Pattern (Angle vs Relative Intensity)
White Light Rainbow Dispersion (m = 1, Canvas)

First-order (m=1) white light dispersion — diffraction angles for 380–780 nm color-coded by wavelength

What is a Diffraction Grating?

🧑‍🎓
What exactly is a diffraction grating? It sounds like a fancy filter.
🎓
Basically, it's a surface with a huge number of parallel, equally spaced grooves. When light hits it, each groove acts like a tiny source of light waves. These waves interfere with each other, creating a pattern of bright and dark spots. In the simulator above, you can see this pattern change in real-time as you adjust the Grating Spacing (d) slider.
🧑‍🎓
Wait, really? So the bright spots are the "orders" mentioned in the tool? What determines where they appear?
🎓
Exactly! The position of those bright spots, or diffraction orders, is governed by a precise condition. For instance, if you shine a red laser (λ = 650 nm) on a grating with 1000 lines/mm (d = 1 µm), the first-order red spot appears at a specific angle. Try it in the simulator: set λ to 650 and d to 1.0, and watch the angle for m=1. The governing rule is the Grating Equation.
🧑‍🎓
Okay, I see the equation. But why are some orders brighter than others? And what does the Number of Slits (N) control do?
🎓
Great question! The Grating Equation tells us *where* the bright spots are, but N controls *how sharp* they are. More slits mean the waves interfere more precisely, making the bright peaks narrower and more defined. Slide N up and down—you'll see the peaks get sharper or broader. This sharpness is crucial for the grating's Resolving Power, its ability to distinguish two very close wavelengths.

Physical Model & Key Equations

The core of diffraction grating physics is the condition for constructive interference. When the path difference between light from adjacent slits is an integer multiple of the wavelength, the waves add up to create a bright fringe (a diffraction order).

$$d(\sin\theta_m - \sin\theta_i) = m\lambda$$

d: Grating spacing (distance between adjacent slits). θi: Incident angle of the light. θm: Diffraction angle for order m. m: Diffraction order (0, ±1, ±2...). λ: Wavelength of the light.

Two key performance metrics derived from the grating equation are Angular Dispersion and Resolving Power. Dispersion tells us how much the angle changes for a given change in wavelength, which is vital for separating colors. Resolving power defines the smallest wavelength difference the grating can distinguish.

$$\text{Angular Dispersion: }\frac{d\theta_m}{d\lambda}=\frac{m}{d\cos\theta_m}\quad \quad \text{Resolving Power: } R = mN$$

A higher m (order) or a smaller d (spacing) increases dispersion, spreading the spectrum more. The resolving power R increases with both the order m and the total N (number of illuminated slits), making spectral lines sharper and more separable.

Real-World Applications

Spectroscopy: This is the most critical application. Gratings are the heart of spectrometers used in chemistry labs to identify materials, in astronomy to determine the composition and velocity of stars, and in environmental monitoring to detect pollutants. They separate light into its constituent wavelengths with high precision.

Laser Tuning & Pulse Compression: In advanced optics labs, diffraction gratings are used inside lasers to select a specific output wavelength. They are also key components in systems that compress ultra-short laser pulses, which is essential for cutting-edge research in physics and biology.

Optical Telecommunications (DWDM): Dense Wavelength Division Multiplexing (DWDM) systems use diffraction gratings (often in the form of arrayed waveguide gratings) to combine and separate dozens of different data-carrying laser channels in a single optical fiber, vastly increasing data capacity.

Consumer Electronics: The reflective, rainbow-colored patterns on CDs, DVDs, and Blu-ray discs are a form of diffraction grating. The data is stored in a spiral track of microscopic pits, which acts as a reflective grating when illuminated by white light.

Common Misconceptions and Points to Note

First, note that "making the grating spacing d too small does not mean everything will be seen clearly." While reducing d does increase angular dispersion and sharpen color separation, real diffraction gratings have a design parameter called the "blaze angle," optimized to concentrate light energy into a specific order (e.g., m=1). If you set d to an extremely small value (e.g., below 0.5µm) in the simulator and use a high order (m), higher-order images (like m=5) may appear in theory. However, in actual spectrometers, these higher-order beams are often very dim and impractical. Always be mindful of the trade-off between "brightness" and "resolution."

Next, the rainbow you see in the white light simulation is not just the 'first-order spectrum'. If you press the white light button and switch to, say, m=2, you should see the rainbow spread out even further. This is the 'second-order spectrum'. In fact, in these higher-order rainbows, "spectral overlap" occurs where long-wavelength red from one order overlaps with short-wavelength violet from the next order. For example, with visible light (400-700nm), light of 700nm for m=2 and light of 467nm for m=3 can emerge at the same angle. When designing a spectrometer, you need to consider the concept of "free spectral range" to avoid this overlap.

Finally, not all the 'bright fringes' on the simulator have the same intensity. This tool prioritizes understanding and indicates angles of constructive interference with lines. However, the actual light intensity distribution is limited by the envelope of diffraction from a single slit. Typically, the center (m=0) is brightest, and intensity decreases for higher orders. Also, the change in the "sharpness of the interference fringes" due to the finite total number of slits N is a key point. With fewer N, the fringes blur; with more N, they sharpen. The resolution formula R=mN represents this effect of N.

Related Engineering Fields

The core "wave interference" calculation of this simulator is applied directly not only in optics but also in the field of antenna design. Replacing the grating's "slits" with "antenna elements" gives you the design principle of an "array antenna." By controlling the interference of radio waves emitted from each element, a strong beam is formed in a specific direction (this is called "directivity"). The grating spacing d corresponds to the antenna element spacing, and the wavelength λ corresponds to the radio wavelength. When you change the incident angle θ_i in the simulator, the pattern becomes asymmetric. This is the foundational concept for "phased array radar," which electronically controls beam direction in array antennas.

It is also deeply connected to "lithography," a cutting-edge semiconductor manufacturing technology. When transferring fine circuit patterns onto a silicon wafer, the diffraction of light determines the resolution limit. In particular, the periodic pattern on the mask (reticle) functions precisely as a diffraction grating, and the projection lens captures only some of the diffracted orders to form an image. By using shorter wavelengths (ultraviolet or extreme ultraviolet: EUV) and skillfully utilizing diffraction orders m, it's possible to draw patterns much finer than the wavelength itself. The concept of angular dispersion here is directly linked to practical parameters like "depth of focus" and "process margin."

For Further Learning

The next step is to understand the superposition of "single-slit diffraction" and "multiple-slit interference." The bright line positions shown by this simulator are determined by the condition for "multiple-slit interference" (the grating equation), but the "intensity" of each line is modulated by the "single-slit diffraction" pattern. Specifically, the intensity distribution for single-slit diffraction, considering slit width a, $$I \propto \left( \frac{\sin \beta}{\beta} \right)^2, \quad \beta = \frac{\pi a \sin\theta}{\lambda}$$, acts as an envelope, within which numerous sharp interference fringes (diffraction images) are arranged. Mastering this concept will help you understand the meaning of "blaze characteristics" listed in the specifications of actual spectrometers or diffraction grating products.

If you want to go a step further mathematically, take a peek into the doorway of "Fourier optics." A periodic structure like a diffraction grating has a transmittance function that can be expanded as a Fourier series. The image (diffraction pattern) of light that has passed through it actually corresponds to its Fourier transform. The diffraction angles found from the grating equation correspond to the frequency components of each order in the Fourier series, and the intensities of the diffraction images correspond to the Fourier coefficients. Gaining this perspective allows for a unified understanding not only of diffraction gratings but also of lens imaging and holography principles. We recommend starting by looking up the keywords "Fraunhofer diffraction" and its "relation to the Fourier transform."