Idea to Build: An ESP32 NASA Desk Display With Asteroid Flybys, Fireballs and Space Weather on a 2.8 Inch TFT - Compoden

Idea to Build: An ESP32 NASA Desk Display With Asteroid Flybys, Fireballs and Space Weather on a 2.8 Inch TFT

NASA publishes a lot of its data through open web APIs: today's asteroid flybys, natural events on Earth, solar storms, fresh photos of the whole planet, even fireballs burning up in the sky. I wanted all of that on my desk, on a little screen that just keeps flipping through it.

So I described the idea to Soldr: an ESP32 with a 2.8 inch ILI9341 TFT that joins Wi-Fi and shows NASA data. Soldr designed it, picked the parts, drew the wiring and wrote the firmware. A few rounds of "now add this" later it was a six-page dashboard running on my bench. Here's how it went together.

Soldr wiring diagram: ESP32-DevKitC driving a 2.8 inch ILI9341 TFT on GPIO18 SCK, GPIO23 MOSI, GPIO19 MISO, GPIO5 CS, GPIO4 DC and GPIO13 RESET, VCC and LED on 3V3

What you need

Soldr's first plan was just four parts: the ESP32, the TFT, jumper wires and a USB cable, all matched to the catalog. I added the OLED later and used a breadboard to keep it tidy.

Step 1: Wire it up

The diagram above is straight from Soldr's Wiring tab. The TFT talks SPI to the ESP32:

TFT pin ESP32
VCC 3V3
GND GND
LED (backlight) 3V3
SCK GPIO18
SDI (MOSI) GPIO23
SDO (MISO) GPIO19
CS GPIO5
DC GPIO4
RESET GPIO13

The optional OLED goes on I2C:

OLED pin ESP32
VCC / GND 3V3 / GND
SDA GPIO21
SCL GPIO22
Address 0x3C

A few notes so it works the first time:

  • Everything runs on 3.3V. The ILI9341 board and the SSD1306 both take 3.3V logic, so they connect straight to the ESP32 with no level shifter. Power the board from its micro-USB port.
  • CS, DC and RESET can move. On my bench I had the TFT on CS 4, DC 16 and RESET 17. I told Soldr which pins I'd actually used and it kept them in every later version of the code. SCK, MOSI and MISO stay on the ESP32's hardware SPI pins (18, 23, 19).
  • Leave the touch and SD pins alone. The 2.8 inch board has touch (T_) and SD_ pins on the other header. This build doesn't use them.

The six pages

  1. Asteroids: today's 5 closest flybys from NASA's NeoWs feed, with name, size in metres, miss distance in lunar distances and speed.
  2. Earth events: the 5 latest open natural events from EONET (wildfires, storms, volcanoes), title and category.
  3. Space weather: coronal mass ejections and geomagnetic storms from the last 3 days, from DONKI. The night I filmed it, everything was quiet.
  4. Earth from space: the date of the latest EPIC full-disk image, how many were taken that day, and the centre point.
  5. Fireballs: the 4 most recent fireballs from the JPL fireball API, with date, impact energy and location.
  6. Exoplanets: the confirmed count from the NASA Exoplanet Archive as one big number. It read 6,464 the day I shot it.

How it works

  • The pages flip every 15 seconds, and each feed is fetched at most once every 30 minutes, so the board makes only about 8 requests an hour.
  • If one feed fails, that page says "Feed unavailable" and the rest keep running. The failed feed is retried after 60 seconds.
  • NeoWs and DONKI need an api.nasa.gov key. DEMO_KEY works for a first test but is capped at 30 requests an hour, so sign up for your own key. EONET, EPIC, the fireball feed and the exoplanet count don't use it.
  • The OLED was a later add-on, one more message to Soldr. It shows a short text summary of the current page.

What happened on the bench

It didn't all work on the first flash, and that part is worth telling:

  1. First flash: the fireball and exoplanet pages worked straight away, but the four bigger feeds (10 KB and up) showed "Feed unavailable - Bad JSON".
  2. I told Soldr exactly that, in plain words. It rewrote the shared fetch code to download each response completely before parsing it with a filter, kept my pins and settings, and added the 60 second retry.
  3. Reflashed from Soldr, and all six pages came up with live data.

Step 2: Flash it

  1. In the Arduino IDE, install the esp32 board package and choose ESP32 Dev Module. Install Adafruit GFX Library, Adafruit ILI9341, Adafruit SSD1306 and ArduinoJson (7.x) from Library Manager.
  2. Put your Wi-Fi name, password and api.nasa.gov key into the settings lines at the top of the sketch Soldr gives you. Use a 2.4 GHz network.
  3. Upload, then watch the screen: the first round of feeds takes a little while, then the pages start rotating.

How Soldr designs this from the idea

Want a page for something else, say the ISS position or a picture of the day? Describe it at soldr.ai. Soldr designs hardware from the idea: it asks which board you want, picks parts from the Compoden catalog, assigns the pins, gives you the wiring diagram and writes the firmware, then compiles it for your board. You can keep talking to it, like I did here, to add a screen or fix a problem. For this one the idea was simply a NASA data display for my desk on an ESP32 and a 2.8 inch TFT.

Not affiliated with or endorsed by NASA. Just a very nice set of open data that looks great on a desk.

Back to blog

Open this project in the Soldr app → What is Soldr.ai → parts, wiring and code for what this guide builds