International Space Station Tracker
In this project, I track and display the current location of the International Space Station, and also plot its trajectory over time and display it on an ePaper Display plugged into a Raspberry Pi 4B, aesthetically enclosed in a nice ProtoStax Enclosure for Raspberry Pi B+/Model 4B, of course! 😊
I get the current location of the ISS using the API exposed by Open-Notify.org - a big shout-out to Nathan Bergey who developed and provided this API using data from Nasa. Thank you Nathan!
In my Python program, I retrieve the location every 30 seconds. The ISS moves at an impressive ~17,400 mph (~28,000 km/h for the rest of the world! ;-) ), and completes an orbit about every 90 minutes, or about 16 orbits in a 24 hour period!
The locations get stored in a list, so I can plot the trajectory over time.
In order to make it visually more interesting and not to overwhelm the user with lots of plot points, the latest (current) location gets plotted as an ISS icon - the rest of the locations get plotted as little circles. Every 15 minute marker is also plotted as a slightly bigger rectangle. This gives you a real visual cue about how fast the ISS is moving - the distance between two rectangular markers is the distance it covers in 15 minutes!
The ISS position is returned in latitude and longitude coordinates. These have to be converted into the XY coordinate system of our ePaper display. The display I use is 264 pixels by 176 pixels, as aspect ratio of 6:4, like a standard photograph. World maps, unfortunately, do not have that aspect ratio. You also want to make sure that when the world map is rendered, plotting the lat/long will put it on the correct region of the map.
I found a vector map with latitude and longitude lines (so I knew plotting data would be more accurate on this map) and that also was reasonably close to the ePaper Display's aspect ratio. I resized the map and also converted it into monochrome BMP to display on the ePaper - the final size as 264 x 181. Since the ISS doesn't fly over the South Pole, I was ok with truncating this map a little bit to fit it into the 264x176 display.
I wrote a function to map the latitude/longitude into this XY coordinate system (264x181), using some simple algebra to figure out the mapping equations. I leave that as an exercise for you!
So you see, there's a bit of nuance in getting and mapping the ISS location data onto our little ePaper display. As with my other projects, the goal is to explore and learn a bit more than meets the eye, and the project also ends with some suggestions on taking it further along to learn more and have fun along the way!
You can find the project with full details at the ProtoStax Project Hub. Here is a direct link to the project -
Happy Making! 😊
Sridhar Rajagopal & The ProtoStax Team 😊
PS - We're happy that this project got featured in issue 96 of the MagPi Magazine for Raspberry Pi - https://www.raspberrypi.com/news/international-space-station-tracker-the-magpi-96/ - check it out there! 😊