Posts

Showing posts from August, 2023

Microbit sun exposure timer

Image
This project is about building a device that measures how long you have been in the sun. This is very important in Australia because of the ozone layer. They always tell us in school to reapply sunscreen every 2 hours but I am using this project for a coding challenge. This project uses the onboard LEDs as a brightness sensor. The detects all kind of light, not only ultra-violet which is the real danger, but it still helps me prove the idea. A real product should use an UV sensor and be more compact. This is the code. It uses a variable to count how many seconds you have been under the sun. The Micro:bit warns you with a sound if it has gone over the time limit, so to run this code you will need a Micro:bit version 2. After testing the code in the sun and indoors I set the brightness limit to 250. When the reading is below 250 it will not count. Pressing button A shows you how long you have been in the sun. Once you reapply sunscreen you need to press button B to restart. The time limi...