An indicator device reads "receiving"


In this intermediate-level programming activity, students will learn about light, mirrors, and optics while modeling a new technique NASA is using to communicate with spacecraft. Students will use microdevices along with light and mirrors to build a relay that can send information to a distant detector and program their detector to indicate when data is being received.



  • This activity requires intermediate-level knowledge of programming languages. Students should be familiar with how to block code external sensors or import libraries for external sensors using Python.
  • Reiterate safe practices when using laser pointers with students. Implementing a rule such as, “Laser pointers should never leave the table,” can help prevent behavior issues. Low-powered lasers are sufficient.
  • Consider keeping groups smaller than usual for this activity – no more than three students per group – if materials allow for it. This will keep all students engaged. Clearly defined student roles, such as programmer, optical engineer, and relay construction/positioning, may also help with participation.


Communicating with spacecraft across the solar system means sending data over enormous distances, with travel times limited by the speed of light. Presently, we communicate with spacecraft via light in the form of radio waves. To send and collect spacecraft data – such as commands, images, measurements, and status reports – we use a system called the Deep Space Network – an array of antennas located in the United States, Spain, and Australia. These arrays, situated about 120 degrees apart, allow us to keep in constant communication with distant spacecraft as Earth rotates. The Deep Space Network is one of two networks in NASA's SCaN, or Space Communications and Navigation, program.

NASA experts talk about the system of antennas that make up the Deep Space Network and how it's used to communicate with distant spacecraft and collect science. | Watch on YouTube

Infographic showing the electromagnetic spectrum and applications for various wavelengths.

This diagram shows wavelengths of light on the electromagnetic spectrum and how they're used for various applications. Image credit: NASA | + Expand image

This artist's concept shows what a new antenna dish capable of supporting both radio wave and laser communications, will look like when completed at the Deep Space Network's Goldstone, California, complex. Image credit: NASA/JPL-Caltech | + Expand image

However, as space exploration advances, the Deep Space Network needs to communicate with an ever-increasing number of active missions collecting more and more data. The increasing volume and complexity of data is outpacing the number of radio antennas in the network. So engineers at NASA’s Jet Propulsion Laboratory are exploring the use of a different frequency of light for spacecraft communications.

While the speed of light is constant, it is possible to change the frequency of light at which data is received so that more information can be transmitted per second. Over the years, NASA has increased the frequency at which data is sent from spacecraft. This is because at higher frequencies, the beam that comes from the spacecraft’s antenna is narrower and more of the transmitted energy is focused on the Earth antenna.

In fact, switching from the longer wavelengths of radio to the shorter wavelengths of visible light increases this effect. Using visible light, the frequency increases as much as 10,000-fold, which could result in 100 times more data being transmitted. This new form of spacecraft communication, called Deep Space Optical Communications, will use a focused beam of light to transmit information.

While the optical beam is more effective at maintaining its strength over greater distances than radio waves, it will require very fine directional positioning to accurately reach its target. A relay system made up of small satellites, or CubeSats, could help by serving as a pathway of intermediary nodes, directing the beam to its target. NASA already piloted deep space optical communications between Earth and the Moon, and there are plans to test it again during the Psyche mission, launching in 2022.


Setup and Programming

  1. Using the desired microdevice (LEGO, Raspberry Pi, Cubit, etc.) have students begin by assembling a simple light sensor. Depending on your students’ background knowledge, this may entail using block code or the Python programming language.
  2. Attach and program an indicator that indicates when a signal from the original light beam is being received by the sensor. Sample codes for both Python and block code are provided below but will vary by device.

    Python Example

    Block Code Example

  3. Collage of images showing a red laser pointing at a mirror, the laser hitting a sensor, and a indicator device reading 'receiving'

    Image credit: NASA/JPL-Caltech | + Expand image

    Collage of images showing a red laser pointing at a mirror, the laser hitting a sensor, and a indicator device reading 'receiving'

    Students will program a microdevice to indicate when a beam of light is received by a sensor and experiment with adding multiple mirrors to the system. Image credit: NASA/JPL-Caltech | + Expand image

    Animated image showing a laser aiming at a sensor until an indicator reads 'receiving'

    Slight movements of the laser pointer can make it difficult to get a successful reading from the indicator. Image credit: NASA/JPL-Caltech | + Expand image

  4. Test the detection code and the threshold for triggering the receiver. Revise the code to be certain that the signal is received above the baseline of light in the classroom only.

Constructing the Relay

  1. Introduce only one mirror to act as a reflective relay between the light beam and the receiver. Have students familiarize themselves with how even slight movements of the laser pointer will result in difficulty aiming the beam at the sensor.
  2. Ensure that the threshold of the light sensor is still satisfactory. Revise as necessary.
  3. Introduce a second and third relay mirror to the system. Have students document how the intensity of light changes, if at all, as more and more relays are incorporated. Increase the distance between relays and repeat these observations. Does a device with more relays closer together or fewer relays farther apart capture more light?


  • What are the advantages and disadvantages of radio waves and focused light beams? How did those challenges play out in designing the relay?
  • What are the advantages and disadvantages of having multiple relays between the source of the beam and the sensor? Consider more than just the experiment at hand. How would this be implemented in communications between Earth and Mars? Jupiter? Beyond?


  • Refer to the engineering rubric.
  • Have students communicate how they isolated their light sensor apparatus to pick up the beam from the laser pointer and not just ambient light in the classroom.
  • Incorporate peer reviews for the design and code of the microdevices as part of the assessment to promote student cross-communication.


  • Consider differentiation strategies for tailoring the difficulty of the assignment – perhaps by varying the distance between the relay and the sensor, changing the number of relays, and even adding physical obstacles that must be circumvented.
  • The difficulty can be further increased by having students consider the movement of planets as they orbit the Sun. How can relays be placed to ensure information can be transmitted regardless of where two planets are relative to each other and the Sun?
  • If your students are familiar with lenses and optics, try including lenses in addition to mirrors. Have students explain how their beam is affected when passing through various materials. Does it help or hinder in delivering the light beam to its target? How could actual relays draw upon these effects to communicate with us back on Earth?

Related Lessons

Explore More