Skip to content

Real-time celestial object tracker with GoTo capability for Arduino

License

Notifications You must be signed in to change notification settings

alancarter10/Arduino-StarTracker-Goto

Repository files navigation

readme.md

⭐ Go-To StarTracker

DIY Astronomical Pointing and Tracking System for Arduino

Quick Start

Don't know how to use Git? No problem!

  1. 📦 Click the green "Code" button → "Download ZIP"
  2. Extract the file to your computer
  3. Open Startracker_Goto_Demo_ITA or Startracker_Goto_Demo_ENG with Arduino IDE
  4. 📚 Install SiderealPlanets library (see below)
  5. ⚙️ Configure observer coordinates in the code
  6. ⬆️ Upload to Arduino Mega 2560
  7. 🔍 Open Serial Monitor (9600 baud)

Description

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.

How It Works in Brief

J2000 Coordinates (RA/Dec)
↓
Precession Correction (not applied to planets)
↓
Current Epoch Coordinates
↓
Alt-Az Conversion + Refraction
↓
Motor Steps (Go-To & Tracking)

Main Features

  • 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

How It Works

Operational Flow

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

Test Modes

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

Validation with Stellarium

The system has been validated by comparing results with Stellarium.

Validation examples (Stellarium screenshots with Arduino output):

  • ESEMPIO 1 - Aldebaran → Sirius
  • ESEMPIO 2 - Aldebaran → Mars
  • ESEMPIO 3 - Saturn → Sirius
  • ESEMPIO 4 - Saturn → Mars
  • Example Tracking OUTPUT - Tracking Saturn → Sirius

Requirements

Hardware

  • Arduino Mega 2560 (required for RAM memory)

Software

  • Arduino IDE 1.8.x or higher (or Arduino IDE 2.x)
  • SiderealPlanets Library - GitHub

📥 Installation

1. Download the Project

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

2. Install Dependencies

Open Arduino IDE:

Sketch → Include Library → Manage Libraries
Search: "SiderealPlanets" → Install

3. Open the Sketch

  • Italian Version: Open Startracker_Goto_Demo_ITA.ino
  • English Version: Open Startracker_Goto_Demo_ENG.ino

4. Basic Configuration

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)

5. Example Selection

Uncomment ONLY ONE line:

#define ESEMPIO 1  // Aldebaran → Sirius
//#define ESEMPIO 2  // Aldebaran → Mars
//#define ESEMPIO 3  // Saturn → Sirius
//#define ESEMPIO 4  // Saturn → Mars

6. Upload to Arduino

Sketch → Upload (Ctrl+U)

7. Open Serial Monitor

Tools → Serial Monitor (Ctrl+Shift+M)
Baud Rate: 9600

📚 Object Catalog

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) - -

Adding New Objects

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
};

Implemented Algorithms

1. Equatorial Precession (J2000 → Date)

(not applied to planets)

Coordinate conversion from standard epoch J2000.0 to observation date using Lieske formulas.

2. Equatorial → Horizontal Conversion

RA/Dec to Altitude/Azimuth transformation based on SiderealPlanet:

  • Local Sidereal Time
  • Observer latitude
  • Other

3. Atmospheric Refraction

Correction for altitudes >5°:

R = 1.02 / tan(Alt + 10.3/(Alt + 5.11)) [arcmin]

4. Angular Normalization

  • Altitude: Limited to ±90° (-5400 ↔ +5400 arcmin)
  • Azimuth: Modulo 360° (0 ↔ 21600 arcmin, shortest path)

5. Fraction Accumulation

Accumulation of fractional residuals for maximum precision:

accumulatedFraction += stepsDecimal - (int)stepsDecimal;
if (accumulatedFraction >= 1.0) {
  extraSteps = (int)accumulatedFraction;
  stepsToMove += extraSteps;
  accumulatedFraction -= extraSteps;
}

📊 System Limits

Parameter Value
Max Altitude +90° (5400 arcmin)
Min Altitude -90° (-5400 arcmin)
Azimuth Range 0-360° (21600 arcmin)
Tracking Update 2 seconds

Troubleshooting

System doesn't compile

Problem: Error SiderealPlanets.h: No such file

Solution: Install the SiderealPlanets library from Library Manager

Wrong coordinates

Problem: Objects are not found correctly

Solution:

  1. Verify observer coordinates (Lat/Long)
  2. Verify coordinates in J2000 epoch
  3. Check time zone (TZ)
  4. Verify date/time in the code

Serial Monitor shows nothing

Problem: Blank screen

Solution: Set Baud Rate to 9600

Memory error

Problem: Low memory available, stability problems may occur

Solution: Use Arduino Mega 2560 (the Nano has insufficient memory)

Roadmap (development possibilities)

  • 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

Credits

  • SiderealPlanets Library: David Armstrong
  • Project Author: Giovanni Muggiolu
  • Inspiration: "Evolution of a mechanical star tracker that couldn't do GoTo"

License

This project is released under the MIT license. See the LICENSE file for complete details.

Contacts

⭐ Support the Project

If this project has been useful to you:

  • ⭐ Give a star on GitHub
  • 🐛 Report bugs or issues
  • 💡 Propose improvements
  • 📣 Share with other enthusiasts!

About

Real-time celestial object tracker with GoTo capability for Arduino

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages