Sunflower (Solar Light Tracker With Arduino)

by GoldenBoy in Design > 3D Design

3243 Views, 43 Favorites, 0 Comments

Sunflower (Solar Light Tracker With Arduino)

WhatsApp Image 2026-01-21 at 19.54.55.jpeg
4.jpeg


This project consists of the development of an automatic solar light tracker based on Arduino, designed to orient a set of solar panels toward the direction of maximum light intensity in an autonomous way.

The system uses four light dependent resistors (LDRs) arranged in a quadrant configuration to detect the direction of incoming light. Based on these readings, an Arduino Uno microcontroller controls two servo motors, allowing movement on two axes (horizontal and vertical) in order to maximize solar energy capture.

One of the main features of this project is that the system is self-powered using solar energy. The energy generated by the solar panels is stored in 18650 batteries connected in series, managed by a 2S BMS that provides protection and charge control. In addition, a DC-DC LM2596 buck converter is used to regulate the voltage and ensure a stable power supply for both the Arduino and the actuators.

This project was carried out by Cristian Montesino and Pedro J. López, students of Electronic Systems Engineering at the University of Málaga, as part of their practical training in electronic systems and renewable energy. This Instructable describes the different stages of the development process, from initial design and prototyping to final assembly and testing.

Supplies

This section lists all the components used in the construction of the solar light tracker. The materials are grouped by function to make the assembly process easier.

Control electronics:


  1. 1 × Arduino Uno. Microcontroller responsible for processing sensor signals and controlling the actuators.
  2. 4 × LDR (Light Dependent Resistors). Used to detect light intensity from different directions.
  3. 4 × 10 kΩ resistors. Used together with the LDRs to form voltage dividers for analog readings.


Actuators:


  1. 2 × Servo motors (SG90 or MG90). 1 servo for horizontal movement and 1 servo for vertical movement. These allow the solar panels to be oriented on two axes.


Power generation and storage system:


  1. 5 × Solar panels (2 V – 120 mA). Connected in series to reach a suitable charging voltage.
  2. 2 × 18650 batteries (3.7 V). New or recycled, connected in series (2S configuration).
  3. 1 × 2S battery holder.
  4. 1 × 2S BMS (Battery Management System). Provides protection against overcharge, over-discharge and short circuits.


Voltage regulation and stability:


  1. 1 × LM2596 DC-DC Buck Converter. Used to reduce the battery voltage (≈7.4 V) to stable 5 V for the servos.
  2. 1 × Electrolytic capacitor (1000 µF – 25 V). Installed on the 5 V line to absorb current peaks and stabilize servo operation.


Additional materials:


  1. Electrical wires / Dupont cables.
  2. Breadboard or perforated board.
  3. Screws and mounting hardware.
  4. Soldering kit (including tin and flux).
  5. Silicon gun.
  6. 3D printer.

Initial Cardboard Prototype

12.jpeg
15.jpeg

Before building the final version of the solar tracker, an initial cardboard prototype was designed and assembled. The main goal of this stage was to validate the mechanical design quickly and at low cost, before working with final materials and electronic components.

This prototype made it possible to test several key aspects of the project:

  1. The general structure layout
  2. Two-axis movement (horizontal and vertical)
  3. Servo motor rotation range
  4. Solar panel orientation and support.
  5. Required space for the components.

Cardboard was chosen due to its ease of cutting and assembly, allowing fast modifications. During this phase, different servo positions were tested and potential stability and weight distribution issues were analyzed.

Thanks to this initial prototype, several design improvements were identified before moving to the final version, such as reinforcing certain areas of the structure and optimizing the rotation system to avoid mechanical interference.

This stage was essential to ensure correct operation of the final solar tracker and helped reduce errors during the final assembly.

Final Design and Tracker Structure

bbbbbb.jpeg

After validating the general concept with the cardboard prototype, the final structural design of the solar tracker was developed. The conclusions obtained during the prototyping phase were taken into account, improving stability, weight distribution and component placement.

The final design allows two-axis movement:

  1. Horizontal axis, responsible for tracking lateral light movement.
  2. Vertical axis, responsible for adjusting the tilt of the solar panels.

