Currently there is no translation for this activity.

Hunting for exoplanets with Arduino

Created: 2025-06-10
Author(s):
Federico Di Giacomo (INAF)
astroedu-2507-img0

Learn how to simulate the search for exoplanets in classroom using an Arduino kit and a few simple components. With a LED representing a star, a rotating sphere as an exoplanet, and a light sensor, students can observe and analyze the brightness variations of this small “planetary system” to understand the transit method, one of the main ways used by scientists to discover exoplanets. The experiment is highly customizable and promotes hands-on learning in physics, astronomy, and programming, offering an interdisciplinary approach to explore complex scientific concepts in an intuitive way.

NOTE: This activity was reviewed and tested during the Italian Teacher Programme Galileo in 2024 by: Caterina Boccato (INAF-Padova); Salvatore La Delfa (IIS “L. Einaudi” Siracusa), Camilla Cervi (IIS Racchetti da Vinci di Crema CR), Domenico Liguori (Liceo Scientifico “Stefano Patrizi” di Cariati -CS-), Ilaria Centazzo(IIS “Torricelli” Maniago), Lidia Ceresara (Liceo Scientifico “E.Majorana” - Capannori (LU)), Marco Oggero (I.I.S. "Sebastiano Grandis" Cuneo), Rosemarie Pirlo “I.T.T. Panetti-Pitagora” - Bari (BA)

Materials

Arduino's kit

  • Two Arduino Uno boards (alternatively you can use any other Arduino board. In the case of an Arduino Mega board one would be enough)
  • About twenty jumper wires (it is recommended to have different colored wires to make it easier to build the circuit)
  • Two mini breadboards (mounting plate for building the circuit)

Electronic components

  • LED (to simulate the star)
  • Stepper motor (for rotation of the sphere)
  • Photoresistor (to measure light intensity)
  • Button (to change the direction of rotation of the planet)
  • Three potentiometers (to adjust, respectively, the speed of the star rotation, the brightness of the LED and the sensitivity of the photoresistor)
  • Power supplies to power each Arduino board
  • SD card reader and micro SD card for storing results

Other materials

  • Lightweight sphere (e.g. a plastic or Styrofoam sphere) to mount on the motor to simulate the exoplanet.
  • Support to fix the sphere (for example a rod or a rotating base)
  • Straw or “L” tube to fix the LED/star
  • Cardboard or wooden supports to support the planetary system and the sensor
  • Pin or end of a toothpick
  • Glue and tape

Tools and software

  • Computer with Arduino IDE software installed (downloadable from the Arduino website)
  • USB cable to connect Arduino to the computer
  • Data visualization software (e.g. Excel or data analysis software)

Supporting material for the experiment

  • Sheets of paper or poster board to record results and create graphs.
  • Any cards with theoretical explanations or guides for using the circuit.
  • Sheets for the final report or for notes during the experiment.

Files to download from the attachments:

  • A zipped folder containing the Exoplanet-code-detector.ino and Exoplanet-code-motor.ino to be downloaded and used with the Arduino boards.
Goals
  • Introducing concepts of astronomy, physics of light and programming in a practical and engaging way.
  • Promoting interdisciplinary work between science, technology and mathematics.
  • Stimulating critical thinking and analysis of experimental data.
  • Stimulating team building.
  • Developing problem-solving skills through the design and implementation of a simulated experiment.
Learning Objectives
  • Learning the basics of planets orbiting other stars and how the transit method is used to detect exoplanets.
  • Understanding what a light curve is, analyzing the variations in light intensity on a graph and connecting them to the passage of an object in front of a light source.
  • Using Arduino to control a mechanical system (stepper motor) and acquire experimental data with a light sensor.
  • Adjusting physical parameters (rotation speed and brightness) and evaluating their impact on the collected data.
  • Applying programming fundamentals to acquire, visualize, and interpret scientific data.
Background

Exoplanets and the transit method

Exoplanets are planets that orbit other stars than the Sun and are detected using various methods. The most common is the transit method, which is based on the observation of a periodic decrease in the brightness of a star, caused by the passage of a planet in front of it (transits). This phenomenon provides fundamental information, such as the size and orbit of the planet.

A-light-curve-showing-the-transit-method-of-deteting-exoplanets

Image 1: the light curve of an exoplanet orbiting around its star. Credits: NASA Ames

The transit method is widely used by space telescopes such as Kepler and TESS. Understanding this process allows students to explore key scientific concepts, including the nature of light, planetary orbits, and data analysis.

This experiment introduces a hands-on simulation of the transit method. Using an Arduino kit, students work with electronic components, such as LEDs (star), stepper motors (orbit), and light sensors (observation), to create a working model. The changes in brightness are recorded and analyzed on a time graph, reproducing the basic principles used by astronomers to detect real exoplanets.

Arduino as an educational tool

