A dual-axis solar tracking system that automatically follows the sun's position to maximize solar panel efficiency using Arduino, servo motors, and light sensors.
This project implements an intelligent solar tracking system that uses multiple Light Dependent Resistors (LDRs) to detect the sun's position and automatically adjusts the solar panel orientation using servo motors. The system includes both horizontal and vertical tracking capabilities, plus individual petal control for optimal light capture.
- Arduino Uno/Nano - Main microcontroller
- 5x Servo Motors - For panel positioning and petal control
- 1x Horizontal tracking servo (Pin 6)
- 1x Vertical tracking servo (Pin 7)
- 3x Petal control servos (Pins 8, 9, 10)
- 3x Light Dependent Resistors (LDRs) - Light sensing
- LDR A (Analog Pin A0)
- LDR B (Analog Pin A1)
- LDR C (Analog Pin A2)
- Resistors - For LDR voltage dividers
- Jumper wires and breadboard
- Solar panel (optional for testing)
- Dual-axis sun tracking - Horizontal and vertical movement
- Multi-point light detection - Three LDR sensors for accurate positioning
- Intelligent petal control - Individual servo control for panel segments
- Safety limits - Prevents mechanical damage with movement boundaries
- Real-time adjustment - Continuous 10ms update cycle
- Automatic initialization - Sets optimal starting positions
Horizontal Servo → Digital Pin 6
Vertical Servo → Digital Pin 7
Petal Servo A → Digital Pin 8
Petal Servo B → Digital Pin 9
Petal Servo C → Digital Pin 10
LDR A → Analog Pin A0
LDR B → Analog Pin A1
LDR C → Analog Pin A2
- Connect all servo motors to external 5V power supply
- Connect Arduino to USB or external power
- Ensure common ground between Arduino and servo power supply
- Arduino IDE (1.8.0 or higher)
- Servo Library (usually pre-installed)
- Clone or download this repository
- Open
PROJECT1.inoin Arduino IDE - Connect your Arduino to computer via USB
- Select correct board and port in Arduino IDE
- Upload the code to your Arduino
- Wire components according to circuit diagram
- Test system in sunlight or with bright light source
- Light Detection: Three LDRs continuously measure light intensity
- Position Calculation:
clock = ldrB - ldrC(horizontal difference)counterclock = ldrA - ldrCver = ldrC - (ldrA + ldrB)/2(vertical difference)
- Movement Decision: Servo adjusts based on light intensity differences
- Safety Bounds: Movement limited to prevent mechanical damage
- Horizontal Tracking: Moves panel left/right following sun's path
- Vertical Tracking: Adjusts panel tilt angle throughout day
- Petal Control: Individual segment positioning for optimal exposure
// Horizontal limits (degrees)
servohLimitHigh = 175
servohLimitLow = 5
// Vertical limits (degrees)
servovLimitHigh = 60
servovLimitLow = 1
// Petal limits (degrees)
servoclimithigh = 150
servoclimitlow = 100// Threshold for movement trigger
if (difference > 25) // Adjust for sensitivityProblem: Servos not moving
- Check power supply connections
- Verify servo pin attachments
- Ensure adequate power supply (servos need 5V, high current)
Problem: Erratic movement
- Adjust sensitivity threshold (currently 25)
- Check LDR connections and lighting conditions
- Increase delay time for slower response
Problem: Limited range of motion
- Verify movement limits in code
- Check for physical obstructions
- Ensure servos are properly calibrated
- Tracking Accuracy: ±2 degrees
- Response Time: 10ms update cycle
- Operating Range:
- Horizontal: 170° (5° to 175°)
- Vertical: 59° (1° to 60°)
- Power Consumption: ~1.5A at 5V (all servos active)
- Add weather protection sensors
- Implement WiFi connectivity for remote monitoring
- Add data logging for performance analysis
- Include battery backup system
- Add LCD display for status information
- Implement sleep mode for energy conservation
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or suggestions, please open an issue on GitHub.
⭐ If you found this project helpful, please give it a star!