Hands-on Activity: Graphing the Rainbow

Contributed by: Laboratory for Atmospheric and Space Physics (LASP), University of Colorado Boulder

Two images: (left) Drawing shows a triangular-based prism with white light entering one side and a rainbow coming out the other side. (right) Photo shows a landscape view across a valley with a full-spectrum rainbow ending near a multi-story apartment building.
When white light enters a prism, it bends (refracts), and colors are produced. The same thing happens when sunlight hits a water droplet. The colors that result from this bent light form the rainbows that are so familiar to us.
Copyright © (left) National Aeronautics and Space Administration and (right) 2004 Denise W. Carlson. Used with permission.


Students are introduced to different ways of displaying visual spectra, including colored "barcode" spectra, like those produced by a diffraction grating, and line plots displaying intensity versus color, or wavelength. Students learn that a diffraction grating acts like a prism, bending light into its component colors.
This engineering curriculum meets Next Generation Science Standards (NGSS).

Engineering Connection

Understanding graphs and plots is crucial to engineering, as engineering in all fields is driven by the need to obtain scientific data. Engineering methods are constantly improved and new types of engineering are created based upon the types of data needed to advance science.

Pre-Req Knowledge

Students should be familiar with line graphing methods and understand that graphs can be used to represent physical data. Students should have some understanding of the nature of light, i.e., rainbows are formed with light, light can be different colors, etc.

Learning Objectives

After this activity, students should be able to:

  • Explain that light from different sources, when passed through a prism or diffraction grating, can be separated into component colors.
  • Explain the basic tools engineers use to view spectra.
  • Match a "barcode" spectrum with its corresponding line plot.

More Curriculum Like This

Building a Fancy Spectrograph

Students create and decorate their own spectrographs using simple materials and holographic diffraction gratings. A holographic diffraction grating acts like a prism, showing the visual components of light.

Middle School Activity
Engineering Your Own Spectrograph

Students use simple materials to design an open spectrograph so they can calculate the angle light is bent when it passes through a holographic diffraction grating. A holographic diffraction grating acts like a prism, showing the visual components of light.

Middle School Activity
Designing a Spectroscopy Mission

Students find and calculate the angle that light is transmitted through a holographic diffraction grating using trigonometry. After finding this angle, student teams design and build their own spectrographs, researching and designing a ground- or space-based mission using their creation.

High School Activity
Needing Illumination – Investigating Light

Students learn the five words that describe how light interacts with objects: transparent, translucent, opaque and refraction.

Educational Standards

Each TeachEngineering lesson or activity is correlated to one or more K-12 science, technology, engineering or math (STEM) educational standards.

All 100,000+ K-12 STEM standards covered in TeachEngineering are collected, maintained and packaged by the Achievement Standards Network (ASN), a project of D2L (www.achievementstandards.org).

In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics; within type by subtype, then by grade, etc.

  • Develop and use a model to describe that waves are reflected, absorbed, or transmitted through various materials. (Grades 6 - 8) Details... View more aligned curriculum... Do you agree with this alignment?
  • Construct and interpret scatter plots for bivariate measurement data to investigate patterns of association between two quantities. Describe patterns such as clustering, outliers, positive or negative association, linear association, and nonlinear association. (Grade 8) Details... View more aligned curriculum... Do you agree with this alignment?
  • Represent data on two quantitative variables on a scatter plot, and describe how the variables are related. (Grades 9 - 12) Details... View more aligned curriculum... Do you agree with this alignment?
  • New products and systems can be developed to solve problems or to help do things that could not be done without the help of technology. (Grades 6 - 8) Details... View more aligned curriculum... Do you agree with this alignment?
  • Develop and design a scientific investigation regarding absorption, reflection, and refraction of light (Grade 8) Details... View more aligned curriculum... Do you agree with this alignment?
Suggest an alignment not listed above

Materials List

Each student needs:


How is a rainbow formed? It is created by light, and that light comes from the Sun. When the light passes through water droplets in the clouds, we can see the colors that we cannot usually see with our eyes. All light makes a pattern, and today we will be exploring the patterns that are hidden in light that we cannot normally see unless we have special tools to see them. Any light source, whether it is a light bulb, a computer monitor, a star, or a planet — when passed through a prism or a diffraction grating — displays a unique pattern of bright and dark stripes called spectra (the plural of "spectrum").

Prisms and diffraction gratings are tools we can use to see these patterns. Instrumentation developed by engineers can also measure exactly how bright each color is, since this is a difficult thing to do with our eyes. The instrumentation assigns a number value to brightness that can be plotted on a graph in which the x-axis position (horizontal) represents color and the y-axis (vertical) represents brightness, or intensity.

Engineers develop instrumentation based upon the properties of light. Engineers create instrumentation to see spectral patterns of light and study the patterns to improve and develop new instrumentation. They usually use diffraction gratings. They also study the processes and the types of light that create specific spectral patterns. Engineers studying space science are interested in answering questions about the composition of planetary atmospheres, planetary moons, stars and gasses within the solar system and universe.


absorption spectrum: Dark lines that appear against the continuous spectrum seen through a spectrograph.

continuous spectrum: The rainbow that white light is composed in which each color is equally bright.

diffraction: When light bends around an obstacle or through a small opening like those in a diffraction grating.

diffraction grating: Usually a piece of film covered with very thin, parallel grooves.

emission spectrum: Bright lines that appear through the spectrograph against a dark background.

light source: Any object that produces light.

spectrograph: A device that allows one to see a spectrum; it usually has a prism or diffraction grating inside.

spectrum (plural: spectra): The pattern light produces when passed through a prism or diffraction grating, as seen through a spectrograph.



White light, like that produced by an incandescent light bulb (with electricity passing through it), is composed of all of the colors of light in the rainbow combined. To our eyes, it simply looks white. A diffraction grating (or a prism) acts to break the light into its component colors. Certain colors "bend" more than others through the grating or prism, which is why the colors line up like a rainbow.

Light passing through a cool gas produces what is called an absorption pattern when seen through a diffraction grating or a prism, and dark lines appear in the continuous spectrum. The dark lines are actually created by the gas absorbing the energy of the light. We can identify the gas based on the distinctive pattern of lines that appear in the spectrum. Conversely, an emission spectrum is seen as bright lines against a dark background and is produced by a hot gas emitting photons. Again, the pattern the gas creates is dependent on the type of gas. A particular hot gas shows emission lines in the exact same places that the same cool gas shows absorption lines. The pattern does not change, but whether you see an absorption or emission pattern through the grating does change depending whether the gas is hot or cool. The resulting spectrum has a characteristic pattern of light and dark that, when analyzed, reveals the composition of the light source.

Three bars shows the roygbiv color range with varying widths of color bands.
Emission (top and bottom bars) and absorption (middle bar) spectra.
Copyright © LASP

When light passes through a material (including gases and liquids), many things may happen to it:


Copyright © http://missionscience.nasa.gov/ems/03_behaviors.html

As previously described, the light may be absorbed. This happens when the light photons (or "packages") hit an object, and it's molecules are shaken up by the light. This causes the material to become hotter.


Copyright © http://missionscience.nasa.gov/ems/03_behaviors.html

Reflection occurs when light bounces off of a material. The types (wavelengths) of light reflected depend on the composition of the material.


Copyright © http://missionscience.nasa.gov/ems/03_behaviors.html

Diffraction occurs when light is bend and spread around an object or a slit.


Copyright © http://missionscience.nasa.gov/ems/03_behaviors.html

Scattering occurs when light bounces of an object in a variety of direction. The sky is blue due to light scattering. The higher energy (shorter wavelength) light (violet and blue) tends to be scattered by the atmosphere, while the longer wavelength light (yellow and red) does not. Therefore blue and violet and scattered, and the sky appears blue (more blue than violet because human's eyes are more sensitive to blue).


Copyright © http://missionscience.nasa.gov/ems/03_behaviors.html

Refraction occurs when light changes direction when passing through an object. The different wavelengths are changed at different rates and allows colors to be separated The previous examples of a glass prism and rain drops are examples of refraction.

Before the Activity

  • Complete the "Patterns and Fingerprints" activity.
  • Make copies of the Graphing the Rainbow Worksheet
  • (optional) Make an overhead transparency of page two of the worksheet.

With the Students

  1. Hand out the worksheets.
  2. Using the worksheet as a guide, demonstrate how a visible light pattern can be graphically represented in different ways. It may help to show an overhead projection of page two of the worksheet.
  3. Walk around the room, talking to individual students about the graphs from the worksheet.
  4. Ask students questions about what they see in the plots and why the pictures correspond to a specific graph on the worksheet.


Troubleshooting Tips

Colorblind and vision-impaired children will have difficulty with this activity. Students with corrective lenses will not have difficulty. Pair colorblind and blind students with other students to assist them.


Pre-Lesson Assessment

Class Discussion: Ask students what they can tell you about light. Probe them to find out what they already know and understand.

Activity Embedded Assessment

Class Discussion: Ask students why they think light forms rainbows or patterns when passed through a prism or diffraction grating. (Note: The bending of light through a prism does not have to do with varying speeds of the colors! All colors travel at the same speed.)

Worksheet: Have students complete the activity worksheet; review their answers to gauge their mastery of the subject.

Post-Activity Assessment

Think-Pair-Share: Ask students to discuss with a peer what steps engineers take before designing instruments that study light. Randomly select groups to share. Discuss ideas as a class.

Graphing: Graphing and plotting are tools that all engineers use. Graphing and plotting real-world situations allow engineers to analyze whether a tool is working, how to design an effective tool, and whether the tool can be used to create software for looking at data (just like the data in this activity). Ask students to graphically represent a real-world situation, such as driving at a certain speed, coming immediately to a complete stop at some point, and then resuming that same speed. Another example might be a plot representing the descending from the top of a flight of stairs to arrive at some distance at the bottom (a distance vs. time plot). In this instance, have students represent what it would look like if they stopped on a stair for a very long time. This establishes whether they understand how graphing spectra is a representation of a real situation that occurs with light (as opposed to motion, distance or some other variable). It also establishes whether students can apply what they have learned in a different context. Ask students to come up with their own "real-world" graphs, and ask volunteers to explain their graphs to the class.

Activity Extensions

Continue the spectroscopy unit by completing the associated, "Using Spectral Data to Explore Saturn and Titan" activities.


Fisher, Diane. "Taking Apart the Light." "The Technology Teacher." March 2002.


Laboratory for Atmospheric and Space Physics, University of Colorado at Boulder


© 2007 by Regents of the University of Colorado.

Supporting Program

Laboratory for Atmospheric and Space Physics (LASP), University of Colorado Boulder


The contents of this digital library curriculum were developed under a grant from the Fund for the Improvement of Postsecondary Education (FIPSE), U.S. Department of Education, and National Science Foundation GK-12 grant no 0338326. However, these contents do not necessarily represent the policies of the Department of Education or National Science Foundation, and you should not assume endorsement by the federal government.

Last modified: August 10, 2017