NRK Beta challenged us to create a gadget that can alert you if someone is closer than 1 meter. Here's the recipe.
Link to code and 3d/laser files can be found at the bottom of this post.

Watch smitte:bit in action on NRK2!
Here's what you need:
Simple version:
2 pcs micro:bit with battery
Thread
Tape
Advanced version:
2-4 LEDs
2 mini speakers
crocodile clips
Double-sided tape
Cardboard/scissors
or:
3d printer (Download STL files at the bottom of the post)
4 machine screws M3, 8mm or longer
4 pcs nuts M3
Smitte:bit consists of two micro:bits that are placed on two people. If the people are too close to each other, the screen will alert you. So how does it work?
micro:bit has a radio that can send and receive data. These signals become weaker the longer the distance between them. By measuring the strength of the radio signal, we can calculate the distance.
Signal strength is measured in decibels. A distance of about 1 meter can give -75 decibels, while 2 meters can give about -80 decibels. We program so that if the distance is shorter than about 1 meter, the screen will display an X. We find this by checking whether the transmission strength is stronger than -75 dB. This figure is approximate, so you should probably try it out.


The micro:bit's antenna can be seen at the top left of the back of the device.
Simple version
This is the code. Create it in makecode or go directly to our and transfer it to both micro:bits.
Tie a string to the holes on the side of the micro:bit and tie or tape on the battery pack. Hang the micro:bit around the neck of you and a friend. Keep a couple of meters away and approach slowly. Suddenly the screen changes to an X. What distance do you have when this happens? Note! The result may vary slightly. Radio waves are affected by many things and can be amplified or obstructed on their way.

Advanced version
You will need a cardboard holder that you cut out, or you can download and 3D print a ready-made holder that secures the micro:bit, battery pack, speaker, LED and rope together.
Here we connect LEDs and/or speakers. You can choose whether you want one or two LEDs.
We connect the speaker to P0 and GND
We connect LED 1 from P1 and GND (the long leg to P1)
We connect LED 2 from P2 and GND (the long leg to P2)
Use double-sided tape to attach the speaker to the bracket.
Screw an M3 screw through P2 and 3V to attach the micro:bit to the holder. You can attach the crocodile clip to the screw on P2 to conduct power to LED 2.

We used both a 3D printer and a laser cutter (3mm MDF) to make this, but you can also make everything on the 3D printer. You'll find the files at the bottom of the post.
How does it work?
When a voltage greater than -78 dB is detected, we start by flashing the LED. One receives a suitably strong current with the code analog write pin P1 to 750. At the same time, we play a short note on the speaker. You can easily change this note block by clicking in the white field or where it says "1/8 beat. Then we pause for 0.1 second before turning off LED 1 and turning on LED 2.
When we are no longer within a short distance, we want to turn off the notification. This can be found under the else block. Here we turn off both LEDs by setting P1 and P2 to 0. Here we also show the icon for "OK" or "Yes" as it is also called. The number at the end of the gray blocks is the time that the icon should be displayed. We have manually changed this to 20 milliseconds so that it does not delay the rest of our code so much. We had to switch to javascript to be allowed to change it.

We have tested two different colors and two different speakers. In the last version of the 3D file, you attach the speaker with double-sided tape.

Download the files here: