🎃Happy Halloween Sale🎃Get 12% Off For All Order

How to build a device of detecting the distance with a micro:bit

Purpose

The novel Coronavirus is still existing in the world and we need to make sure the social distance be kept in public areas such as in hospitals or banks. This device will warn people who do not keep enough distances to others.

Materails

micro:bit x 1

Wukong expansion board x 1

Sonar:bit x 1

3pin wire x 1

Rivets x 2

Bricks x N

Assembly steps

Install the bricks to Wukong board with the parts as the picture shows:

The connect sonar:bit with the rivets and the 3pin wire.

Hardware Connections

Connect sonar:bit to the P0 port on Wukong board.

Software programming

Go to MakeCode editor:(https://makecode.microbit.org/#editor)Add Wukong extension from the settings on the right upper conner.

Add the extension package of neopixel.

Coding

Initialize the RGB on the Wukong board in the on start brick.

Save the variable of the sonar bit as “i” in forever brick.

Judge if “I”is between 3~100, if yes, set the RGB as red; or set it in green.

Complete code

Link:https://makecode.microbit.org/_bogg4T9KgbVo

Completed! Now we can find a wire to have the device hung on our body to keep the social distance with others.

Result

It lights up in red if someone is within one meter away from you or it lights in green.

Leave a Reply

Your email address will not be published. Required fields are marked *

images
In March, ELECFREAKS supported 5 schools to carry out school science and technology festival activities
images
Children’s Programming Education is the Future Trend
images
Technical verification! Nezha series products can complete WRO competition tasks
images
Let's take part in the Ceremony of the New Factory of ELECFREAKS together!
images
Bluetooth Bee(HC-05 and HC-06) User Guide
images
In March, ELECFREAKS supported 5 schools to carry out school science and technology festival activities
Monthly Archive