- Amazon Link - A4988 Stepper Motor Driver
- Amazon Link - NEMA 17 Stepper Motor
- Amazon Link - Arduino Nano (ATmega328P)
- Amazon Link - 3S LiPo Battery
- Amazon Link - Buck Converter
- Amazon Link - SPDT Switches
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:
- NS Switch: Selects between Northern and Southern hemisphere tracking.
- TARGET Switch: Toggles between deep space object and planetary tracking rates.
- 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
- 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.
- Arduino IDE
- AccelStepper library
Component | Arduino Nano Pin |
---|---|
STEP | D3 |
DIR | D2 |
MS1 | D5 |
MS2 | D6 |
MS3 | D7 |
ENABLE | D8 |
NS Switch | D4 |
TARGET Switch | D9 |
- Install the AccelStepper library in your Arduino IDE.
- Connect the A4988 driver to the Arduino Nano as per the pin configuration table.
- Connect the NEMA 17 stepper motor to the A4988 driver.
- 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.
- 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.
- Connect the Arduino Nano to your computer via USB and upload the provided code using the Arduino IDE.
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.
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)
- 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
andTARGET_SWITCH_PIN
if you connect the switches to different digital pins.
-
NS Switch:
- HIGH (default): Set for Northern Hemisphere tracking (clockwise rotation)
- LOW: Set for Southern Hemisphere tracking (counter-clockwise rotation)
-
TARGET Switch:
- HIGH (default): Set for deep space object tracking (sidereal rate)
- LOW: Set for planetary tracking (adjusted rate, default for Jupiter)
- Total power consumption: Approximately 5.225W
- Expected runtime: 12+ hours with the 7000mAh LiPo battery
- Maximum current draw: Approximately 2.04A at 11.1V
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)
- 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.
- 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.
Contributions to improve the code or extend its functionality are welcome. Please submit pull requests or open issues on the project repository.
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.