Jump to main content

Satellite Collision Detection: A Hands-On Coding Experience

Abstract

Have you ever wondered what would happen if two satellites crashed into each other in space? While space may seem empty, Earth’s orbit is actually crowded with satellites and debris. In this project, you’ll step into the role of a space engineer, using real satellite data to model orbits, track their movement, and predict potential collisions. You’ll explore how gravity and speed affect a satellite’s movement and learn how scientists use simple math and code to prevent real-life space disasters. With interactive simulations and real-world examples, this project gives you a hands-on look at how we keep satellites - and the technology we rely on - safe in space. 

Summary

Areas of Science
Difficulty
Method
Time Required
Average (6-10 days)
Prerequisites

None

Material Availability

Readily available

Cost
Very Low (under $20)
Safety

No issues

Credits
Hannah James, Cornell University

This publication was supported by an agreement with Cornell University, under Prime Agreement MCS2107‑23‑01 from the Department of Defense, Office of Local Defense Community Cooperation. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the author(s) and do not necessarily reflect the views of Cornell University nor those of Sponsor.

Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Objective

In this project, you will use real satellite tracking data and Python code to simulate orbits, calculate collision risks, and visualize satellite paths in 3D. You’ll learn how small changes in orbital parameters can prevent or cause potential satellite collisions.

Introduction

Space is vast and expansive, but Earth’s orbit is becoming increasingly crowded with satellites, space debris, and active spacecraft. Collisions in space aren't just theoretical problem—they've already happened, creating thousands of debris pieces that threaten future space missions. One of the most well-known satellite on satellite collisions occurred on February 10, 2009, when an Iridium-33 communications satellite and the inactive Russian Cosmos-2251 satellite collided over Siberia, generating a massive cloud of debris, shown in Figure 1. 

Figure 1. Iridium 33 constellation and collision debris clouds post-collision with Cosmos-2251. Operational Iridium satellites are shown by the green lines, spare satellites, which are satellites positioned in orbit ready to replace failed units if needed, are shown by the blue lines, and inactive satellites are shown by the red lines. Post-collision debris from Iridium 33 is shown by the light blue dots, and debris from Cosmos 2251 is shown by the orange dots.

The following is an animation of the 2009 collision between Iridium 33 and Cosmos 2251. The blue represents Iridium 33 and the orange is Cosmos 2251. The lines are their paths, solid dot is the satellite, and arrows are the resulting debris after the collision.

With thousands of satellites already in orbit and more launching every year, space agencies must actively monitor and predict potential collisions. Scientists use orbital mechanics, real-time tracking, and collision-avoidance algorithms to keep satellites safe. Understanding how these calculations work is essential for future engineers and space scientists to be able to contribute to and continue this work.

As mentioned above, to predict and avoid satellite collisions, we rely on orbital mechanics, which describes how objects move in space under the influence of gravity. The motion of satellites is governed by Newton’s Law of Universal Gravitation, which states that any two masses exert an attractive force on each other:

Equation 1:

where:

Since Earth’s gravity constantly pulls satellites inwards, they need to travel at a precise speed to stay in orbit. One that is fast enough to counteract that pull and avoid falling back to Earth. That required speed is known as orbital velocity, which at a given altitude is given by:

where: 

For example, a satellite in low Earth orbit (LEO) (~500 km altitude) must travel at around 7.8 km/s to stay in orbit.

Watch this following video to learn more about orbital mechanics:

In this project, you’ll act as a space engineer using real satellite tracking data to predict and analyze potential collisions. You’ll run simulations, adjust orbital parameters, calculate risk, and visualize satellite paths. Can you detect and prevent the next collision? Let’s find out!

Terms and Concepts

Questions

Bibliography

To learn more about the Iridium 33 and Cosmos 2251 collision and recreate the collison video and figure 1 read the following: 

To learn more about TLE data:

  • Wikipedia contributors. (n.d.). Orbital inclination. Wikipedia.
  • Mahdi, M. C. (2015). Tigrisat orbital motionsimulation and analysis. Journal of Control Engineering and Technology JCET5, 1-8.
  • PE0SAT. (n.d.). Two-Line Elements (TLE). Retrieved April 3, 2025

Materials and Equipment

Computer with internet access

Experimental Procedure

This project follows the Engineering Design Process. Confirm with your teacher if this is acceptable for your project, and review the steps before you begin.

Setting Up the Google Colab Environment

  1. You will need a Google account. If you don't have one, you can create one here.
  2. Download the satellite_collision.ipynb file from Science Buddies. This is the code you will run for this project.
  3. Within your Google Drive, click on ‘MyDrive,’ then create a new folder and rename it “satellite_collision”. Inside the folder, upload the satellite_collision.ipynb file.
  4. Double-click on the satellite_collision.ipynb file. This should automatically open in Google Colab.

Explanation of the Physics Used in the Code

  1. This section explains the physical laws that govern satellite motion. The equations help explain how changes in velocity or altitude affect the simulation’s behavior.
    1. Code block 1a discusses Newton’s Law of Universal Gravitation and Orbital Velocity which were previously mentioned in the introduction section.
    2. Kepler’s Third Law is introduced in this code block:

    3. Altitude, measured in meters, is the value that sets how high above Earth the satellite starts. You can modify this value to simulate different orbital zones:

      1. 500e3 → Low Earth orbit (2,000 km)

      2. 2000e3 → Higher low Earth orbit (2,000 km)
      3. 20000e3 → Medium Earth orbit (20,000 km)

      4. 35786e3 → Geostationary orbit (35,786 km)

    4. Circular orbital speed (m/s) is given by the following equation:

      This formula gives the ideal velocity needed for a stable circular orbit at the given altitude.
    5. You can multiply the circular velocity by different values to simulate non-circular orbits:

      1. 1.1 → 10% faster: Creates an elliptical orbit.

      2. 1.414 → Approx. escape velocity: The satellite leaves Earth's gravitational pull.

      3. 0.8 → Too slow: The satellite falls back to Earth. 

Simulate and Animate a Satellite Orbit 

Here we are going to run a simulation to learn more about the four main types of orbits - circular, elliptical, escape, and crash - as shown by Figure 2.

Figure 2. A 2D visualization of the four main different orbits around Earth. A circular orbit is shown by the green line, elliptical by the purple line, crash orbit by the red line, and an escape orbit by the blue line. The circular orbit is one in which the satellite maintains constant altitude and speed and orbits in a circle due to the balance between Earth's gravitational pull and the satellite's orbital velocity. The elliptical orbit is an elongated circle around Earth, where the satellite’s speed constantly changes. The satellite moves faster when it's closer to Earth and slower when it is farther away, as explained by Kepler's second law. In a crash orbit, the satellite doesn't have enough horizontal velocity to counteract Earth's gravitational pull, causing it to fall to Earth. In contrast, the escape orbit is when the satellite reaches or exceeds escape velocity—the minimum speed needed to overcome Earth's gravitational field—allowing it to break free from orbit entirely and continue traveling into space.

Code block 2 simulates a satellite orbiting Earth using an animation. You can change values like altitude or velocity to simulate different types of orbits (circular, elliptical, crash, or escape trajectory).

You can change altitude which defines the satellite's distance from Earth, and v0 which increases or decreases the satellite's velocity, allowing you to simulate different orbits.

In the simulation, you’ll see a red dot (the satellite) orbiting a blue circle (Earth), with its orbital path traced out in gray. Try adjusting the variables and explore how small changes in speed or position dramatically affect the satellite’s path! For example, increasing altitude creates a larger, slower orbit; increasing velocity stretches the orbit into an ellipse and then once this value hits escape velocity the satellite will break free from Earth's gravitational pull; decreasing velocity leads to a tighter ellipse or even a potential crash orbit scenario.

