Coronavirus: Stop the Spread With Micro:bit

Originally posted on instructables: https://www.instructables.com/id/Coronavirus-Stop-the-Spread-With-Microbit/

Coronavirus: Stop the Spread With Micro:bit

During the toughest times human ingenuity shines the most. From January 2020 COVID-19 pandemic engulfed the world. COVID-19 is spread by air droplets and fomites. Fomites, simply speaking are inanimate things, such as furniture, clothes, door handles, etc. Virus from infected person can stay on surfaces for as long as 9 days. So, one of the most important ways we can prevent COVID-19 spread (apart from social distancing) is making sure we wash our hands often and avoid touching our face. According to statistics, humans touch their face 16 times an hour on average. It is a habit many of us have and we don’t even notice it most of the time. So, in this article we will quickly make a convenient device that can remind us that we should avoid touching our face right before we do it. If we are stuck at home, you’ll relieve yourself from boredom for an hour or two 🙂

Supplies:

Step 1: Assemble BitWear

BitWear is a low-cost compact accessory for micro:bit users to make fun wearable gadgets.
There is a vibration motor, a buzzer and an addressable RGB LED on board, all designed for your fun wearable projects. The board also allows you to turn off the motor and pixels with switches so you can use the touch pins or the breakout holes for other uses.

The assembly takes less than 5 minutes and really easy even for primary school students. You can consult the video above for assembly instructions.

Step 2: Coding

Coding

We will use Microsoft’s Makecode to compose a simple yet useful program for our little Micro:bit wearable gadget. Our goal is to make it vibrate/show a scary coronavirus image when user touches his/her face. How can we know when user touches the face? Well, we can record the accelerometer reading in the specified position (hand near face) and then after accounting for some variations compare it with accelerometer reading now. If there’s a match, we sound the alarm.

Let’s start by enumerating the steps in the algorithm:

  1. When button A is pressed, we show an image on the screen to notify user about measurement success and record accelerometer y-value in the list pos1. We record the original value and also all the values in range +/- 10. You can change that number to increase/decrease sensitivity.
  2. We compare elements of the pos1 list to actual real-time values output by accelerometer and if there is a match we either a)turn on vibration motor for 500 ms b)show scary face on LED matrix, depending on the value of “silent” variable.
  3. When button B pressed, if variable silent is 0 (vibration motor mode), then we set it to 1. Otherwise we set it to 0. This way we can switch between vibration/LED screen mode.

And this is it really. Have a look at the demonstration video on how to use it and you’re good to go.

Here’s a copy of the code

Step 3: Improving

There are some improvements to code that can be made. You could take accelerometer measurement immediately after reset and then use A button to tweak the sensitivity for example. Or add some sound effects. Or add remote monitoring with Bluetooth. Or add counter to see how many times you touched/wanted to touch your face within specified period of time.

All these things are yours to code and make! If you do think and implement some interesting features, share in the comments below.

For more Micro:bit accessories and other hardware for makers and STEM educators, visit our official website.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s