Skip to content

an arduino project to implement a star-tracker for astrophotography, built around a NEMA-17 stepper motor

License

Notifications You must be signed in to change notification settings

berrytechnics/nema-space-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NEMA-17 Space Tracker - Deep Space and Planetary Object Tracking

Component Links

Overview

This project implements a versatile star tracker for astrophotography using an Arduino Nano (ATmega328P-based), a NEMA 17 stepper motor, and an A4988 stepper motor driver. The system is designed to counteract Earth's rotation, allowing for long-exposure photographs of both deep space objects and planets. It's powered by a LiPo battery and uses voltage converters for efficient power management. The tracker features two SPDT switches for easy configuration:

  1. NS Switch: Selects between Northern and Southern hemisphere tracking.
  2. TARGET Switch: Toggles between deep space object and planetary tracking rates.

Hardware Requirements

  • Arduino Nano (ATmega328P-based)
  • NEMA 17 bipolar stepper motor
    • 59Ncm (83.6oz.in) holding torque
    • 1.65"x1.65"x1.89" 4-wire
    • Rated current: 2.0A
    • Resistance: 1.4ohms
  • A4988 Stepper Motor Driver
  • 3S LiPo battery (11.1V nominal, 7000mAh capacity)
  • Buck converter (to step down battery voltage for Arduino Nano and A4988 logic)
  • 2x SPDT switches (for NS and TARGET selection)
  • Appropriate wiring and connectors

Power Management

  • The 3S LiPo battery (11.1V nominal) powers the entire system.
  • A buck converter is used to step down the battery voltage to 5V for the Arduino Nano and the A4988 driver's logic circuitry.
  • The A4988 driver is powered directly by the battery for the motor control.

Software Dependencies

  • Arduino IDE
  • AccelStepper library

Pin Configuration

Component Arduino Nano Pin
STEP D3
DIR D2
MS1 D5
MS2 D6
MS3 D7
ENABLE D8
NS Switch D4
TARGET Switch D9

Setup Instructions

  1. Install the AccelStepper library in your Arduino IDE.
  2. Connect the A4988 driver to the Arduino Nano as per the pin configuration table.
  3. Connect the NEMA 17 stepper motor to the A4988 driver.
  4. Set up the power system:
    • Connect the LiPo battery to the buck converter input.
    • Connect the buck converter output (set to 5V) to the Arduino Nano's VIN and GND pins.
    • Connect the battery directly to the VMOT and GND pins of the A4988 driver.
    • Connect the 5V output from the buck converter to the VDD pin of the A4988 driver.
  5. Connect the SPDT switches:
    • NS Switch: Connect the common terminal to Arduino Nano pin D4, one side to GND, and the other to 5V.
    • TARGET Switch: Connect the common terminal to Arduino Nano pin D9, one side to GND, and the other to 5V.
  6. Connect the Arduino Nano to your computer via USB and upload the provided code using the Arduino IDE.

Code Structure

  • setup(): Initializes the stepper motor, sets up microstepping, configures motor speed, and sets up the NS and TARGET switch pins.
  • loop(): Continuously runs the motor at the calculated speed for tracking, checking both switch states to determine direction and tracking rate.

Key Parameters

  • STEP_ANGLE: The step angle of the motor (default: 1.8 degrees)
  • MICROSTEPS: Microstepping configuration (default: 16)
  • GEAR_RATIO: Any additional gearing (default: 1, no additional gearing)
  • EARTH_ROTATION_RATE: Earth's rotation rate in degrees per hour (15.0)
  • PLANET_RATE_ADJUSTMENT: Adjustment for planetary tracking (default set for Jupiter)
  • NS_SWITCH_PIN: The pin number for the North/South hemisphere selection switch (default: 4)
  • TARGET_SWITCH_PIN: The pin number for the deep space/planetary target selection switch (default: 9)

Customization

  • Adjust MICROSTEPS to change the microstepping configuration.
  • Modify GEAR_RATIO if you're using any external gearing.
  • Fine-tune EARTH_ROTATION_RATE for more precise tracking if needed.
  • Adjust PLANET_RATE_ADJUSTMENT for different planets or specific dates.
  • Modify NS_SWITCH_PIN and TARGET_SWITCH_PIN if you connect the switches to different digital pins.

Switch Functionality

  1. NS Switch:

    • HIGH (default): Set for Northern Hemisphere tracking (clockwise rotation)
    • LOW: Set for Southern Hemisphere tracking (counter-clockwise rotation)
  2. TARGET Switch:

    • HIGH (default): Set for deep space object tracking (sidereal rate)
    • LOW: Set for planetary tracking (adjusted rate, default for Jupiter)

Power Consumption and Battery Life

  • Total power consumption: Approximately 5.225W
  • Expected runtime: 12+ hours with the 7000mAh LiPo battery
  • Maximum current draw: Approximately 2.04A at 11.1V

Debugging

The Arduino Nano has a built-in USB-to-Serial converter, making debugging straightforward:

  • Connect the Arduino Nano to your computer via USB.
  • Open the Serial Monitor in the Arduino IDE to view debug output.

The code includes optional serial output for debugging. Open the Serial Monitor in the Arduino IDE to view:

  • Initialization confirmation
  • Steps per hour for sidereal and planetary tracking
  • Current position, hemisphere, and target type (printed every 10 seconds during operation)

Safety Considerations

  • Ensure proper cooling for the A4988 driver.
  • Adjust the current limit on the A4988 to match your motor's specifications.
  • Use caution when handling LiPo batteries. Follow proper charging and storage procedures.
  • Ensure the buck converter is properly set to 5V output before connecting to the Arduino Nano and driver.
  • Secure all switches and connections to prevent accidental changes during operation.
  • When connecting the Arduino Nano, be careful not to apply more than 5V to its I/O pins to avoid damage.

Future Improvements

  • Implement a user interface for real-time speed adjustments and planet selection.
  • Add support for more precise planetary tracking rates based on date and time.
  • Integrate limit switches for safety.
  • Implement a "park" position for easy setup and takedown.
  • Add a battery monitoring system to prevent over-discharge.
  • Develop a mobile app for remote control and monitoring.
  • Design a custom shield or PCB for the Arduino Nano to create a more compact and robust setup.

Contributing

Contributions to improve the code or extend its functionality are welcome. Please submit pull requests or open issues on the project repository.

License

This project is licensed under the MIT License with an additional attribution requirement. See the LICENSE file for details.

Copyright (c) [2024] [J. Kyle Berry]

Permission is granted to use, copy, modify, and distribute this software for any purpose with or without fee, provided that the above copyright notice and this permission notice appear in all copies, and that clear and visible credit is given to the original author in any use, distribution, or modification of this software.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

About

an arduino project to implement a star-tracker for astrophotography, built around a NEMA-17 stepper motor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages