Dual-Axis Solar Tracker with Arduino (USB Power)




Description
This project is a 3D-printed dual-axis solar tracker designed to automatically follow the direction of the strongest light and improve the positioning of a solar panel throughout the day.
The system uses four LDR light sensors to detect differences in light intensity. An Arduino Nano continuously compares the sensor readings and controls two 28BYJ-48 stepper motors through ULN2003 driver boards. One motor controls the left-right (horizontal) movement, while the second motor controls the up-down (vertical) movement of the solar panel.
☀️ Solar Charging & Battery System
The project also includes a DD05CVSA 5V charging/discharging module.
The solar panel is connected to the DD05CVSA module, which is used to charge the 3.7V lithium-ion batteries and provide a regulated 5V output.
This means the project not only tracks the light but can also collect and store solar energy in the batteries. The stored energy can then be used to power 5V electronics or provide a 5V USB output for charging devices such as a smartphone, depending on the available solar power and battery capacity.
🔧 Main Components
* Arduino Nano (ATmega328P)
https://s.click.aliexpress.com/e/_c4KzBS6n
https://s.click.aliexpress.com/e/_c399CB3H
* Arduino Nano Screw Terminal Adapter
https://s.click.aliexpress.com/e/_c30C7TI3
https://s.click.aliexpress.com/e/_c3wqpbDD
* 4× GL5528 LDR Photoresistors
https://s.click.aliexpress.com/e/_c3tW6cD
https://s.click.aliexpress.com/e/_c2ywi7zt
* 4× 4.7 kΩ Resistors
https://s.click.aliexpress.com/e/_c3xPswob
https://s.click.aliexpress.com/e/_c3N2CNhD
* 2× 28BYJ-48 5V Stepper Motors
https://s.click.aliexpress.com/e/_c4sEexwj
https://s.click.aliexpress.com/e/_c3yEijth
* 2× ULN2003 Stepper Motor Driver Boards
https://s.click.aliexpress.com/e/_c4lzrkkF
* DD05CVSA 5V Li-ion Charger & Boost Module
https://s.click.aliexpress.com/e/_c4q09P8P
https://s.click.aliexpress.com/e/_c3JyQgCx
* 2× 3.7V 16340 Li-ion Batteries
https://s.click.aliexpress.com/e/_c4rpP2s7
* 6V 250mA Solar Panel – 165 × 65 mm
https://s.click.aliexpress.com/e/_c35G8G1l
https://s.click.aliexpress.com/e/_c32Xxu6r
* USB-C Connector
https://s.click.aliexpress.com/e/_c416sKVz
https://s.click.aliexpress.com/e/_c3CwIjqx
* SPST ON/OFF Switch – 2 Pin
https://s.click.aliexpress.com/e/_c2RoraQX
* Quick Wire / Spring Clamp Connectors
https://s.click.aliexpress.com/e/_c4ecZTJd
https://s.click.aliexpress.com/e/_c3CDw9KL
* Dupont Jumper Wires
https://s.click.aliexpress.com/e/_c4MYwOEX
https://s.click.aliexpress.com/e/_c3hh8bab
* Heat-Shrink Tubing
https://s.click.aliexpress.com/e/_c4cwlmlV
https://s.click.aliexpress.com/e/_c3smhJ27
* Electrical Tape
https://s.click.aliexpress.com/e/_c3gi9Bfd
* Hot Glue
https://s.click.aliexpress.com/e/_c3a8esEP
https://s.click.aliexpress.com/e/_c3532OUF
* M2 Screws
https://s.click.aliexpress.com/e/_c3ytLSJZ
* M3 Screws
https://s.click.aliexpress.com/e/_c3cHxI43
https://s.click.aliexpress.com/e/_c3pF5VWF
⚙️ How It Works
The four LDR sensors continuously measure the light coming from different directions. The Arduino Nano compares these readings and determines where the strongest light is coming from.
The two stepper motors then adjust the solar panel in two axes until the light levels become balanced. This allows the panel to automatically orient itself toward the strongest light source.
At the same time, the solar panel can supply energy to the DD05CVSA module, which charges the lithium battery. The stored energy can later be used through the module's 5V output.
💻 Arduino Code
The complete Arduino Nano code used for this project is available at the link below:
[Download the Arduino Code ]
https://bambu3design.com/dual-axis-solar-tracker-arduino-nano-code/
🎥 Assembly & Wiring Tutorial
The complete assembly process, including 3D-printed part assembly, motor installation, wiring, electronics setup, and testing, is shown in the YouTube video below:
https://www.youtube.com/watch?v=5CMzQj_E_dU
🖨️ 3D Printing
All mechanical parts were designed for 3D printing. The printable files required to build the solar tracker can be downloaded directly from this MakerWorld model page.
A fun project combining 3D printing, Arduino, electronics, solar energy, battery charging, and automatic dual-axis tracking in one build.