Jump to main content

Design a Mini Solar Tracker System

1
2
3
4
5
116 reviews

Abstract

How can you squeeze as much power as possible out of solar panels if you do not have a lot of space to install them? By tracking the sun! Keeping a solar panel pointed directly at the sun throughout the day can maximize the amount of power it produces. In this project you will design, build, and test your own miniature solar tracking system using a fun block-based programming language - no coding experience required!

Summary

Areas of Science
Difficulty
Method
Time Required
Short (2-5 days)
Prerequisites

None

Material Availability

This project requires electronic circuit parts. See Materials list for details.

Cost
Average ($40 - $80)
Safety

No issues

Credits
Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Objective

Design, build, and test a mini solar tracking system.

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).

Figure 1. An array of solar panels on a rooftop.

Figure 2. Sheep grazing under solar panels.

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.

Figure 3. Side view of a solar panel showing how it will produce maximum power when it is perpendicular to the sun's rays.

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.

Figure 4. A solar tracker system.

In this project, you will design and build your own solar tracker system using a tiny programmable board called a micro:bit (note the ":" in the middle - it's "micro:bit," not microbit or micro bit). You will use the micro:bit to control a small servo motor. The micro:bit has a built-in ability to measure light levels. It can also measure the voltage produced by a small solar panel. Using this information, you will write a program that scans the sky to find the sun by looking for the brightest light or highest voltage. You can also record data from your tracker and even program an LED display to show the output - what exactly you build will be up to you!

Terms and Concepts

Questions

Bibliography

Materials and Equipment

Since this is an engineering design project, the exact parts you need to purchase may vary. Here is a list to get you started:

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

This project follows the Engineering Design Process. Confirm with your teacher if this is acceptable for your project, and review the steps before you begin.

Design Your Solar Tracker

  1. If this is your first time using a micro:bit, follow the Getting Started instructions on the micro:bit website to learn how to use your micro:bit and connect it to your computer. 
  2. Decide what programming language you will use for your micro:bit:
    1. If you are new to coding, we recommend using Microsoft MakeCode to program your micro:bit. MakeCode is a graphical programming language where you make computer programs using colored blocks of code instead of a text editor. The example code in this procedure uses MakeCode. We recommend following a few of the MakeCode tutorials before you proceed.
    2. You can also program your micro:bit in Python, JavaScript, and Scratch. You may prefer this approach if you already have programming experience in one of these languages. See the Let's Code page for more details.
  3. Make a plan for your solar tracker system. Here are a few things to consider:
    1. Look up the maximum voltage produced by your solar panel.
      1. If your solar panel outputs less than 3.3V maximum, you can measure its voltage directly with one of your micro:bit's pins, and you can use this voltage to track the sun's direction.
      2. If your solar panel outputs more than 3.3V, you cannot measure its voltage directly with the micro:bit. You can do that using an external multimeter. Do not connect your solar panel directly to your micro:bit, or you may damage it. To track the sun, you will need to use the micro:bit's built-in light sensing capability separately from the solar panel.
    2. Many small servo motors are rated to operate at 5V but will still run at lower voltages. The 3.3V provided by the micro:bit should be enough to power an SG90 servo, but if you purchased a different servo motor, you may need an external battery pack instead.
    3. You will need to build a physical support structure for your solar tracker. Craft materials like cardboard, hot glue, and popsicle sticks work well for small solar panels and servo motors. If you purchased larger parts, you may need to use sturdier materials.
    4. There are various ways you can display your solar panel's voltage for your system.
      1. If your solar panel's voltage is too high to connect directly to the micro:bit, you can measure it using an external multimeter.
      2. If you can operate your solar tracker while it is connected to a computer, you can use the micro:bit's serial write command to print the voltage out on a computer monitor.
      3. You can use the micro:bit's built-in LED display to show scrolling text and read out the voltage.

Build Your Circuit

Assemble your circuit according to your plan. Figure 5 shows a circuit with an SG90 servo and solar panel connected directly to the micro:bit.

  1. To connect the servo motor:
    1. The servo motor's cable probably ends in female pins. Plug male jumper wires into these pins so you can then connect them to alligator clips.
    2. Connect the servo motor's brown wire (ground) to the micro:bit's GND pin.
    3. Connect the servo motor's red wire (power) to the micro:bit's 3V pin.
    4. Connect the servo motor's orange wire (signal) to micro:bit pin 0.
  2. To connect the solar panel (only do this if your panel outputs less than 3.3V):
    1. Use an alligator clip to connect the solar panel's black (negative) wire to the micro:bit's GND pin. Note that the pin may be too crowded to connect multiple alligator clips to it directly. Instead, you can connect the alligator clips to each other, and just connect one of them to the GND pin.
    2. Use an alligator clip to connect the solar panel's red (positive) wire to micro:bit pin 1.
Figure 5. Servo motor and solar panel connections.
  1. If your servo motor requires more power than the micro:bit can provide, connect an external battery pack as shown in Figure 6. Remember that some servos rated for 5V may still work with the micro:bit's 3.3V supply, so you will need to test it to find out.
    1. Disconnect the servo motor's red (positive) wire from the micro:bit's 3V pin.
    2. Connect it to the battery pack's red (positive) wire instead.
    3. Connect the battery pack's black (negative) wire to the micro:bit's GND pin (or to another alligator clip that is already connected to the pin).
Figure 6. Circuit diagram including an external battery pack for the servo.

Write Your Code

Figure 7 shows an example program that you can use to get started. Watch the video tutorial for a step-by-step walkthrough of building the program. Here are some things to consider:

  1. You can change the number in the change angle by 5 block to change the incremental movements when your motor system the sky searching for the sun. A smaller angle will be more accurate but will take longer.
  2. The servo motor takes some time to reach its new position. While the servo is moving, it draws a lot of power. It is a good idea to have a pause command after the servo write pin P0 to value block to give the servo time to reach its new position and stop moving before you read the voltage.
  3. The analog read pin P1 block will return a number between 0 and 1,023. However, this number does not have units of voltage. 0 corresponds to 0V, and 1,023 corresponds to the maximum (3.3V). You can convert from the analog read value to voltage using the equation set voltage to 3.3 × analog read pin P1 / 1023.
  4. If you are using the micro:bit's built-in light sensor instead of measuring your solar panel's voltage, then you will want to delete the set voltage block. You can create a different variable called light and set it equal to the light level value under Input in the blocks menu. You will need to change the rest of your program accordingly (change max voltage to max light etc.). Note that you cannot convert this light level directly to the solar panel's voltage like you can with the analog read command.
  5. You can use the serial write value blocks to write values to the serial monitor if you will be doing your tests while your micro:bit is still connected to a computer. Click the "Show data (Device)" button to see the data after you have downloaded your code. 
  6. You can use the show string block under Basic in the blocks menu to show scrolling text using the micro:bit's built-in LED grid.
  7. You want your solar tracking system to spend as much time as possible pointed directly at the sun - not scanning back and forth looking for the sun. The sun does not move through the sky very quickly, so you can include a long delay at the end of your forever loop using the pause (ms) block. You can make this number very large when you are ready to test outside using the sun. When you are initially testing inside (which you can do with a flashlight or lamp), you can make the delay shorter, so you do not have to sit there for long periods of time waiting for it to react to changes in light.
Figure 7. Makecode blocks for solar tracker.

Build a Support Structure

You will need to build a support structure for your solar tracking system. Figures 8 and 9 show an example. If you are using the micro:bit's built-in light sensing, it will also need to be mounted on the servo motor instead of fixed to the base.

  1. The servo motor is held upright by a frame made from popsicle sticks and hot glue.
  2. The solar panel is mounted to the servo motor using popsicle sticks and hot glue.
  3. The servo motor and micro:bit are both attached to a piece of cardboard that serves as a base. You may want to use tape (not hot glue) to secure your micro:bit so it is more easily removable.
Figure 8. Close up of popsicle stick support structure for servo motor.

Figure 9. Servo motor and micro:bit attached to cardboard base.

Test Your Solar Tracker

  1. Since the sun moves so slowly, to initially test your solar tracker, you may want to test it indoors. There are two ways to do this:
    1. Leave the cardboard base in place, and use a moveable light source like a flashlight or lamp.
    2. Rotate the cardboard base to change its orientation, and use a fixed light source like a ceiling light or window.
  2. Download your code, watch the servo motor scan, and see if it turns to the position that is pointed toward the most light.
  3. Move your light source (or rotate the base) and watch the motor scan again (if needed, remember to decrease the value in the pause (ms) block so you do not have to wait a long time between tests). It should point in the new direction of the brightest light source.
  4. If your tracker does not work properly, here are some suggestions:
    1. Make sure none of your alligator clips are loose.
    2. Make sure the exposed metal ends of the alligator clips are not bumping into each other. This can create a short circuit. 
    3. Increase the pause (ms) value immediately after the servo write block to give the motor more time to finish moving.
    4. Make sure your servo motor works by testing this servo sweep code. This code just makes the motor oscillate back and forth continuously. If your servo still does not move at all, it may need an external battery pack as shown in Figure 6.
    5. If you are testing indoors, try to test in a room with a single bright light source or hold an artificial light source very close to the micro:bit so there is less interference from windows or other lights in the room.
  5. When you are ready, set your solar tracker up outdoors to test on a sunny day.
    1. If you had previously decreased the pause ms value at the end of the forever loop, remember to increase it again before testing outside. 
    2. If there is no risk of rain, you can leave your micro:bit connected to a computer so you can print out data from the serial monitor. This also allows you to power the micro:bit with the computer's USB port.
    3. If you cannot leave a computer outside, you can still power your micro:bit using a USB cable and phone charger/wall adapter. This approach is preferable to using the 2xAAA battery pack included with your micro:bit, which may not last all day (especially if your micro:bit is powering the servo motor directly).
    4. If possible, you can set up a camera in time-lapse mode to take a video of your solar tracker system as it moves throughout the day. If this is not possible, you can come take pictures of your tracker at set intervals (for example, every 30 or 60 minutes).
  6. Evaluate your solar tracker's performance. Does it always seem to follow the sun? Do you ever catch it pointing in the wrong direction? If so, can you figure out what went wrong? Are there any changes you can make to either your code or your physical setup to improve your tracker's performance? See the Variations section for more ideas.
icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Goals

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Affordable and Clean Energy: Ensure access to affordable, reliable, sustainable and modern energy.

Variations

  • Can you build a dual-axis tracker using two servo motors?
  • How do clouds affect your solar tracker? Does it get "confused"? Can you make it go into a standby mode if voltage drops below a certain level, indicating that the sun is currently blocked by clouds?
  • Can you do an experiment where you record your solar panel's voltage throughout the day with and without tracking? If your panel's voltage is too high to measure directly with the micro:bit, you can use an external multimeter instead.
  • You can use external light sensors called photoresistors to measure light instead of the micro:bit's built-in measurement capability. This lets you connect multiple sensors to determine the direction of the sun without scanning back and forth. See this project for instructions on how to do this with an Arduino. Can you do the same thing with a micro:bit?

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Does the idea of harvesting the enormous power of the sun interest you? If you find this exciting, then you should think about installing solar photovoltaic panels on your house to collect free electricity from the sun. But how energy efficient is your home already? Can it get better? How many panels would your house need? What would the system look like? You can get the answers to these questions and more from your local solar energy systems engineer. These engineers help their residential and… Read more
Career Profile
Would you like knowing that what you do every day helps the environment and saves money? Well, that is what solar photovoltaic installers do. They outfit buildings and large solar energy farms with photovoltaic systems that convert free sunlight into clean and renewable energy. This is an exciting, emerging field that will enable you to combine a passion for the environment with mechanical and electrical skills. Read more
Career Profile
How much energy do you think all the houses and buildings in the United States consume? It turns out they eat up 40% of all the energy that the U.S. uses in a year. The figure is high because all those houses and buildings need to be heated, cooled, lit, ventilated, and supplied with heated water and electricity to run all sorts of electrical devices, appliances, and computers. Energy efficiency engineers help reduce the energy that houses and buildings use. This saves families and businesses… Read more

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Finio, Ben. "Design a Mini Solar Tracker System." Science Buddies, 22 Oct. 2024, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Energy_p046/energy-power/microbit-solar-tracker. Accessed 9 June 2026.

APA Style

Finio, B. (2024, October 22). Design a Mini Solar Tracker System. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Energy_p046/energy-power/microbit-solar-tracker


Last edit date: 2024-10-22
Top
Free science fair projects.