Arduino is an open-source electronics prototyping platform developed in 2005 in Ivrea, Italy, by a group of researchers led by Massimo Banzi. Originally created to simplify the teaching of electronics and programming to students, Arduino is now widely used around the world for building interactive projects and conducting scientific experiments. Its ease of use, extensive community support, and wide range of compatible sensors and modules make it ideal for interdisciplinary educational activities involving physics, computer science, engineering, and astronomy. With Arduino, students and teachers can build low-cost scientific experiments, such as the simulation of the transit method for exoplanet detection proposed in this activity

Further reading:

Full Description

Students will construct a model of a planetary system, consisting of a planet orbiting by means of a stepper motor. The system will allow them to vary the planet's speed and direction of rotation.

Part 1: Building the planetary model (duration approx. 30 minutes)

To make the planetary system, take the straw and cut a piece of about 8 - 10 centimetres from it, straddling the folding part (about 3 centimetres before the folding part and the rest after). Using a pin or toothpick, pierce the longest part of the straw and place the sphere that will serve as the planet on it. In order to keep the “L” structure made from the straw as rigid as possible, a small wire can be inserted inside to act as a skeleton. Finally, insert the short end of the straw onto the shaft of the stepper motor as in the following picture

motore

Image 2: example of how the structure simulating the planet was made. A straw was attached to the stepper motor and connected, via a toothpick, to the sphere simulating the planet.

Then we move on to making the electrical connections to connect the planetary system to the Arduino board.

First, connect the stepper motor to its driver, or driver module (connection board supplied with the motor itself), using the appropriate connection system. The stepper motor is a DC synchronous electric motor that allows the rotation to be divided into small angles, or steps. 200 pulses are required to complete one complete revolution. A stepper motor is very precise, fast and easily controlled by means of an electronic board, called a driver. The speed of rotation depends on the waiting time between pulses within the individual rotation cycles. In order to change the speed of rotation of the planetary system, a potentiometer is used, while a button is used to change the direction of rotation.

The attached diagram shows how to make the individual connections. In general, the pins to be connected are:

Engine Driver:

Driver Arduino Board
GND GND
5V 5V
IN1 PIN8
IN2 PIN 9
IN3 Pin 10
IN4 Pin 11

Potentiometer connection:

Potentiometer Arduino Board
Right Pin 5V
Left Pin GND
Central Pin A0

Push-button connection:

Push-button Arduino Board
Right Pin GND
Left Pin Pin 4

The breadboard can also be used to “bridge” the various overlapping connections.

astroedu-2507-motore

Image 3: the circuit of the stepper motor. The numbers on the connection cables indicate the different connections between the Arduino board and the motor driver.

Once the connections have been made, the next step is to load the software onto the Arduino board. This is done through the IDE (Arduino working environment) and can be done as follows. The procedure may change depending on the version of the IDE installed. This description refers to version 2.3.0.

First connect, with the appropriate cable, the Arduino board to the PC where the control and code upload software was previously installed. After opening the Arduino IDE, click on the drop-down menu at the top right of the three circular icons. From here, select the Arduino board (whether Arduino Uno or Arduino Mega or Nano) that you are using and the port (USB or other) to which it is connected. This way the Arduino working environment is ready and you can write and then upload the code for the planet to the board. The code can be downloaded from the attchements (File Exoplanet-code-motor.ino).

To upload the code to the Arduino board, simply click on the upload icon, the second icon from the right. Once this is done, if the connections have been made correctly, the planet should start to rotate, and clicking on the button will change the direction of motion as the potentiometer varies the speed of rotation.

Part 2: construction of the transit detector and star block (duration approx. 30 minutes)

Objective: students will construct the second block of the project consisting of the brightness variation detector, the star with the possibility of varying brightness and the apparatus for storing the data.

A photoresistor (LDR, Light Dependent Resistor) will be used to measure the brightness variation of the planetary system. This is an electronic component whose electrical resistance is inversely proportional to the intensity of the incident light: as the brightness increases, the resistance value decreases, causing more current to flow. This makes it possible to measure the variation in brightness of the “star” as it orbits the “planet” in front of it. To adjust the sensitivity of the photoresistor to ambient light, it will be connected in series to a potentiometer.

The light source (star) will be created by means of a 5 mm white LED, the brightness value of which can be varied via a further potentiometer. By varying the voltage applied via the potentiometer, the light intensity of the LED will change, thus simulating stars with different brightnesses. In this way, it will be possible to observe how the light curves change as the simulated stellar brightness varies.

Experimental data will be collected via an external memory: a microSD card connected to the Arduino via a special read/write module. All brightness variation data will be recorded on a file and can later be analysed using data processing software such as Excel, Matlab or equivalent.

The LED, representing the star, must be positioned at the vertical of the stepper motor's axis of rotation.