Both movements are driven by servo motors, strategically placed to transmit motion efficiently and reduce unnecessary mechanical stress.

As a starting point, the mechanical design was based on an existing 3D solar tracker model available online (URL 3D design). This base model provided a solid reference for the general structure and movement concept. From this initial design, several modifications and improvements were made, adapting the geometry to the specific requirements of the project, the selected components and the power system. As a result, new custom parts were designed, using the original model as a foundation but evolving it into a personalized solution.

During this stage, the following aspects were defined:

  1. The base structure, providing stability.
  2. The movable support for the solar panels.
  3. Servo placement, ensuring sufficient rotation without collisions.
  4. Space for electronics and power components, allowing easy access.

The final design integrates all components correctly and ensures smooth and precise tracking behavior, while remaining simple and modular for future improvements.

With the structure defined, the project was ready to move on to the integration of the light sensors and the electronic system.

Light Sensors (LDR) and Illumination Detection

18.jpeg
2.jpeg

In order for the solar tracker to correctly orient itself toward the strongest light source, four light-dependent resistors (LDRs) were used. These sensors allow the measurement of light intensity and convert this information into electrical signals that can be processed by the Arduino.

The LDRs were placed in a quadrant configuration, so that each one detects light from a different direction. This arrangement makes it possible to compare the readings between sensors and determine in which direction the system should move to align itself with the light source.

Each LDR was connected together with a 10 kΩ resistor, forming a voltage divider. The output of each divider was connected to an analog input of the Arduino, allowing values proportional to the received light intensity to be obtained.

The operation of the detection system is based on comparing the sensor readings:

  1. If one LDR receives more light than the others, the system adjusts the position of the servos to orient itself in that direction.
  2. When the readings are balanced, the system considers that the panels are correctly aligned.

This method provides a simple and effective solution for light tracking, without the need for complex calculations or additional sensors. In addition, it allows smooth and progressive tracking behavior.

Once the light sensors are defined and connected, the project is ready to integrate the solar power supply and energy storage system.

Solar Power Supply and Energy Storage System

3.jpeg
5.jpeg
6.jpeg

To enable autonomous operation, a solar-based power supply system was implemented.

The system uses five 2 V / 120 mA solar panels connected in series, providing sufficient voltage to charge the battery system.

The generated energy is stored in two 18650 batteries connected in series (2S), providing a nominal voltage of approximately 7.4 V. A 2S BMS was included to ensure safe operation.

The BMS provides:

  1. Overcharge protection.
  2. Over-discharge protection.
  3. Short-circuit protection.

This allows the batteries to be safely charged directly from the solar panels.

Voltage Regulation and Servo Power Supply

WhatsApp Image 2026-01-21 at 21.57.24.jpeg
7.jpeg
WhatsApp Image 2026-01-11 at 12.29.48.jpeg

Once energy generation and storage had been defined, the next step was to ensure a stable power supply for all system components, especially for the servo motors, which can demand current peaks when starting or changing position.

The two 18650 batteries connected in series provide an approximate voltage of 7.4 V, which is too high to directly power the Arduino and the servos on a 5 V line. For this reason, an LM2596 DC-DC buck converter was used.

LM2596 converter:


The LM2596 was adjusted to provide a stable 5 V output, required to safely power the system. This regulation is essential to prevent:

  1. Arduino resets caused by voltage drops.
  2. Erratic servo movements.
  3. Overheating or damage due to incorrect voltage levels.


Capacitor for startup current peaks:


To improve electrical stability, a 1000 µF, 25 V electrolytic capacitor was added to the 5 V line. This component acts as a “fast energy reserve” and helps absorb the current peaks typical of servo motors, especially during startup.

This reduces very common problems in servo-based projects, such as:

  1. Sudden voltage drops.
  2. Vibrations or “jerky” movements.
  3. System resets when both servos are activated simultaneously.


Control from the Arduino:


The servo motors are controlled from the Arduino using PWM signals, one for each axis:

  1. Servo 1: horizontal movement.
  2. Servo 2: vertical movement.

In this way, the Arduino can adjust the orientation in real time based on the readings from the LDR sensors, while the power supply remains stable thanks to the regulator and the capacitor.

