Make a Compass With Your Micro:bit

About: ElecFreaks is an open design house founded in March 2011. Our goal is to create rapid prototypes and give small-batch manufacture solution for makers and startups. With over 50% staff as engineers and expand...

Micro:bit has integrated a compass on the board. Today, we are going to learn how to use BBC micro:bit to make a simple wearable compass device and display directions on the LED screen.

Step 1: Tools&Materials:

1 x ELECFREAKS Power:bit For Micro:bit

1 x BBC Micro:bit Board for Coding & Programming

1 x Acrylic Base Board

1 x Watch Strap

7 x 3*5 Screws

Step 2: How to Make

Firstly, we have to fix micro:bit onto power:bit.

Then, fix the acrylic board onto power:bit with 2 screws.

Step 3: Programming

Click to open Microsoft Makecode, write your code in the editor.

Click Edit on the top right corner to edit your program, then click Download to save your code directly into your micro:bit.

Step 4: Code Explain

Here we use "N" to stand for north, "S" for south, "W" for west and "E" for east.

The data “0” read by micro:bit compass represents the north, so within 45 degrees in the left or right, micro:bit will display “N”.

From 45 degree to 135 degree, micro:bit displays an E on its LED screen, while from 135 degree to 225 degree, micro:bit displays an S, and from 225 degree to 315 degree is a W.

Step 5: Operation Instruction:

Once we have completed code download, we can see "DRAW A CIRCLE" displayed on micro:bit screen. Then there is a light spot on the screen center. Rotate micro:bit for a circle to calibrate your compass. After you finished your circle movement, a smily face will be shown on the screen, which indicates that you have successfully done the calibration.

Next, we can see that micro:bit is able to show the current direction.

Now just move your micro:bit and see which direction it points to!

Step 6: Source

This article is from:

If you have any questions, you can contact:



    • Tape Contest

      Tape Contest
    • Arduino Contest 2019

      Arduino Contest 2019
    • Trash to Treasure

      Trash to Treasure