Simulating and Plotting Real Satellites

  1. Code block 3a doesn't run any code, rather its a text block containing URLs where you can access Two-Line Element (TLE) data for simulating real satellites and debris. The code linked above that you will run has satellite data in it, but you can and should replace this with satellites of your choosing. Here are the URLs that are also shown in the code file:
    1. Satellite TLE data:
      1. https://celestrak.org/NORAD/elements/satnogs.txt
      2. http://mstl.atl.calpoly.edu/~ops/keps/kepler.txt
      3. https://www.amsat.org/amsat/ftp/keps/current/nasabare.txt
      4. https://db.satnogs.org/satellites/
      5. https://celestrak.org/NORAD/elements/gp.php?GROUP=active&FORMAT=tle
    2. Space debris TLE data:
      1. https://celestrak.org/NORAD/elements/gp.php?GROUP=cosmos-1408-debris&FORMAT=tle
      2. https://celestrak.org/NORAD/elements/gp.php?GROUP=fengyun-1c-debris&FORMAT=tle
      3. https://celestrak.org/NORAD/elements/gp.php?GROUP=iridium-33-debris&FORMAT=tle
      4. https://celestrak.org/NORAD/elements/gp.php?GROUP=cosmos-2251-debris&FORMAT=tle
  2. TLE is a standard data format used to describe the orbit of a satellite. Despite the name, a TLE usually comes with three lines: the first is just the name of the satellite, and the next two are lines of numbers that contain the orbital parameters. These parameters include things such as the inclination of the orbit (how tilted it is relative to Earth’s equator), the eccentricity (how stretched or circular the orbit is), and the mean motion (how many times the satellite orbits Earth in one day). Other values describe the satellite’s current position in the orbit and the exact time the data was recorded. To help visualize what these orbital parameters actually represent, take a look at Figure 3.

Figure 3. Visualization of orbital elements. The inclination (i) represents the tilt of the orbit relative to the reference plane (typically Earth’s equator). The longitude of the ascending node (Ω) and argument of periapsis (ω) define the orbit’s orientation in space. The true anomaly (ν) indicates the satellite’s position along the orbital path at a given time. Together, these angles describe both in-plane and out-of-plane components of orbital motion.

You can find up-to-date TLEs for all kinds of satellites, from the International Space Station to space debris, on the websites like CelesTrak linked above. So when you use a TLE in your simulation, you're not just creating a random orbit, you're tracking the actual path of a real satellite!

Code block 3c loads and visualizes the orbits of multiple real satellites in 3D using their TLE data. It works by extracting key orbital parameters from each satellite's TLE, calculating the shape and orientation of the orbit in space, and then plotting it around a 3D model of Earth.

  1. A few important orbital constants are defined:
    1. mu: Earth’s gravitational constant, used to calculate orbital size
    2. r: Earth’s radius (approximate, in km)
    3. D: Length of a sidereal day (the time it takes Earth to rotate once relative to the stars)
  2. The plot_tle() function takes a dictionary of satellites and their corresponding TLEs, calculates each satellite’s orbit, and plots it in 3D. Inside the function, it loops through each satellite in the dataset. For each one, it reads the two TLE lines and begins extracting the relevant information. From the second line of the TLE, the function pulls out key orbital elements:
    1. Eccentricity, which shows how stretched or oval the orbit is
    2. Inclination, the tilt of the orbit relative to Earth’s equator
    3. RAAN (Right Ascension of the Ascending Node), which defines the orbit’s orientation around Earth
    4. Argument of perigee, the point where the satellite is closest to Earth
    5. Mean motion, used to calculate the size of the orbit
    6. Using those orbital values from the TLE, the function first calculates the semi-major axis (the longest radius of the elliptical orbit) and then calculates the semi-minor axis (the shortest radius) and the linear eccentricity (the distance between the center of the orbit and the center of Earth). To orient the orbit correctly in 3D space, the function applies a series of rotations using transformation matrices. The inclination sets the tilt of the orbit relative to Earth’s equator, RAAN (Right Ascension of the Ascending Node) rotates the orbit around Earth’s axis, and the argument of perigee determines where the satellite is closest to Earth within its orbit. Together, these steps turn a flat 2D orbit into a realistic 3D path that shows how the satellite actually moves around Earth.
  3. The code generates 100 points around each satellite’s orbit, rotates them into the correct 3D orientation, and stores them as x, y, z coordinates. These points are then plotted to create each satellite’s orbit path, with labels showing their names. At the center of the plot, a blue wireframe sphere represents Earth. This wireframe uses polar coordinates to create a globe made of grid lines, giving a clear 3D visual without solid shading. At the end, a dictionary of real satellites and their TLEs—covering amateur radio, Earth observation, and university missions—is passed into the plot_tle() function. The result is a full 3D visualization of multiple satellite orbits around Earth. You’ll see a labeled, blue wireframe Earth with accurately shaped and tilted orbital paths based on real-world data. It’s a powerful way to see how just two lines of TLE data can be transformed into a detailed view of how satellites move through space.

Simulating Satellite Collisions

Code Block 4 introduces the concept of satellite collisions by first simulating a hypothetical one. 

  1. In this example, we define three different satellite orbits: one in the XY plane (a circular orbit along the equator), one in the XZ plane (a perpendicular orbit), and one in a 45° inclination tilted plane.
  2. Once you’ve run the code and seen how a collision plays out, you can move on to predicting real ones. Just replace the sample TLE data with two satellites of your choice using the TLE sources linked earlier, and the simulation will show whether those satellites are on a collision course.
    1. To work with real satellites, refer back to:
      1. Code Block 3b: for installing the Skyfield library, which allows you to parse and propagate real satellite orbits from TLE data.
      2. Code Block 3c: for an example of how to load, parse, and plot TLE data using the tle_data dictionary.

Code Block 5b is a satellite collision risk scanner that evaluates how close two real satellites — CAS-4A and CAS-4B — might get to each other. 

  1. It does this by simulating many orbital positions for CAS-4B and estimating collision risk.
  2. Several key functions are used: 
    1. calculate_satellite_positions() gets position and velocity from TLE data using sat.sgp4(),
    2. calculate_relative_position_velocity() subtracts the satellites’ position and velocity vectors to get their relative distance and speed which is key for assessing how close they are and how fast they’re approaching each other,
    3. calculate_distance() finds how far apart they are in space,
    4. estimate_collision_risk() uses that distance and their relative speed to calculate a risk score.
  3. A collision warning is triggered if the distance between the two satellites drops below 10 km. CAS-4A uses real TLE data, whereas CAS-4B is slightly modified by adjusting its Mean Anomaly, which is the angle that indicates where the satellite is along its orbit, starting from the closest point to Earth (perigee). To explore how this affects potential collision risk, the code scans CAS-4B’s Mean Anomaly across a small range (±0.1°), using 1000 small steps. For each step, a new TLE is generated, and the code calculates the positions, velocities, and distance between the satellites. It keeps track of the closest approach found during the scan. After the process, the output shows the Mean Anomaly that resulted in the closest distance, the minimum separation, and a collision risk score where 0 means no risk and 0.5 or higher signals high risk. A graph is also generated showing how the distance changes with Mean Anomaly, with a red line marking the closest point. In this simulation, the satellites come within 1.5342 km at 172.8746°, with a risk score of 0.78, indicating a high chance of collision.
    1. Note: Your results may vary depending on when you run the code, because TLE data is dynamic and reflects current satellite positions. In one example run, the satellites came within 1.5342 km with a risk score of 0.78. On your run, the minimum separation may differ — for example, 0.0119 km with a risk of 0.0044 — and that’s expected.
    2. This analysis highlights how small changes in orbital parameters can dramatically affect close approaches — a key insight in satellite traffic management.
  1. This analysis is crucial for predicting and avoiding satellite collisions because even small changes in Mean Anomaly, which controls a satellite’s position along its orbit, can significantly impact how close two objects come. By scanning this variable, we can pinpoint potential high-risk alignments and take action before a collision occurs.

Code Block 5c scans the real-time orbital positions of multiple satellites using their TLEs. It compares every possible pair and calculates potential collision risks based on their current distance and relative velocity. In the example, we used a set of 12 satellites, but you can replace these with any TLEs you find online using the URLs provided earlier.

For each satellite pair, the output includes:

  1. Propagation status: a numeric code showing if the position and velocity were successfully calculated (0 means success)
  2. Position (r): the satellite’s 3D location in space
  3. Velocity (v): the satellite’s 3D speed and direction
  4. Collision risk: a score indicating how likely the two satellites are to collide

Now it's your time to shine and think like a space engineer!

  1. Code Block 5d sets up a realistic collision scenario between two satellites, S-Net A and S-Net B, by slightly adjusting the Mean Anomaly in the TLE data. The code calculates each satellite’s position and velocity, then finds their distance and relative speed. A collision risk score is also calculated, where a score near 1 means a high chance of collision. If the risk is greater than zero, the simulation applies a small avoidance maneuver—by increasing S-Net A’s speed slightly—and checks whether the new trajectory successfully reduces the risk.
  2. In this scenario, the satellites pass within 1.21 km of each other at a relative speed of 1.32 m/s, resulting in a collision risk score of 0.0004. After applying the maneuver, the score increases slightly to 0.0033, showing that the change wasn’t effective. Now it’s your turn to take over: how would you adjust the maneuver to better avoid a collision? Try changing the direction or amount of the velocity adjustment, or experiment with modifying other orbital elements in the TLE data—such as the Mean Anomaly, Inclination, or RAAN. Even small changes can shift the satellites enough in time or space to reduce the risk of a close encounter.
icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Goals

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Industry, Innovation and Infrastructure: Build resilient infrastructure, promote sustainable industrialization and foster innovation.

Variations

  • Real Satellite Near-Miss: A Practical Case of Collision Prediction

    On February 28, 2024, NASA’s TIMED (Thermosphere Ionosphere Mesosphere Energetics and Dynamics) spacecraft made a close pass by Russia’s Cosmos 2221 satellite, coming within just a few kilometers of each other at an altitude of around 600 km (~373 miles). Although no collision occurred, the event was closely monitored by NASA and the U.S. Department of Defense due to the potential for a high-speed impact that could have created thousands of debris fragments. TIMED, launched in 2001, is a scientific satellite studying the influence of the Sun and human activity on the upper atmosphere. Cosmos 2221, launched in 1992, is a retired Russian military satellite that is no longer operational and cannot maneuver—essentially acting as uncontrolled space debris. With neither satellite able to maneuver, the risk of collision during their close approach was significantly higher.

    Code Block 6a simulates and visualizes this event using real TLE (Two-Line Element) data for both satellites.

    1. It converts the TLEs into SGP4 satellite models using Satrec.twoline2rv(), then runs a simulation from 00:00 to 03:00 UTC on February 28, 2024, with 1-second resolution (10,800 steps).
    2. Each timestamp is converted into Julian Date format using jday(), which is required for propagation.
    3. The result is a graph showing the changing distance between TIMED and Cosmos 2221 over time, with the X-axis representing time (UTC) and the Y-axis showing distance in kilometers.
    4. A red dashed line marks the moment of closest approach.
    5. The output reports this closest approach at 01:34:12 UTC, with a minimum separation of just 3.2748 km.

    This type of analysis is critical for space situational awareness (SSA), helping scientists and space agencies detect, evaluate, and respond to high-risk conjunctions in Earth orbit.

    Data Sources:
    NASA Blog – TIMED Close Pass
    NASA Blog – Passes Safely

    https://www.space-track.org/#/gp

  • Try changing the inclination of one satellite to see how the tilt of its orbit affects the likelihood of a collision.
  • What happens if you increase the number of satellites in your simulation? Does it raise the overall collision risk?
  • Replace one of the satellites with space debris TLE data — how does debris influence collision prediction?
  • Can you modify the orbital altitude to simulate different types of orbits, like low Earth orbit vs. geostationary?

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Many aspects of peoples' daily lives can be summarized using data, from what is the most popular new video game to where people like to go for a summer vacation. Data scientists (sometimes called data analysts) are experts at organizing and analyzing large sets of data (often called "big data"). By doing this, data scientists make conclusions that help other people or companies. For example, data scientists could help a video game company make a more profitable video game based on players'… Read more
Career Profile
Are you interested in developing cool video game software for computers? Would you like to learn how to make software run faster and more reliably on different kinds of computers and operating systems? Do you like to apply your computer science skills to solve problems? If so, then you might be interested in the career of a computer software engineer. Read more
Career Profile
Humans have always longed to fly and to make other things fly, both through the air and into outer space—aerospace engineers are the people that make those dreams come true. They design, build, and test vehicles like airplanes, helicopters, balloons, rockets, missiles, satellites, and spacecraft. Read more

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

James, Hannah. "Satellite Collision Detection: A Hands-On Coding Experience." Science Buddies, 18 June 2025, https://www.sciencebuddies.org/science-fair-projects/project-ideas/SpaceEx_p057/space-exploration/satellite-collision-tracking. Accessed 4 June 2026.

APA Style

James, H. (2025, June 18). Satellite Collision Detection: A Hands-On Coding Experience. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/SpaceEx_p057/space-exploration/satellite-collision-tracking


Last edit date: 2025-06-18
Top
Free science fair projects.