DIY Astronomical Pointing and Tracking System for Arduino
Don't know how to use Git? No problem!
- 📦 Click the green "Code" button → "Download ZIP"
- Extract the file to your computer
- Open
Startracker_Goto_Demo_ITAorStartracker_Goto_Demo_ENGwith Arduino IDE - 📚 Install SiderealPlanets library (see below)
- ⚙️ Configure observer coordinates in the code
- ⬆️ Upload to Arduino Mega 2560
- 🔍 Open Serial Monitor (9600 baud)
Go-To StarTracker is a system that calculates Alt-Az coordinates of celestial objects (stars, planets, galaxies, nebulae) in real-time, applies necessary corrections (precession, atmospheric refraction) and converts them into motor steps to automatically reach and track targets.
Based on Arduino Mega 2560 and the SiderealPlanets library by David Armstrong.
J2000 Coordinates (RA/Dec)
↓
Precession Correction (not applied to planets)
↓
Current Epoch Coordinates
↓
Alt-Az Conversion + Refraction
↓
Motor Steps (Go-To & Tracking)
- Precession Correction: Automatic coordinate update from J2000 to observation date
- Atmospheric Refraction: Automatic correction for objects >5° altitude
- Automatic Pointing (Go-To): Reaches target starting from reference star/planet
- Astronomical Tracking: Continuous tracking with Earth rotation compensation
- Planet Support: Real-time calculation of Venus, Mars, Jupiter, Saturn
- Star Catalog: 10 preloaded objects (expandable)
- Sub-Arcminute Precision: Fraction management for maximum accuracy
1. SETUP
└─> Catalog Loading (preset but modifiable)
└─> Observer Configuration (Lat/Long)
└─> Object A (Reference) and B (Target) Selection
2. ALIGNMENT
└─> Manual pointing to Object A (e.g., Sirius)
└─> System acquires reference position
3. GO-TO
└─> Angular difference calculation A→B
└─> Conversion to motor steps
└─> Fast movement to target
4. TRACKING
└─> Coordinate update every 2 seconds
└─> Earth movement compensation
└─> Object kept centered
The software includes 4 preconfigured examples:
| Example | Object A | Object B | Description |
|---|---|---|---|
| 1 | Aldebaran | Sirius | Star → Star |
| 2 | Aldebaran | Mars | Star → Planet |
| 3 | Saturn | Sirius | Planet → Star |
| 4 | Saturn | Mars | Planet → Planet |
The system has been validated by comparing results with Stellarium.
Validation examples (Stellarium screenshots with Arduino output):
ESEMPIO 1- Aldebaran → SiriusESEMPIO 2- Aldebaran → MarsESEMPIO 3- Saturn → SiriusESEMPIO 4- Saturn → MarsExample Tracking OUTPUT- Tracking Saturn → Sirius
- Arduino Mega 2560 (required for RAM memory)
- Arduino IDE 1.8.x or higher (or Arduino IDE 2.x)
- SiderealPlanets Library - GitHub
Direct download:
- Click the green "Code" button → "Download ZIP"
- Extract the ZIP file to your computer
- You'll find the .ino files ready to open
Open Arduino IDE:
Sketch → Include Library → Manage Libraries
Search: "SiderealPlanets" → Install
- Italian Version: Open
Startracker_Goto_Demo_ITA.ino - English Version: Open
Startracker_Goto_Demo_ENG.ino
Modify these parameters in the .ino file:
Observer Coordinates
// Example: Pisa, Italy
static const int LatDegrees = 43;
static const int LatMinutes = 42;
static const int LatSeconds = 30;
static const int LongDegrees = 10;
static const int LongMinutes = 24;
static const int LongSeconds = 12;Time Zone
static const int TZ = 1; // GMT+1 (winter) or GMT+2 (summer)Object Selection
int Oggetto_M_A = 2; // Reference object (1-10, e.g., Aldebaran)
int Oggetto_M_B = 5; // Target (1-10, e.g., Sirius)Uncomment ONLY ONE line:
#define ESEMPIO 1 // Aldebaran → Sirius
//#define ESEMPIO 2 // Aldebaran → Mars
//#define ESEMPIO 3 // Saturn → Sirius
//#define ESEMPIO 4 // Saturn → MarsSketch → Upload (Ctrl+U)
Tools → Serial Monitor (Ctrl+Shift+M)
Baud Rate: 9600
| ID | Name | RA (J2000) | Dec (J2000) |
|---|---|---|---|
| 1 | Arcturus | 14h 16m 50s | +19° 03' 05" |
| 2 | Aldebaran | 04h 35m 57s | +16° 30' 31" |
| 3 | Rigel | 05h 14m 34s | -08° 12' 05" |
| 4 | Betelgeuse | 05h 55m 12s | +07° 24' 26" |
| 5 | Sirius | 06h 45m 08s | -16° 43' 27" |
| 6 | Procyon | 07h 39m 17s | +05° 13' 04" |
| 7 | Andromeda | 00h 42m 44s | +41° 16' 09" |
| 8-10 | (expandable) | - | - |
Modify the datiStellari[] array in the .ino file:
DatiStellari datiStellari[numRighe] = {
// ... existing objects ...
{ 8, "M31", 0, 42, 44.3, 0, 42, 44.3 }, // Example: M31
};(not applied to planets)
Coordinate conversion from standard epoch J2000.0 to observation date using Lieske formulas.
RA/Dec to Altitude/Azimuth transformation based on SiderealPlanet:
- Local Sidereal Time
- Observer latitude
- Other
Correction for altitudes >5°:
R = 1.02 / tan(Alt + 10.3/(Alt + 5.11)) [arcmin]
- Altitude: Limited to ±90° (-5400 ↔ +5400 arcmin)
- Azimuth: Modulo 360° (0 ↔ 21600 arcmin, shortest path)
Accumulation of fractional residuals for maximum precision:
accumulatedFraction += stepsDecimal - (int)stepsDecimal;
if (accumulatedFraction >= 1.0) {
extraSteps = (int)accumulatedFraction;
stepsToMove += extraSteps;
accumulatedFraction -= extraSteps;
}| Parameter | Value |
|---|---|
| Max Altitude | +90° (5400 arcmin) |
| Min Altitude | -90° (-5400 arcmin) |
| Azimuth Range | 0-360° (21600 arcmin) |
| Tracking Update | 2 seconds |
Problem: Error SiderealPlanets.h: No such file
Solution: Install the SiderealPlanets library from Library Manager
Problem: Objects are not found correctly
Solution:
- Verify observer coordinates (Lat/Long)
- Verify coordinates in J2000 epoch
- Check time zone (TZ)
- Verify date/time in the code
Problem: Blank screen
Solution: Set Baud Rate to 9600
Problem: Low memory available, stability problems may occur
Solution: Use Arduino Mega 2560 (the Nano has insufficient memory)
- OLED interface for coordinate display
- Joystick/numeric keypad control
- Extended star catalog (Messier, NGC)
- RTC support for automatic date/time
- Observation logging on SD card
- SiderealPlanets Library: David Armstrong
- Project Author: Giovanni Muggiolu
- Inspiration: "Evolution of a mechanical star tracker that couldn't do GoTo"
This project is released under the MIT license. See the LICENSE file for complete details.
- Email: plutonenano@libero.it
- GitHub: @alancarter10
- Repository: StarTracker-Goto-System
If this project has been useful to you:
- ⭐ Give a star on GitHub
- 🐛 Report bugs or issues
- 💡 Propose improvements
- 📣 Share with other enthusiasts!