With voltage regulation and power supply properly defined, the system is ready to be programmed to implement the tracking behavior on the Arduino.

Arduino Programming (light Tracking Logic)

Sunflower first testing with errors

Once the mechanical and electrical assembly was completed, the Arduino Uno programming was carried out. The Arduino is responsible for processing the signals from the light sensors and controlling the movement of the servo motors.

The program is based on a simple and effective logic that allows the system to progressively orient itself toward the source of greatest illumination.

Sensor reading:


The Arduino continuously reads the analog values from the four LDRs, which are connected to the analog inputs. Each reading represents the light intensity received from a specific direction.

These readings are grouped in pairs to detect differences:

  1. Difference between lateral sensors → horizontal movement.
  2. Difference between upper and lower sensors → vertical movement.


Movement calculation:


Based on these differences, the program determines:

  1. Whether the system should rotate to the left or to the right.
  2. Whether it should tilt upward or downward.

To avoid abrupt movements or vibrations, minimum difference thresholds are established. In this way, the system only moves when the difference in light between sensors is significant.


Servo motor control:


The servos are controlled using PWM signals generated by the Arduino. The servo positions are adjusted incrementally, achieving smooth and continuous movement.

This approach allows the tracker to:

  1. React quickly to changes in lighting conditions.
  2. Maintain a stable orientation when the light is centered.
  3. Avoid unnecessary oscillations.


Additional considerations:


The program also limits the maximum and minimum servo angles to prevent excessive mechanical stress or damage to the structure.

Thanks to this control logic, the system is capable of following the light trajectory autonomously and efficiently.

Final Assembly and Functional Testing

19.jpeg
20.jpeg
4.jpeg

Once all the mechanical, electrical and control elements were integrated, the final assembly of the system was carried out, along with various functional tests to verify the correct operation of the solar tracker.

Final assembly:


During this stage, all components were permanently fixed to the designed structure:

  1. The solar panels were secured to the movable support.
  2. The servo motors were fixed in their final positions, ensuring that rotation was free and without interference.
  3. The electronics (Arduino, BMS, LM2596 and wiring) were neatly organized to avoid cable strain and to facilitate maintenance.
  4. All electrical connections were checked before powering the system.


Electrical testing:


Before putting the system into full operation, basic checks were performed:

  1. Verification of the LM2596 output voltage (stable 5 V).
  2. Verification of the correct operation of the BMS.
  3. Review of the system’s behavior under current peaks.

These tests ensured a stable and safe power supply.


Light tracking tests:


With the system powered, practical tracking tests were carried out:

  1. The system was exposed to a moving light source.
  2. It was verified that the solar panels oriented themselves correctly toward the area of greatest illumination.
  3. Smooth servo movement and the absence of vibrations or blockages were confirmed.

The system responded progressively and stably, adjusting its orientation until the sensor readings were balanced.


Results:


The tests confirmed that the solar tracker operates autonomously, maintaining an appropriate orientation toward the light source and taking advantage of the energy generated by the solar panels themselves.

Final Result and Conclusions

Arduino Sunflower

The final result is a fully functional solar light tracker, capable of automatically orienting itself toward the source of greatest illumination using light sensors and an Arduino-based control system.

The system demonstrates that it is possible to combine solar energy, control electronics, and mechanical actuators to create a self-sufficient and efficient solution. Thanks to the use of a solar power supply system with batteries and BMS-based management, the project can operate autonomously without the need for an external power source.

Throughout the development of the project, an iterative design process was followed, beginning with an initial cardboard prototype, which made it possible to validate the operation and detect potential improvements before carrying out the final assembly. This methodology reduced errors and facilitated the final integration of all components.

From an academic point of view, this project has made it possible to practically apply concepts related to:

  1. Analog sensors.
  2. Actuator control.
  3. Voltage regulation.
  4. Solar energy and battery management.
  5. Embedded systems programming.

As possible future improvements, the system could be expanded by incorporating:

  1. A tracking system based on time and solar position.
  2. More precise sensors.
  3. Energy generation data logging.
  4. Improvements to the mechanical design using more resistant materials.

Overall, the project meets the proposed objectives and constitutes a solid foundation for future developments related to solar tracking systems and renewable energy.