Instructions
Table Of Contents
- Introduction
- Parts
- Using Alligator Clips
- Solar Board Reference
- Project 1 – Sun Finder
- Project 2 – Garden Light
- Project 3 – Self Charging Cooling Fan
- The BBC micro:bit
- Getting Code to Run on the micro:bit
- Project 4 – Adding an Energy Meter
- Project 5 – Energy Logger
- Connecting Up
- Code for the Energy Logger (MakeCode)
- How it works
- Connecting to Your PC
- Pairing Your micro:bit With MakeCode
- Showing the Device Console Graph
- Capturing Data From a Charge and Discharge Cycle
- Downloading Data
- Getting Data into a Spreadsheet Program
- Analysing the Data
- Graphing the Data
- Results
- Understanding the Data
- Understanding Duty Cycle
- How the Solar Store Works
- Project 6 – Intelligent Cooling Fan
- Troubleshooting
- About the Author
- Learning
- Monk Makes Kits
Code for the Energy Logger (MakeCode)
The code for this project can be accessed here:
https://makecode.microbit.org/_Avq2HMMfp2gp
How it works
The code loops round once per second and takes a reading from the P0 pin. This
reading is sent via the serial port, which transfers the data over the USB lead to
your computer. A reading will be somewhere between 0 (for 0V) and 1023 (for 3V),
and the voltage at the P0 pin will change as the amount of stored charge changes.
Button A and Button B are used to turn the output stage of the Solar Store off and
on respectively, so that you can switch between charging and discharging. While
you are doing this, you are capturing a history trace of the amount of energy stored
in the Solar Store.
You can use this information to work out how quickly the Solar Store charges and
discharges in specific light conditions, and this information will be vital later to
correctly configure the final intelligent project.
Page 23