This guide will help you set up your ESP32 to serve the interactive solar system presentation with LED control functionality.
- ESP32 DevKit V1 (recommended) or similar
- USB cable for programming
- 8x LEDs (representing the 8 planets)
- 8x 220-330Ω resistors (current limiting resistors for LEDs)
- Breadboard or PCB
- Jumper wires
- Optional: LED holders or housings
- Mercury (Pin 2): White/Silver LED
- Venus (Pin 4): Yellow/Orange LED
- Earth (Pin 5): Blue LED
- Mars (Pin 18): Red LED
- Jupiter (Pin 19): Orange/Brown LED
- Saturn (Pin 21): Yellow LED
- Uranus (Pin 22): Light Blue/Cyan LED
- Neptune (Pin 23): Dark Blue LED
-
Install Arduino IDE (version 1.8.x or 2.x)
- Download from: https://www.arduino.cc/en/software
-
Install ESP32 Board Package
- Open Arduino IDE
- Go to File → Preferences
- In "Additional Board Manager URLs" add:
https://dl.espressif.com/dl/package_esp32_index.json - Go to Tools → Board → Board Manager
- Search for "ESP32" and install "ESP32 by Espressif Systems"
-
Install Required Libraries
- Go to Tools → Manage Libraries
- Install the following libraries:
- WebServer (usually comes with ESP32 package)
- SPIFFS (usually comes with ESP32 package)
- WiFi (usually comes with ESP32 package)
-
Install ESP32 SPIFFS Uploader Plugin
- Download from: https://github.com/me-no-dev/arduino-esp32fs-plugin
- Extract to your Arduino IDE tools folder:
- Windows:
C:\Users\{username}\Documents\Arduino\tools\ESP32FS\tool\esp32fs.jar - Mac:
~/Documents/Arduino/tools/ESP32FS/tool/esp32fs.jar - Linux:
~/Arduino/tools/ESP32FS/tool/esp32fs.jar
- Windows:
- Restart Arduino IDE
ESP32 Pin Component Connection
========= ========= ==========
3.3V Breadboard Positive rail
GND Breadboard Negative rail
Pin 2 LED 1 (Mercury) Cathode via 220Ω resistor to GND
Pin 4 LED 2 (Venus) Cathode via 220Ω resistor to GND
Pin 5 LED 3 (Earth) Cathode via 220Ω resistor to GND
Pin 18 LED 4 (Mars) Cathode via 220Ω resistor to GND
Pin 19 LED 5 (Jupiter) Cathode via 220Ω resistor to GND
Pin 21 LED 6 (Saturn) Cathode via 220Ω resistor to GND
Pin 22 LED 7 (Uranus) Cathode via 220Ω resistor to GND
Pin 23 LED 8 (Neptune) Cathode via 220Ω resistor to GND
-
Power Rails: Connect ESP32 3.3V to breadboard positive rail, GND to negative rail
-
For Each LED:
- Connect LED anode (+, longer leg) to ESP32 GPIO pin
- Connect LED cathode (-, shorter leg) to one end of 220Ω resistor
- Connect other end of resistor to breadboard negative rail (GND)
-
Double Check:
- Ensure all connections are secure
- Verify resistor values (220-330Ω)
- Check LED polarity (longer leg = positive)
- Open
planets_esp32.inoin Arduino IDE - Modify WiFi credentials at the top of the file:
const char* ssid = "YOUR_WIFI_SSID"; // Replace with your WiFi name const char* password = "YOUR_WIFI_PASSWORD"; // Replace with your WiFi password
- Connect ESP32 to your computer via USB
- Select Board:
- Go to Tools → Board → ESP32 Arduino → "ESP32 Dev Module"
- Select Port:
- Go to Tools → Port → Select your ESP32 port (usually shows as "CP210x" or "Silicon Labs")
- Set Upload Speed:
- Tools → Upload Speed → 921600 (or 115200 if upload fails)
- Upload Code:
- Click Upload button or press Ctrl+U
- Wait for "Hard resetting via RTS pin..." message
-
Prepare Data Folder:
- Make sure the
data/folder contains:index.htmlscript.jsstyle.cssimages/folder with all planet images
- Make sure the
-
Upload to SPIFFS:
- With ESP32 still connected
- Go to Tools → ESP32 Sketch Data Upload
- Wait for upload to complete (may take several minutes)
- You should see "SPIFFS Image Uploaded" when done
-
Open Serial Monitor:
- Tools → Serial Monitor
- Set baud rate to 115200
- Reset ESP32 (press EN button)
-
Expected Output:
Connecting to WiFi... .... WiFi connected! IP address: 192.168.1.XXX Testing LEDs... Testing Mercury LED on pin 2 Testing Venus LED on pin 4 ... (all LEDs should light up sequentially) LED test complete! Web server started -
LED Test: All 8 LEDs should light up in sequence at startup
- Find ESP32 IP Address: Note the IP from Serial Monitor
- Open Web Browser: Go to
http://192.168.1.XXX(replace with your ESP32's IP) - Test Functionality:
- Navigate through slides using arrow buttons
- LEDs should light up for planet slides (slides 2-9)
- No LEDs for intro, conclusion, or "how I made this" slides
| Slide | Planet | LED Pin | Expected Behavior |
|---|---|---|---|
| 1 | Intro | None | All LEDs off |
| 2 | Mercury | Pin 2 | Mercury LED on |
| 3 | Venus | Pin 4 | Venus LED on |
| 4 | Earth | Pin 5 | Earth LED on |
| 5 | Mars | Pin 18 | Mars LED on |
| 6 | Jupiter | Pin 19 | Jupiter LED on |
| 7 | Saturn | Pin 21 | Saturn LED on |
| 8 | Uranus | Pin 22 | Uranus LED on |
| 9 | Neptune | Pin 23 | Neptune LED on |
| 10 | Conclusion | None | All LEDs off |
| 11 | How Made | None | All LEDs off |
- Problem: ESP32 not connecting to WiFi
- Solutions:
- Check WiFi credentials are correct
- Ensure WiFi network is 2.4GHz (ESP32 doesn't support 5GHz)
- Try moving closer to router
- Check for special characters in WiFi password
- Problem: Code upload fails
- Solutions:
- Hold BOOT button while clicking upload
- Try different upload speed (115200)
- Check USB cable (use data cable, not charge-only)
- Install CP210x or CH340 drivers
- Problem: LEDs don't light up
- Solutions:
- Check LED polarity (longer leg = positive)
- Verify resistor connections
- Test with multimeter
- Check GPIO pin numbers in code
- Problem: Web files not uploading
- Solutions:
- Ensure ESP32 Sketch Data Upload plugin is installed correctly
- Close Serial Monitor before uploading
- Try uploading sketch first, then SPIFFS data
- Check data folder structure
- Problem: Website loads but LEDs don't respond
- Solutions:
- Check browser console for errors (F12)
- Verify ESP32 IP address
- Try different browser
- Check if JavaScript is enabled
Your ESP32 also exposes these helpful endpoints:
GET /status- Returns current LED status and ESP32 infoGET /led/planet?slide=X- Control LEDs by slide number (X = 1-11)GET /led/on?planet=X- Turn on specific planet LED (X = 0-7)GET /led/off- Turn off all LEDs
planets/
├── planets_esp32.ino # Main Arduino sketch
├── data/ # SPIFFS upload folder
│ ├── index.html # Web presentation
│ ├── script.js # JavaScript with ESP32 communication
│ ├── style.css # Styling
│ └── images/ # Planet images
│ ├── mercury.png
│ ├── venus.png
│ ├── earth.png
│ ├── mars.png
│ ├── jupiter.png
│ ├── saturn.png
│ ├── uranus.png
│ ├── neptune.png
│ └── solar_system_overview.png
├── README.md # This file
└── original files/ # Original presentation files
├── index.html
├── script.js
└── style.css
- Memory Usage: SPIFFS partition uses ~2MB of flash memory
- Response Time: LED control response is typically <100ms
- Concurrent Users: ESP32 can handle 5-10 concurrent web users
- Image Optimization: PNG images are served directly (consider WebP for better compression)
Edit the ledPins[] array in the Arduino sketch:
const int ledPins[8] = {2, 4, 5, 18, 19, 21, 22, 23};- Increase array size
- Add more GPIO pins
- Update planet count
- Modify web interface accordingly
Add PWM control for dimmable LEDs:
analogWrite(ledPins[planetIndex], brightness); // 0-255- Power: ESP32 GPIO pins output 3.3V max, safe for direct LED connection with resistors
- Current: Each GPIO can handle up to 40mA, well within LED requirements
- Heat: LEDs and resistors may get warm during extended use
- Polarity: Always check LED polarity to avoid damage
If you encounter issues:
- Check this troubleshooting section
- Verify all connections
- Check Serial Monitor for error messages
- Ensure all software dependencies are installed
Happy presenting! 🌌🪐