This demonstration of the micro:bit compass uses a laser-cut wooden compass rose to show degrees and cardinal directions.
Students can use the compass rose to help translate heading information from the micro:bit's onboard compass/magnetometer into cardinal directions using MakeCode or MicroPython. The sample programs provided turn the micro:bit LED array into a digital compass needle.
With this project, students will learn how to:
- determine the orientation of the micro:bit in real space using the onboard compass/magnetometer
- use the micro:bit LED array to show directional arrow or clock images
- translate degree headings to cardinal directions
- use a laser cutter/engraver
- microbit-compass.py - a MicroPython implementation of a simple compass needle
- microbit-compass.js - a Javascript implementation of the compass needle that's compatible with MakeCode
- Microbit Compass Rose.ai - an AI file with a 24 in x 12 in layout of eight compass roses. Suitable for printing on a Epilog Mini.
I used 1/8" or 3mm plywood for the compass rose. This allows the micro:bit buttons to sit nearly flush with the top of the plywood. I engraved with 600dpi recommended settings and had a high level of detail. Finally, I used double-sided tape to attach the micro:bit to the back of the compass rose.
Extension ideas:
- create a treasure or scavenger hunt
- compare the digital compass to an analog compass for accuracy
- calculate the distance to a fixed point using readings from known points and trigonometry
- make a sundial using the micro:bit to orient it to the right direction
Compass source code from micro:bit site
Compass rose adapted from Handaxe_Maker's micro:bit compass.
Note: micro:bit compass by Handaxe_Maker is licensed under the Creative Commons - Attribution license.