Micro:bit DIY Smart Watch

by taifur in Teachers > Micro:bit

11920 Views, 45 Favorites, 0 Comments

Micro:bit DIY Smart Watch

cover.jpg
cover1.jpg
cover2.jpg

This Watch is designed for beginner users or learners of the micro:bit, or those who just want to make a basic smart watch for fun. This is designed with Microsoft's Makecode, an online graphical programming platform to write programs to customise the function of their micro:bit wearable without any programming knowledge.

This will help students to develop open source hardware understanding as well as programming skills. Students must exercise creative thinking and use their hands as they design their own wearable, customising functions through graphical programming.

Microsoft MakeCode brings computer science to life for all students with fun projects, immediate code simulation results, and both block and text editors for learners at different levels. MakeCode aims at inspiring people to explore computer science and creative coding. Leaners can immediately start programming when logging in it and find the real-world applications of computer science.

Recommended Ages: All ages

Features:

  • Easy-to-make and user-friendly
  • Easy to make strap band
  • Has binary and digital time display
  • Compass and Pedometer

This is mainly designed for the students who want to learn open source hardware and programming and want to increase creative thinking skills.

Demo Video:

Supplies

the-watch-2.png
20210113165458_5ffeb5623aa5a.jpg
s1.jpg
s3.jpg
  1. BBC micro:bit (buy from aliexpress.com)
  2. Dual AAA battery holder (buy from aliexpress.com)
  3. 2 AAA Bateries (buy from aliexpress.com)
  4. Old T-shirt
  5. Old Jeans
  6. Velcro with sticky back - 5cm long
  7. Double sided tape
  8. Ruler and pen
  9. Scissors

You can buy a micro:bit pack (micro:bit + battery case + silicon protective cover + programming cable) from grarbest.com using my affiliated link (https://www.gearbest.com/boards---shields/pp_009593424660.html?wid=1433363&lkid=82543407)

Collecting All the Things

BBC%20microbit%20hardware%20specification.jpg
s4.jpg
battery-con.jpg

Before starting your work first you have to have all the components. The main part of our project is micro:bit. The Micro Bit (also referred to as BBC Micro Bit, stylized as micro:bit) is an open-source hardware ARM-based embedded system designed by the BBC for use in computer education in the United Kingdom. It was first announced on the launch of BBC's Make It Digital campaign on 12 March 2015 with the intent of delivering 1 million devices to pupils in the UK. The final device design and features were unveiled on 6 July 2015 whereas the actual delivery of devices, initially planned for September 2015 to schools and October 2015 to the general public began on 10 February 2016.

The device is described as half the size of a credit card and has an ARM Cortex-M0 processor, accelerometer and magnetometer sensors, Bluetooth and USB connectivity, a display consisting of 25 LEDs, two programmable buttons, and can be powered by either USB or an external battery pack. The device inputs and outputs are through five ring connectors that form part of a larger 25-pin edge connector. In October 2020, a physically nearly identical v2 board was released that features a Cortex-M4F microcontroller, with more memory and other new features.

For powering the micro:bit we are going to use 2 AAA batteries. We need to use a battery case with JST connector so that we can provide power easily to the micro:bit.

Let's Code

microbit-watch.png
ceas binar4.png
loop.png
button-press.png
calculate-time.png
direction.png
display.png

I used Microsoft MakeCode for developing the smartwatch firmware for the microbit. Microsoft MakeCode offers a block-based interface along with a JavaScript text editor to use code to create projects for everything from robotics to Minecraft. Simple tutorials allow users to quickly get familiar with the interface and begin designing for micro:bit, Circuit Playground Express, Minecraft, Chibi Chip, Grove Zero, Sparkfun, Cue, and Lego Mindstorms EV3. The user experience will be familiar to anyone who uses Scratch. There's a simulator space (where the code runs) and a code-block editing space where different elements of code are combined. The terms for the different code blocks are different from those in Scratch, but the functionality is very similar and relies on universal principles of coding like Boolean operators, loops, and conditionals. Microsoft MakeCode allows students to then download their code and run devices like the micro:bit by connecting them with a USB cable. These peripherals have to be purchased (the MakeCode website provides links to vendors) to see the code in action.

Microsoft MakeCode showcases the diverse application of computer coding. Where we often think of coding as being used to create apps, we can use MakeCode to show that code can be used to control hardware, for engineering, for art -- for almost anything. This makes MakeCode really well suited to robotics clubs, makerspaces, and science classes.

Let's move to our code:

The on start function run on device statting and initialize the variables used in the code. The forever function runs forever. This function calls the calculate_time function to read the current time and display the time calling show_minutes and show_seconds functions.

The following blocks detect the button press. When A button is pressed it shows the current time in digital form. Otherwise the time is displayed in binary form. If the setting option is selected A button is used to increment the minutes and hours. B button is used to change the mode like clock/compass/pedometer. When both A and B button is pressed simultaneously then the clock enters into the time setting mode.

The calculate_time function utilizes the built-in pause function to calculate the time as we are not using any RTC here. For every 60 seconds pass minutes is incremented by 1 until it passes 60. The same is applicable to hours also.

The show_minutes and show_hours functions display hours and minutes in the right position in binary format. The built-in shake function is used for counting the steps. This function uses the onboard accelerometer to detect the shake.

Finally, the show_direction function is used to display the direction by the arrow in the LED matrix. The in-built arrow function is used for this purpose.

You can directly download the whole source code from below.

Cutting the Clothes

IMG_20211014_094654.jpg
a2.jpg
a3.jpg
a4.jpg

1. Cut a piece of cloth from the pair of jeans. Cut straight by the seam.

2. Using the ruler and pen, mark a rectangle of 22cm x 5cm (adults should use 24cm x 5cm) on the jeans cloth.

3. Using the ruler and pen, mark a rectangle of more or less 26cm x 5cm on the T-shirt. Don’t worry if you don’t get it quite right, we’ll tidy things up later on.

4. Cut the rectangle using scissors. Don’t worry about the quality of the cut, we’ll trim it later on.

The cut pieces will look as follows. We are ready to go to the next step.

Assembling

a5.jpg
a6.jpg
a7.jpg
a9.jpg
a10.jpg
a13.jpg
cover1.jpg

1. Stretch the cloth using your hands and apply the double-side tape on the rectangle marked on the jeans. You might need the help of a friend to achieve this step. Don’t worry if the tape is larger than the rectangle, we will trim it later. Make sure to apply pressure to the tape to secure it firmly.

2. Peal the tape protective layer from the rectangle. Place the micro:bit pins on the tape at more or less 7 cm from the left border. Then lower the micro:bit on the tape and press gently.

3. Connect the battery holder and place it on the right of the micro:bit. Tuck the cables away on the tape to protect them.

4. Stick the T-shirt rectangle from the top of the micro:bit, over the battery cables.

5. Use your fingers to push the T-shirt cloth under the micro:bit to give access to the micro-USB plug.Place the T-shirt over the battery holder and stick it up to the end.Stick the T-shirt cloth on the other side of the watch. Lift the micro:bit pins to slide the cloth under and leave them free from the tape.

6. Stick the Velcro hooks on the right side of the battery holder on the T-shirt cloth.

7. Stick the Velcro loops on the other end on the jeans fabric.

8. Your watch is ready! We’ll now add code to the micro:bit to make it keep time for real!

Video: