Abstract
How can you get as much power as possible out of a solar panel, even in the morning or evening when the sun is low in the sky? With a solar tracker system! While many solar panels are fixed in place on rooftops or large ground-mounted poles, a solar tracker system is motorized and lets the solar panels track the sun through the sky during the day. Are these systems worth the added complexity? How much more power do they produce? Try this project and find out!
Summary
Previous experience with Arduino is recommended. See our How to Use an Arduino page for tutorials.
A kit is available from our partner Home Science Tools®. See the Materials section for details.
No issues
Objective
Design and build a solar tracker system and evaluate its performance.
Introduction
Solar power is a form of renewable energy that converts sunlight into electricity using solar panels (Figure 1). Solar panels can be mounted on rooftops or on the ground. They can even be mixed into agricultural spaces for livestock or crops using a technique called agrivoltaics (Figure 2).

The amount of electrical power produced by a solar panel depends on the amount of sunlight hitting it. A solar panel will produce maximum power when it is perpendicular to the sun's rays (Figure 3). The sun moves east to west through the sky during the day, so solar panels will produce less power in the morning and evening when the sun is lower in the sky. The sun's position in the sky also changes from north to south throughout the year. Fixed solar panels, like those in Figures 1 and 2, are oriented to maximize the total amount of power that they produce throughout the year. These systems have the advantage of being simple and low-maintenance because they have no moving parts, but they do not produce the maximum possible amount of power.

Solar trackers (Figure 4) are an alternative to fixed-mount systems. These trackers are motorized and move the panels to keep them pointed directly at the sun. Single-axis trackers have a single axis of rotation, usually to track the sun's east-west movement. Dual-axis trackers have two axes of rotation, so they can also track the sun's seasonal north-south movement. These systems will produce more power for a given solar panel size but are more complex and require maintenance since they have moving parts.
In this project, you will design and build your own solar tracker system. The tracker will use two light sensors, called photoresistors, to track the sun. When both sensors are pointed directly at the sun, they will give equal readings, and the servo motor that aims the solar panel will not move. When one sensor is shaded, the motor will rotate until they both give equal readings again. You will also measure the performance of your tracker. One way to do this is to measure the voltage produced by your solar panel. The voltage will be higher when the panel is perpendicular to the sun's rays. You can track how the voltage changes throughout the day for a fixed-mount system and for your tracking system. Do you think the extra complexity of the tracking system is worth it? Try this project and find out!
If you need to learn how to use photoresistors or servo motors with an Arduino before you begin, check out these two videos:
Terms and Concepts
- Solar power
- Renewable energy
- Solar panel
- Agrivoltaics
- Solar tracker
- Single-axis
- Dual-axis
- Light sensor
- Photoresistor
- Servo motor
- Voltage
Questions
- What are the different types of solar trackers?
- What are some advantages and disadvantages of solar trackers?
- What other factors affect a solar panel's output power?
Bibliography
- Wikipedia (n.d.). Solar Tracker. Retrieved July 22, 2024
- Finio, B. (n.d.). How to Use an Arduino. Science Buddies. Retrieved July 22, 2024
Materials and Equipment 
Recommended Project Supplies
-
Electronics Kit for Arduino, available from our partner Home Science Tools®.
The kit includes the following parts that you need for this project:
- Arduino-compatible microcontroller board
- Note: This project will work with the Arduino UNO R3, UNO R4 Minima, UNO R4 WiFi, and compatible third-party boards.
- USB cable
- Breadboard
- Jumper wires
- Arduino-compatible microcontroller board
-
Windows or Mac computer. See this page if you have a Chromebook. Your computer will need:
- Access to the Arduino IDE, either installed local version or web-based editor. Watch this video for a comparison of the two options.
- USB port. The Science Buddies kit comes with a USB-A to C cable. The "C" end plugs into the Arduino, and the "A" end plugs into your computer. You will need an adapter or different cable if your computer only has USB-C ports. Watch this video to learn about the different types of cables and adapters.
- You will also need the following circuit components, not included in the kit:
- Positional servo motor
- Photoresistors (2), also called light-dependent resistors (LDRs) or photocells
- A small solar panel with positive and negative wire outputs (not USB or another connector). If you want to measure your solar panel's output with your Arduino, make sure the output is not more than 5V.
- Resistor assortment
- Male-female jumper wires
- Optional: multimeter (for measuring solar panels with outputs greater than 5V)
- You will also need the following supplies to build your tracker:
- Sheet of cardboard
- Popsicle sticks
- Scissors
- Hot glue gun
- Needle nose pliers
- Electrical tape
- Double-sided foam tape
- Twist ties or zip ties
- Optional: soldering iron
- Access to a sunny outdoor area
- Alternatively, you can do this project indoors with an incandescent heat lamp or high-wattage incandescent light bulb, but you will need to manually reposition the lamp.
Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools®, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at [email protected].
Experimental Procedure

Assemble Your Circuit
Before you build and test your complete tracking system, follow the steps in this section to assemble your circuit as shown in Figures 5 and 6. You can also access a Tinkercad Circuits simulation of the circuit here. For now, you can put parts like the photoresistors directly in the breadboard, without using male-female jumper wires as extension cables to connect them to the tracker.
- Connect the servo motor. Assuming you have an SG90 servo motor with orange, red, and black wires (if not, you will need to look up the connections for your motor):
- Orange wire to Arduino pin 9
- Red wire to breadboard power bus
- Black wire to breadboard ground bus
- For each photoresistor:
- Connect one leg to the power bus
- Connect the other leg to one side of a 10kΩ resistor
- Connect the other side of the resistor to the ground bus
- Connect one of the Arduino's analog input pins to the middle connection between the photoresistor and fixed resistor
- If you purchased a solar panel with 5V or less output:
- Connect the negative (black) wire to the ground bus
- Connect the positive (red) wire to one of the Arduino's analog inputs
- If you purchased a solar panel with more than 5V output, do not connect it to your Arduino. You can use a multimeter to measure its output instead.
- Connect power from your Arduino:
- 5V pin to breadboard power bus
- GND pin to breadboard ground bus


Test Your Circuit
Before you build the support structure for your motor and solar panel, you should test your circuit to make sure that everything works properly.
- Download solar_tracker.ino.
- Read through the commented code so you understand how it works.
- Upload the code to your Arduino.
- Open the serial monitor (Tools→Serial monitor).
- Watch the numbers in the serial monitor. Try covering one of the photoresistors with your finger. The value for that sensor should go down.
- By default, when the difference between the two sensor readings is greater than 50, the servo motor should rotate.
- If possible, take your Arduino outside in direct sunlight while it is connected to your computer with a USB cable. If this is not possible, find a window with exposure to direct sunlight indoors.
- Continue watching the serial monitor and try covering the sensors with your finger one at a time. Write down the sensor readings in direct sunlight and when shaded with your finger.
- You may need to make adjustments to the
marginvariable in the code and/or change the default 10kΩ resistor values to get your circuit to work properly. It will depend on how strong the sun is in your area at the time of year you are doing the project and on the photoresistors you purchased (photoresistors can have a wide resistance range). Here are some tips:- If your sensor values seem "saturated" (they are always very close to 1000 and do not change much when you cover them with your finger), try swapping out the 10kΩ resistors for smaller resistors.
- If your sensor values seem saturated in the other direction (they are always close to zero and do not change much), try swapping out the 10kΩ resistors for bigger resistors.
- If the sensor values change when you cover one with your finger, but do not change enough to make the motor spin, try decreasing the
marginvariable from the default value of 50. - If the motor moves too easily because the sensor values fluctuate too much, try increasing the
marginvariable.
- Your goal is to adjust your system so that the motor holds still when both photoresistors are directly facing the sun, and the motor rotates when one photoresistor is shaded. Continue adjusting your system as needed to achieve this behavior.
Build Your Tracker
Once you have your circuit working on a breadboard, you need to build a tracker with your solar panel and photoresistors mounted on a servo motor so they can rotate, as shown in Figures 7-12.
- Disconnect the photoresistors, servo motor, and solar panel from the breadboard.
- Cut a piece of cardboard to serve as a secure base to attach everything (Figure 7).

- Mount your Arduino and breadboard to the cardboard using double-sided foam tape.
- Build a support structure using hot glue and popsicle sticks to hold your servo motor vertically (Figure 8). Make sure the supports are securely glued to the cardboard base.

- Make sure your servo is centered at 90 degrees. You can do this by temporarily modifying your program to manually set the angle to 90 degrees with the command
servo1.write(90);. - Attach the servo horn to the servo.
- Use popsicle sticks and hot glue to create a support structure for the solar panel and attach it to the servo horn (Figure 9).

- Cut a small piece of cardboard and mount it vertically above the solar panel (Figure 10).

- Glue one photoresistor to each side of the piece of cardboard, facing upright (Figure 11).

- Reconnect all circuit components to the breadboard using male-female jumper wires. If you have a soldering iron available, you can solder for stronger connections.
- Secure the wires so they do not pull loose as the servo motor rotates:
- Connect the wires near the breadboard to the cardboard base using zip ties, twist ties, or hot glue (Figure 12).
- Connect the wires near the solar panel to the popsicle stick frame.
- Leave a long, flexible section of wire between the two connection points.

- Make sure your motor can rotate without any of the wires coming loose.
- You can do this using the Arduino sweep example code, which rotates the servo motor back and forth through its complete range.
- First, test the sweep program and watch to make sure that none of the wires physically come loose.
- Modify the sweep example code to print out the sensor values and solar panel voltages (you can copy the relevant code from solar_tracker.ino).
- Run the code again and watch the serial monitor values. Make sure the readings all change if you cover the panel or one of the sensors. If any readings are constant and do not change, you may have a loose connection.
- Even if a wire is not visibly loose, it may not have a good electrical connection. Unplug your Arduino and make sure all connections are secure. Use additional tape or glue if necessary.
- The photoresistors have thin leads that may not securely into the female ends of male-female jumper wires. Make sure they are pushed in firmly. Optionally, use needle-nose pliers to crimp their leads to the male end of a jumper wire, or solder the connections if you have a soldering iron available.
- Confirm that all your connections are secure before you continue. It will be frustrating if a wire comes loose partway through your experiment!
- Make sure your tracker works with a flashlight or by manually rotating the piece of cardboard to make the panel track the sun. Make sure the photoresistors are properly shaded by the piece of cardboard when not aimed directly at the sun. Adjust their position if needed.
Test Your Solar Tracker
- Plan when and where you will conduct your experiment.
- Ideally, this experiment should be conducted outdoors in full sunlight. If weather conditions do not permit this, you can conduct the experiment indoors from a sunny window, or use a high-wattage incandescent light bulb (100W or greater) to simulate the sun.
- You will need to test your solar tracker system on multiple different days as close together as possible to avoid seasonal variation in the sun's position in the sky. If you have to wait a few days for more sunny weather, that is OK, but you should not wait weeks or months between data collection days.
- Avoid leaving your Arduino or other electronics out in the rain.
- You will need access to your Arduino and a computer to record the solar panel voltage throughout the day. If you do not want to leave a computer outside, you can power your Arduino with a wall adapter and use a multimeter to measure the solar panel's voltage.
- Create a data table like Table 1. Modify the rows and columns based on the times of day and number of days where you can collect data.
- To collect data for a fixed solar panel, you can simply unplug your servo motor, or modify the code to manually set the servo motor angle to 90 degrees instead of changing it based on the photoresistor readings.
- To collect data for your solar tracker, run your solar_tracker.ino code (with any modifications you made in previous sections).
- Make a graph of your data with voltage on the y-axis and time on the x-axis.
- How does voltage produced for your tracking system compare to the fixed solar panel? Do you think the added complexity of the tracking system is worth it? There are many other things you can do with this project - see the Variations section for more ideas.
| Voltage (fixed panel) | Voltage (tracking panel) | |||||||
|---|---|---|---|---|---|---|---|---|
| Time of day | Day 1 | Day 2 | ... | Average | Day 1 | Day 2 | ... | Average |
| 8:00 AM | ||||||||
| 9:00 AM | ||||||||
| 10:00 AM | ||||||||
| ... | ||||||||
Table 1. Table for recording solar panel voltage.
Ask an Expert
Global Goals
The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.
Variations
- Voltage output is not the same thing as power output. Look up how to measure the power output of a solar panel and collect power measurements as well. You will need to learn about electrical voltage, current, resistance, power, and the units used to measure them.
- Can you measure the total power consumed by the Arduino (which will include everything the Arduino powers, such as the servo motor, and any electrical power wasted as heat)? Do any improvements in power output from the solar panel make up for the power consumption of the Arduino?
- Turn this into an engineering design project. How can you improve the performance or efficiency of your tracking system? Can you add other features, like LEDs or an LCD screen, to show the real-time power output without requiring a multimeter or a computer?
- Can you build a dual-axis solar tracker? You will need two servo motors and four photoresistors.
- Can you do your own agrivoltaics project? Can you optimize both solar power output and shading for a certain species of plant?
Careers
If you like this project, you might enjoy exploring these related careers:
Contact Us
Our kits are developed in partnership with Home Science Tools®. If you have purchased a kit for this project, Home Science Tools® is pleased to answer any questions.In your email, please follow these instructions:
- Include your Home Science Tools® order number.
- Please describe how you need help as thoroughly as possible:
Examples
Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
Bad Question I don't understand the instructions. Help!
Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
Bad Question Can I use a different part?
Contact Support















