Jump to main content

Find the Best Place to Put a Solar Panel

Abstract

Imagine trying to put a solar panel on your roof or outside your home to generate clean, renewable energy. Where would you put it so it generates as much power as possible throughout the day? What direction should it face? Is there a way to take measurements to find the best location before you install the panel? In this project, you will use a tiny programmable device called a micro:bit to record light data and find the best place to put your panel.

Summary

Areas of Science
Difficulty
Method
Time Required
Long (2-4 weeks)
Prerequisites

None

Material Availability

See Materials section for details

Cost
Low ($20 - $50)
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

Use a micro:bit's light sensor to find the best location for a solar panel. 

Introduction

Solar panels generate clean, renewable energy from sunlight. They generate the most power when the sun's rays are perpendicular to the panel. They make very little power in the shade and no power at all at night. This means that to generate the most power, a solar panel should be placed and tilted so that it will get the most total sunlight exposure throughout the day. 

That might be easy to do if you can place a solar panel in the middle of a field or on top of a building, with no tall trees or other buildings nearby to cast shade on the panel. If you live in the northern hemisphere, the solar panel should point south, since the sun is usually in the southern part of the sky throughout the year. If you live in the southern hemisphere, it's the opposite, and your solar panel should face north. 

But what if that isn't the best option? For example, maybe you live in the northern hemisphere, but there is a tall building or tree directly south of your house that blocks the sun for part of the day. Or maybe you live in the southern hemisphere and want to put a solar panel on the roof of your house, but your roof is at an angle that doesn't face directly north (Figure 1). How do you figure out the best place to put your solar panel?

Figure 1. Solar panels on rooftops in Australia facing different directions.

One way to do this is to use a device with a light sensor to record data. You can put the device somewhere and measure the amount of light exposure throughout the day. If you record data in different locations, you can figure out the best place to put the panel so it will get the most light. To do this, you will need to measure the area under the curve on a graph of light level vs time. Sometimes, it might be obvious which graph has more area under the curve (Figure 2). Other times, it might be a little trickier to figure out, and you will need to measure the area carefully (Figure 3). The project procedure will explain how to do this.

Figure 2. Example graphs of light levels recorded in two different locations. The curve on the left has more area under it than the curve on the right.
Figure 3. Two more example graphs showing what data might look like when locations are partially shaded during the day. Here, it is not immediately obvious just by glancing at the graphs which one has more area under the curve. 

In this project, you will use a tiny programmable device called a micro:bit. The micro:bit has a built-in light sensor and can record data that you can view on your computer. By placing the micro:bit in different locations and recording data, you can figure out the best place to put a solar panel near your home!

Terms and Concepts

Questions

Bibliography

Materials and Equipment

Experimental Procedure

This project follows the Scientific Method. Review the steps before you begin.
  1. If you have never used a micro:bit before, watch our micro:bit setup video before you continue. You should also watch the light sensor and data logging videos.
  2. Open the sunlight data logger program from the Micro:bit Educational Foundation. Click "Edit code" in the top right and then "Download" in the lower left to download the program to your micro:bit. The program is also shown in Figure 4 if you would like to write it yourself. Here is how the program works:
    1. The program will display an X on the screen when it first starts and is not logging data.
    2. Data logging starts when you press button A on the micro:bit. A check mark will display on the screen for two seconds to indicate that logging has started. 
    3. After that, a single LED will stay lit on the screen to show that the micro:bit is logging data.
    4. Once per hour (every 3,600 seconds, or 3,600,000 milliseconds), the micro:bit will record the elapsed time (in hours) since it started recording data and the light level on a scale of 0 to 100.
    5. A heart will briefly display on the screen each time the micro:bit records a data point. 
    6. You can change the number in the every block if you would like to record data more frequently. 
    7. The micro:bit will stop recording data when you press button B.
    8. The micro:bit will delete the stored data when you press buttons A and B at the same time. Be careful not to do this before you download the data to your computer!
Figure 4. MakeCode program for the sunlight data logger.
  1. Prepare a data table to record your data. See Table 1 for an example. 
    1. Enter a description for each location you plan to test. Include information about the micro:bit's location, the direction it will face (for example, north, south, east, or west), and any obstacles that may block the sun for this location.
    2. Add more rows if you plan to test more locations.
    3. Note: for all trials, keep the tilt angle (the angle between the micro:bit and the ground) constant at about 45 degrees. You can change this variable for a separate experiment (see Variations section).
