MicroBit Concentration Game

by jillianbaker in Circuits > Microcontrollers

3408 Views, 27 Favorites, 0 Comments

MicroBit Concentration Game

213CE2A8-E1F3-4CCC-834D-AD48B511985A.jpeg

This Instructable will show you how to make a concentration game using a MicroBit. This is going to create a metal shape and wand to have a reaction when the wand touches the metal shape. Inspired by carnival games and wanted to challenge my students.

Supplies

Items needed:

MicroBit - any MicroBit will do. I have sets from FiriaLabs that come with everything you need, but you can also get MicroBits from their website or Amazon. (any option should include the battery pack)

Battery Pack - should be included when you buy MicroBit

Speaker (optional)- if you want it to make a sound when touched. I used the one that FiriaLabs puts in the box.

Alligator Clips - (2-4 needed one should be long) I used 39" long set from amazon. If you want a buzzer you will need 4 alligator clips.

Metal Wire - I used floral wire from the DollarTree any should do, in store you can buy just one for a dollar.

3D printer for base - I made a base to hold all items in TinkerCad and printed on a MakerBot printer.

1. Make Your Metal Shape

paperclip dog.jpg
C4DFB4AA-E7E7-41F6-BCB7-9D63A09F0E57.jpeg
767CBCC2-1EB2-494C-8441-3E48CEA7CA5A.jpeg

I used floral wire from the Dollar Tree and searched Google to find paperclip shapes, you can also search for silhouettes. While this shape has a nice outline, I only need the outline and would want the start and stop point to be around the foot, so it will stand on my base. Start by bending your metal around your outline to make your shape. You need to have an extra couple inches hanging down from your shape for the beginning and end. This will allow you to connect the alligator clips to the shape. (I find it helpful to print the image and bend wire on a flat surface.

2. Make a Wand

8621F85C-5FCA-4D28-8781-0773CD741413.jpeg
7B6DC5D9-C759-4456-898C-16E166FBA638.jpeg
C150A87F-13C4-4B24-967F-C7CB7585648E.jpeg
AF64BAD2-6769-4EDE-A73A-82BADF6677C2.jpeg

Next you will need to make a wand. I use the same floral wire as in the first step. I just took a long piece of wire and bent in half turning the wire around to make the handle. Make sure to leave the loop large enough to go around the metal figure. You can also just make a loop at the end if you are short on wire.

3. Make the Base to Hold Everything

CodeBlock 1.png
CodeBlock 2.png
CodeBlock 3.png
CodeBlock 4.png

I used TinkerCad CodeBlocks to make this shape. The STL files are also attached.

You will need to Click on "CodeBlocks" on the left hand side. Then you can use my code, I have made comments where you may need to change the code. I also made a base in regular TinkerCad ("Baker MicroBit Challenge Base") also attached.

4. Program Your MicroBit

MicroBit code.png

I used Firia Lab's CodeSpace to write my code. This program has a free option but lessons and more options come when you purchase your MicroBit from them. This is a Python based code and you can see the code below. The code says to make a big X turning lights on and off. Then start with a smile face, if the wand (Which is attached to port 0) touches the shape (which is attached to port 1) then show X and make a sound.

from microbit import*
import music

big_x = Image( "90009:" "09090:" "00900:" "09090:" "90009:")

def start_alarm(cause): music.play(music.FUNERAL, wait=False, loop=False)

display.scroll(cause, wait=False, loop=True )

def stop_alarm():

music.stop()

display.clear() pin1.set_pull(pin1.PULL_UP) # Make sure pin is "pulled high" normally

while True: if pin1.read_digital() == 0: # Is this pin being "pulled low" by the wand?

start_alarm("Test")

display.show(big_x)

else:

display.show(Image.HAPPY)

5. Connect Everything

985D035F-BA03-4AE6-8E2E-6D554D7838AC.jpeg
23C05303-B9D5-4263-85B3-675D68EBA633.jpeg
5DC3199A-6116-489A-9B07-CE76D8963A6E.jpeg
43AF835A-D4A6-436D-8D1C-4739639D662A.jpeg
0B015E15-B5B6-4C01-867E-02EC84933EF0.jpeg
0E3045D5-3B46-49A8-A7B3-5EF0B77B79D3.jpeg
4B591865-A843-4AD0-9120-77AAF28DEB71.jpeg
4A5DB053-6D63-4503-9707-A977D547E074.jpeg

The metal shape will fit in the holes on the top of the base. You need to have the wire feed through the hole, connect an alligator clip to port 0 and the other end to the metal shape(there should be some hanging down inside the base). Then connect the wand to the GND (ground), I find it helpful to have a long alligator clip for this, it allows you more flexibility to go around the shape. If you are wanting to add sound, you will need to add a speaker with alligator clips to port 1 on one side and the other side of the speak is also clipped to the GND. The battery pack fits on the shelf in the bottom of the base.

MicroBit will show a Smile until the wand touches the shape. Then you will see an X and if you have the speaker attached it will make a sound.