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 Intelligent Cooling Fan (MakeCode)
You can access this code from this link:
https://makecode.microbit.org/_ATgfJtK9fMa5
How it Works
Using the numbers for TOC and BOC from project 5, fill in the CHARGED and
DISCHARGED constants in this program, to calibrate it for your specific
environment. Note how the CHARGED constant is divided by two; this is because
you want to allow your fan to start if things are getting hot, even when there is some
charge in the Solar Store, rather than waiting for full charge.
This program uses hysteresis to prevent lots of jittery switching. This just means
that there are two thresholds, one for turning on and one for turning off, and the
values are slightly different. This is just like how a central heating thermostat works,
to prevent repeated boiler starting and stopping. Both the temperature sensing and
the stored charge sensing have hysteresis applied to them to stop this jittering.
Without hysteresis With Hysteresis
blue line – sensed temperature, red line – output (fan on/off)
Page 31