Swipe left to see more
Table 1. Example data table.
Location # Description Trial 1 Trial 2 Trial 3 Average
1
2
3
  1. Look at a weather forecast to plan your testing. You should plan to collect data on sunny or mostly-sunny days. Do not collect data on overcast or mostly cloudy days. Avoid collecting data on all sunny days at one location and all partly cloudy days at another location, as that will skew your results. Conducting more trials for each location will help if you have partial cloud cover on some days. If needed, have an adult help you look at a weather forecast and plan your experiment. 
  2. Prepare your micro:bit for data collection. Figures 5 and 6 show example indoor and outdoor testing locations, respectively.
    1. Connect the battery pack. 
    2. If you will be testing your micro:bit outside, place it in a clear resealable plastic bag to protect it from water.
    3. Prop your micro:bit up so it is tilted 45 degrees relative to the ground.
    4. Press the A button to start collecting data.
Figure 5. A micro:bit propped up on an interior windowsill.

Figure 6. A micro:bit placed outside a house.

  1. Do not disturb your micro:bit for 24 hours. After 24 hours, press the B button to stop collecting data.
  2. Download the data from your micro:bit and save it on your computer.
    1. Disconnect the battery pack and plug the micro:bit into your computer with the USB cable.
    2. Open your computer's file explorer and navigate to the micro:bit. It should show up like an external flash drive or hard drive.
    3. Double click MY_DATA.HTM to open it in a web browser. 
    4. Click Visual Preview to see a graph of your data.
    5. Click Download to download a comma-separated value (CSV) file of your data.
    6. Give the file a name that makes sense so it will be easy to identify later, such as "Location1_Trial1.csv."
  3. Once you are sure the data has been saved to your computer, press buttons A and B on your micro:bit at the same time to delete the data stored on it.
  4. Repeat steps 5-8 for at least two more trials at your first location.
  5. Repeat steps 5-9 for each of your remaining locations.
  6. Once you are done collecting data, you will need to calculate the area under the curve for each trial.
    1. Open your CSV file in a spreadsheet program like Microsoft Excel or Google Sheets. 
    2. Make a graph of the data with "time in hours" on the x-axis and "light level from 0-100" on the y-axis. 
    3. Calculate or measure the area under the curve for the graph. There are several ways to do this:
      1. Print the graph on graph paper. Count the number of squares that fit completely under the curve (do not worry about squares that only fit partially under the curve), as shown in Figure 7. If you take this approach, make sure you print each graph at the exact same size for each trial.
      2. Calculate the area of each rectangle that fits under the curve, as shown in Figure 8. The area of each rectangle is its width (1 hour, unless you changed the frequency of data collection) times its height (the light level at the top of the rectangle). Add up the areas of all the rectangles to get the total area under the curve.
      3. Both of these methods will slightly under-estimate the area under the curve, since they do not include the areas of the partial squares or triangles at the top. That is OK and should still provide a reasonable comparison between your different trials. For more accurate results, you can measure or calculate the area of the partial squares or triangles and include them in your total area. 
Figure 7. One method for approximating the area under a curve by counting squares that fit under the curve. This method slightly underestimates the total area since partial squares are not counted.
Figure 8. Another method for calculating the area under the curve by first finding the area of each rectangle (width times height) and then adding up all their areas. This method also slightly underestimates the total area since the triangular regions above the rectangles are not counted.
  1. For each trial, enter the area under the curve in your data table.
  2. For each location, calculate an average area under the curve and enter it in your data table. 
  3. Compare the results for each location you tested. Which location has the highest total sun exposure throughout the day on average? Where is the best place to put your solar panel?
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

  • Keep your micro:bit in a consistent location and facing the same direction (north, south, east, or west), but change the tilt angle relative to the ground. Which angle receives the most sun exposure throughout the day? 
  • Can you repeat this experiment at different times of the year? Is the same location always the best? Where and how should you place your panel to maximize the amount of power generated over the entire year?
  • What if you could make your solar panel rotate so it always points right at the sun? Check out our micro:bit solar tracker project.

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
Just as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Career Profile
Many aspects of peoples' daily lives can be summarized using data, from what is the most popular new video game to where people like to go for a summer vacation. Data scientists (sometimes called data analysts) are experts at organizing and analyzing large sets of data (often called "big data"). By doing this, data scientists make conclusions that help other people or companies. For example, data scientists could help a video game company make a more profitable video game based on players'… 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. "Find the Best Place to Put a Solar Panel." Science Buddies, 3 Mar. 2026, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Energy_p047/energy-power/best-place-for-solar-panel. Accessed 23 June 2026.

APA Style

Finio, B. (2026, March 3). Find the Best Place to Put a Solar Panel. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Energy_p047/energy-power/best-place-for-solar-panel


Last edit date: 2026-03-03
Top
Free science fair projects.