Solar Data Logger
Sunlight is a powerful, renewable energy source! Just as scientists and engineers use data to understand and improve solar power systems, you can too.
In this project, you’ll use the data logger to track your solar panel’s performance over time and in response to different variables. Monitoring our panel’s performance will help us optimize power production for a more sustainable future.

Prepare
You’ll need the following items to complete this project:
- Smart Solar Energy Kit
- micro:bit V2
- Computer with access to Microsoft MakeCode
- Optional: A spreadsheet program (like Google Sheets or Microsoft Excel) for graphing
Build
First, let’s set up your solar panel and energy meter.
After you build, think about how to position your solar panel so it can get consistent light for data collection during your experiments.
Code
Explore the code below to get started with your solar data logger:
- Connect your project to the computer and download the starter code to make it work!
- Review the code comments on each block to learn about how your solar data logger works, then try testing it in real life.
Improve
How would you modify the sample code provided, or create your own code that includes the following features?
Try:
- Logging another type of data in a second column (e.g. ‘current’ data)
- Logging data more or less frequently
Experiment
Log data for 5-10 minutes under different light conditions (e.g., lamp, direct sunlight, partial shadow, moving a light source further away, etc.). After logging, check out your results.
- Connect your micro:bit to your computer via USB. Open the micro:bit drive (it often appears like a USB stick).
- Click the
MY_DATA
file to open the data in your web browser. - View your data as a table, or
- Preview as a graph!
- Download a CSV file of your data to use it in other programs like Microsoft Excel or Google Sheets!
Analyze your data. What trends do you observe? How did your experimental changes impact the data?
Feeling Stuck? Explore the Knowledge Base for common questions and troubleshooting tips.