Dual Axis
Solar Tracker
+ Battery Charging
A complete solar energy solution — dual-axis LDR tracking, 12V panel array, TP5100 charging, 2S BMS protection, and 7.4V battery. Up to 40% more energy capture than fixed mounts.
How the System Works
Four LDR modules with adjustable potentiometers sense directional light intensity. Arduino computes top/bottom and left/right deltas, driving two SG90 servos to keep the panel perpendicular to sunlight. Harvested energy flows through the TP5100 → BMS → battery chain.
Sense
4 LDR modules on A0–A3 read directional light intensity continuously.
Compare
Arduino averages top/bottom and left/right pairs, calculates delta.
Track
If delta exceeds tolerance (90), servo steps toward higher brightness.
Harvest
2 × 6V panels in series → 12V → TP5100 → BMS → 7.4V battery.
Power Management
A complete solar-to-battery chain with protection at every stage. The TP5100 handles the voltage step-down from 12V to 8.4V, while the 2S BMS guards the lithium battery against all common failure modes.
Solar Array
2 × 6V panels in series = 12V output. Feeds directly into TP5100 input.
TP5100 Charger
Converts 12V input to 8.4V for 2S lithium battery charging. Handles up to 2A.
2S 20A BMS
Protects against overcharge, over-discharge, overcurrent, and short circuits.
7.4V Battery
Provides stable power for both servo motors and Arduino via BMS output.
Components Required
Nine components — everything from the 3D-printed frame to the battery protection board.
| Component | Notes | Buy |
|---|---|---|
| Arduino UNO | Main controller | Buy Now |
| SG90 Servo Motors (×2) | Horizontal pin 3, Vertical pin 13 | Buy Now |
| LDR Modules (×4) | With adjustable potentiometer | Buy Now |
| 6V Solar Panels (×2) | In series = 12V | Buy Now |
| TP5100 Charging Module | 12V → 8.4V, up to 2A | Buy Now |
| 2S 20A BMS | Battery protection board | Buy Now |
| 7.4V Li-ion Battery | 2S configuration | Buy Now |
| Breadboard | Power distribution | Buy Now |
| Jumper Wires | M-M and M-F set | Buy Now |
3D Model Files
Download the dual-axis mechanism, servo mounts, panel platform, and mounting brackets. Print at home or order a professional print via JLC3DP.
Pin Connections
Complete wiring table for all components. LDR modules use analog pins A0–A3. Servos on D3 and D13. Power flows from panels → TP5100 → BMS → battery → Arduino VIN.
| Component | Component Pin | Arduino / Destination | Notes |
|---|---|---|---|
| LDR Module — Top Left | AO (Analog Out) | A0 | Analog input |
| LDR Module — Top Right | AO (Analog Out) | A1 | Analog input |
| LDR Module — Bottom Right | AO (Analog Out) | A2 | Analog input |
| LDR Module — Bottom Left | AO (Analog Out) | A3 | Analog input |
| All LDR Modules | VCC | 5V | Arduino 5V rail |
| All LDR Modules | GND | GND | Common ground |
| SG90 Servo — Horizontal | Signal (Orange) | D3 | PWM pin |
| SG90 Servo — Vertical | Signal (Orange) | D13 | PWM pin |
| Both Servos | VCC (Red) | 7.4V Battery | Direct from BMS output — not Arduino 5V |
| Both Servos | GND (Brown) | GND (common) | Shared ground rail |
| 6V Panel 1 + Panel 2 | Series connection | TP5100 IN+ | +12V to TP5100 input |
| Panels (series GND) | Panel 2 negative | TP5100 IN– | Common ground |
| TP5100 | OUT+ (8.4V) | BMS B+ | Charging input to BMS |
| TP5100 | OUT– | GND (common) | Common ground |
| 2S BMS | P+ (output) | Arduino VIN | Powers Arduino |
| 2S BMS | P– (output) | GND (common) | Common ground |
| 7.4V Battery | B1+, B2+ (cells) | BMS cell inputs | Connect per BMS datasheet |
Servo power note: Power the SG90 servos directly from the battery output (via BMS), not from the Arduino 5V pin. Two servos under load can draw 500–800mA which exceeds the Arduino's onboard regulator limit. Share a common GND between Arduino and battery.
Step-by-Step Assembly
3D Print & Mechanical Assembly
Print all components from the provided files. Assemble the dual-axis gimbal mechanism, mount both SG90 servos, and attach the solar panel platform. Verify smooth movement in both axes.
Mount LDR Sensors
Position one LDR module in each quadrant around the panel edge — top-left (A0), top-right (A1), bottom-right (A2), bottom-left (A3). Use the potentiometers to set equal sensitivity.
Connect Servo Motors
Horizontal servo signal → D3, vertical servo signal → D13. Power both servos directly from the BMS 7.4V output, not the Arduino 5V pin. Share common GND.
Wire Solar Panels in Series
Connect Panel 1 positive to Panel 2 negative (series). Panel 1 negative → TP5100 IN–. Panel 2 positive → TP5100 IN+. This gives ~12V input to the charger.
Set Up Charging Chain
TP5100 OUT+ → BMS B+ charging input. TP5100 OUT– → GND. Connect 7.4V Li-ion cells to BMS per its datasheet (cell 1 and cell 2 inputs).
Power the Arduino
BMS P+ output → Arduino VIN. BMS P– → GND common rail. This allows the fully charged 7.4V battery to power the Arduino through its onboard regulator.
Upload Code & Calibrate
Upload the Arduino code. Shine a light from different angles to verify tracking direction. Adjust LDR pot sensitivity if response is sluggish or over-reactive.
Test Battery Charging
Place in sunlight and verify the TP5100 charging LED activates. Check BMS output voltage with a multimeter. Confirm servos respond to light movement.
Assembly & Demo Video
Full assembly walkthrough, power system wiring, LDR calibration, and live sun-tracking demonstration.
Watch for the power chain wiring — especially how the TP5100, BMS, and battery connect together. The video also shows the 3D assembly sequence and LDR sensitivity adjustment.
Arduino Code
Both servos start at 90°. Tolerance of 90 prevents micro-jitter. Movement direction is reversed from the basic tracker to match this mechanism's physical orientation.
#include <Servo.h>
Servo horizontal; // Horizontal Servo Motor
int servohori = 90;
int servohoriLimitHigh = 175;
int servohoriLimitLow = 5;
Servo vertical; // Vertical Servo Motor
int servovert = 90;
int servovertLimitHigh = 175;
int servovertLimitLow = 5;
// LDR module connections
int ldrTopLeft = A0; // Top Left LDR
int ldrTopRight = A1; // Top Right LDR
int ldrBottomRight = A2; // Bottom Right LDR
int ldrBottomLeft = A3; // Bottom Left LDR
void setup() {
horizontal.attach(3); // Horizontal servo on pin 3
vertical.attach(13); // Vertical servo on pin 13
horizontal.write(servohori);
vertical.write(servovert);
delay(2500);
}
void loop() {
int tl = analogRead(ldrTopLeft); // Top Left
int tr = analogRead(ldrTopRight); // Top Right
int br = analogRead(ldrBottomRight); // Bottom Right
int bl = analogRead(ldrBottomLeft); // Bottom Left
int dtime = 10;
int tol = 90; // Tolerance — increase to reduce jitter
// Axis averages
int avt = (tl + tr) / 2; // Top average
int avd = (bl + br) / 2; // Bottom average
int avl = (tl + bl) / 2; // Left average
int avr = (tr + br) / 2; // Right average
int dvert = avt - avd; // Top-bottom difference
int dhoriz = avl - avr; // Left-right difference
// ── Vertical axis (REVERSED for this mechanism) ─────
if (abs(dvert) > tol) {
if (avt > avd) {
servovert = --servovert;
if (servovert < servovertLimitLow) servovert = servovertLimitLow;
} else {
servovert = ++servovert;
if (servovert > servovertLimitHigh) servovert = servovertLimitHigh;
}
vertical.write(servovert);
}
// ── Horizontal axis (REVERSED for this mechanism) ───
if (abs(dhoriz) > tol) {
if (avl > avr) {
servohori = ++servohori;
if (servohori > servohoriLimitHigh) servohori = servohoriLimitHigh;
} else {
servohori = --servohori;
if (servohori < servohoriLimitLow) servohori = servohoriLimitLow;
}
horizontal.write(servohori);
}
delay(dtime);
}
setup()
Both servos initialise to 90° (centre). 2.5 s delay lets servos reach position before tracking begins.
loop()
Reads 4 LDR values, averages axis pairs, checks delta against tolerance (90). Steps servo ±1° per cycle.
Reversed Logic
Movement direction is flipped vs. the basic tracker to suit this 3D-printed mechanism's servo orientation.
Tuning
Increase tol (e.g. 120) to reduce jitter in wind. Decrease for faster response indoors.
Why Choose This Design?
40% Higher Yield
Dual-axis tracking vs fixed panel, all day and all season.
Integrated Charging
Complete power management — panels charge the battery automatically.
Battery Safety
2S BMS prevents overcharge, over-discharge, short circuits.
Precise Tracking
4 LDR modules with individual sensitivity potentiometers.
Dual-Axis
Tracks both daily East–West arc and seasonal elevation changes.
3D Printed
Custom enclosure for durability and professional finish.
Design Your Own PCBs with Altium
For designing a custom solar tracker PCB — integrating Arduino, servo drivers, and BMS monitoring on one board — I use Altium. It makes professional electronics design faster and production-ready.
Students get free access via Altium Student Lab — sign up with your university email for PCB courses and industry certifications.
👉 Start designing with Altium →
Bhery good idea pls thax
ReplyDeleteEl codigo esta muy pobre
ReplyDeletewhere is the circuit diagram? :D
ReplyDeleteazgamar0@gmail.com
Delete