The light emitted by the LED must be directed towards the photoresistor, which in turn must be at the same height as the planet mounted on the straw. In this way, it will be possible to correctly detect changes in brightness during rotation.

From a structural point of view, a vertical support made of rigid cardboard can be used, on which the various components can be fixed. In particular:

Photoresistor: Make two small holes in the cardboard, pass the terminals of the photoresistor through them, and attach it to the support using hot glue or adhesive tape.

LED: Use a straw or a small tube fixed vertically to the cardboard above the axis of rotation. The LED will be inserted inside the straw so that it protrudes from the upper end. The LED terminals can be bent to correctly direct the light toward the photoresistor. The electrical connections can be routed inside the straw, keeping the installation tidy and reducing the risk of mechanical interference during movement.

The final fixing of the LED, straw, and wiring can be done with hot glue or strong adhesive tape, ensuring stability during operation.

Below is a description of how to connect the various electronic components to the second Arduino board.

Potentiometer LDR Arduino Board
Left Pin A0
Central Pin GND

One of the two legs of the photoresistor should also be connected to the same A0 pin, while the second leg should be connected to the 5V pin.

Potentiometer LED Arduino Board
Left Pin GND
Central Pin A1
Right Pin 5V

Likewise, the shorter leg of the LED should be connected to the GND pin of the Arduino board, while the longer leg should be connected to pin 5.

Finally, the SD card reader should be connected to the Arduino board according to the following diagram:

SD Card Reader Arduino Board
CS Pin 3
SCK Pin 13
MOSI Pin 11
MISO Pin 12

To make the various connections, a breadboard can be used, also to bridge overlapping connections.

astroedu-2507-fotoresistenza

Image 4: circuit diagram that controls the SD card reader and the LED. The numbers on the connection cables indicate the different connections between the Arduino board and the various components of the circuit.

Once all the connections are complete, the next step is to upload the software to the Arduino board. This is done through the Arduino IDE (Integrated Development Environment) and can be carried out as follows. The procedure may vary depending on the version of the IDE installed. This description refers to version 2.3.0.

First, connect the Arduino board to the PC using the appropriate cable. Make sure the control and code upload software has already been installed on the computer. After opening the Arduino IDE, click on the dropdown menu located at the top right, to the right of the three circular icons. From here, select the Arduino board you are using (whether it's an Arduino Uno, Mega, or Nano) and the port (USB or other) to which it is connected.

At this point, the Arduino development environment is ready, and you can write and upload the code for the project to the board. The code can be downloaded from the attchements of this activity (File Exoplanet-code-detector.ino).

To upload the code to the Arduino board, simply click on the Upload icon, which is the second icon from the right. Once this is done, if all connections have been made correctly, the LED should turn on, and adjusting the potentiometer will vary the brightness of the LED.

astroedu-2507-motore_led_fotoresistenza

Image 5: the simulated star-planet system

Part 3: Light Curve Analysis and Data Collection (Duration: approx. 15 minutes)

Objective:
Analyze the behavior of the transit simulator and observe, using the Arduino Serial Plotter, how light curves vary based on changes in the system’s characteristics:

  • Orbital speed of the planet
  • Direction of rotation
  • Brightness of the star
  • Size of the planet

Once the system assembly is complete, connect the second Arduino (the one connected to the photoresistor) to the computer. The first Arduino, which controls the motor, can be powered separately via a PC connection, a battery, or its dedicated power supply.
After starting the planet’s rotation around the star, open the Arduino IDE and access the Serial Plotter, which is available by clicking the specific icon (the second-to-last on the right in the toolbar).

astroedu-2507-apparato-eng

Image 6: the experimental apparatus that simulates exoplanets transits, with all its parts.

Using the Serial Plotter, you can view in real time the light intensity detected by the photoresistor during rotation. At this point, by varying one parameter at a time using the potentiometers (i.e., the star’s brightness, the planet’s orbital speed, and the photoresistor’s sensitivity), you can observe how each affects the resulting light curves.
It is recommended to change only one parameter at a time while keeping the others constant to precisely analyze the impact of each variation.
During the experiment, it’s advised to take detailed notes for each change, which will be useful for deeper analysis later.

astroedu-2507-grafico

Image 7: example of light curves generated by Arduino

Questions to think about:

  • How does the light curve change when the planet’s rotation speed varies?
  • Does the intensity of the light dip or the period (frequency) of the transits change?
  • If the direction of orbital motion is reversed, does the light curve change? How?
  • When increasing the brightness of the star, how does the amplitude of the light curve change?
  • If a larger planet is used (or simulated by reducing the distance between the LED and the photoresistor), how is the depth of the light curve affected?
  • How does changing the photoresistor’s sensitivity affect the shape of the curve?
  • Which real aspects of the exoplanet transit method are best simulated by this model?
  • What are the main differences between this simulation and actual astronomical observations?

Part 4: Light Curve Analysis and Data Logging (Duration: approx. 30 minutes)

Objective:
Record experimental data to an external memory, import it into data analysis software (such as Excel or MATLAB), and create accurate light curve graphs to analyze the effect of system parameter variations in detail.

After observing the light curves in real time via the Arduino Serial Plotter, you can move on to systematic data collection for deeper analysis.
To do this, a microSD card connected to the Arduino that receives the signal from the photoresistor will be used. The data (i.e., the measured light intensity values over time) will be automatically saved to the card in a .csv file.

Once the recording is complete, remove the microSD card and transfer the data to a computer. The file can now be imported into Excel to construct light curve graphs.

To process the data in Excel:

  1. Open Excel and create a new worksheet.
  2. Go to “File” → “Open” and select the .csv file saved on the SD card.
  3. Once imported, select the time column and the brightness column.
  4. With the data selected, click “Insert” → “Scatter Plot” → “Smooth Lines Scatter Plot”.

The resulting graph will show the variation in brightness over time, i.e., the system’s light curve.

This graph allows for a more precise analysis of how parameter changes affect the system by enabling measurements of periods, amplitudes, minima, and maxima with greater accuracy than visual observation alone.

With more advanced software like MATLAB or Python, you can also import the .csv data and create customized graphs, add filters, highlight transits, or statistically calculate orbital periods.
As described in the previous section, when writing the data to the file, it is recommended to vary only one parameter at a time to isolate each variable’s effect on the light curve shape.

Questions to think about:

  • How does the light curve shape change when the star’s brightness varies?
  • When the planet’s orbital speed changes, does the transit period change? How can this be measured from the graph?
  • If we increase the size of the planet (e.g., by reducing the LED-to-photoresistor distance), how does the curve’s depth change?
  • By reversing the direction of rotation, are there differences in the curve’s shape or symmetry?
  • Are the transits regular? Are there imperfections or noise in the signal? What could cause them?

Additional Exploration:

To make the analysis even more interesting and in-depth, you can vary not only the planet’s position and size but also its shape and physical nature. For this, you can build “planets” using different materials, such as plastic, rubber, or aluminum. An interesting variable to explore is the effect of a soft coating, like cotton or foam, to simulate a planetary atmosphere. This could affect the light’s reflection and scattering, altering the resulting light curves.
For example, a planet covered in soft material might scatter light differently than a fully reflective one made of metal or polystyrene.

The presence of materials with different optical properties (transparency, reflectivity, diffusivity) allows observation of how these affect light measurement and transit shape.
Additionally, by changing the planet’s shape — making it more spherical or irregular — you can analyze the potential effects of a non-symmetric geometry on the brightness variation pattern, simulating various types of celestial bodies, from rocky to gaseous ones.

This approach enables a much more complete and realistic analysis, better reflecting the diversity of exoplanets.

Finally, you can discuss how the data collected and analyzed in the lab relates to real astronomical observations and how accurately this model replicates the transit method used by astronomers to detect exoplanets.

Evaluation

The evaluation should can be done by the teacher on the following aspects:

criterion description score
understanding of scientific concepts Was the student able to explain the transit method and brightness variations? 0-10
technical skills (building the kit and programming) Was the student able to assemble the Arduino kit, connect the components, use the codes? 0-10
data analysis The student was able to correctly interpret the luminositygraphs identifying the transits? 0-10
creativity and problem solving originality in system design and ability to solve practical problems that have arisen 0-5
communication of results quality of the final presentation or report, clarity in the presentation and interpretation of the data 0-5
collaboration and participation ability to work in a group and contribute actively 0-5

Suggested evaluation the total Score: 0-10 = Insufficient; 11-20 = Sufficient; 21-30 = Good;
31-40 = Excellent

Curriculum

This experiment aligns with several subject areas and educational goals within school curricula, particularly in the following disciplines:

Science

  • Study of astronomical phenomena and observation methods (exoplanets, light, and transits)
  • Introduction to the physics of light (intensity, reflection, and absorption)

Technology and Computer Science

  • Use of programming platforms (Arduino IDE) to control hardware devices
  • Development of skills in working with sensors, motors, and electronic circuits

Mathematics

  • Analysis of experimental data (graphs, periodicity, and model interpretation)
  • Calculation of relationships between physical parameters such as speed and brightness

Interdisciplinary Education

  • Deepening of the scientific method through the design, implementation, and evaluation of experiments

Specific Applicability:
In Italy, this activity supports the objectives outlined in PCTO (Pathways for Transversal Skills and Orientation) and strengthens STEM competencies. It also directly relates to the physics, mathematics, and computer science curricula for the final three years of high school.

In other countries, such as the United States, it is compatible with the NGSS (Next Generation Science Standards), which include engineering concepts and Earth and space sciences.