Introduction: Digital Wire Game / Hot Wire Game (with Microbit)

In this tutorial we guide you to build our digital wire game ("hot wire" in German). Compared to the analogue version of this game, it is enriched with a micro controller (a bbc microbit v2 in this case, but you can easily exchange that), which easily allows you to modify and extend the game.

For example, you can measure the time it takes to complete the round, implement a high score list, allow the users to touch the wire twice before finally loosing a round and so on and so forth. Modify the gameplay by changing the code! Or quickly replace the wires and thus change the levels. Possibilities are endless!,k

This game is not a complete beginners project, but also not too difficult to implement. Its huge potential is to demonstrate how much of the gameplay of a hardware based game can change by changing the firmware of the micro controller.

This is an ideal project for young and old to get in touch with micro controllers. It took father and daughter (9yo) around 1.5 afternoons to complete it (without documentation). For some steps, support by an adult is likely required.

Supplies

Bill of materials (BOM)


  • A piece of scrap wood, around 40x20x2,5cm
  • A Wire, 2-3mm thickness, 50-60cm long. We used an old coat hanger. Needs to be conductive
  • Thin wire, ca. 30 cm
  • Colored tape (for decoration, optional)
  • Isolating tape
  • Spray paint (for decoration, optinal)
  • Gaffer tape


  • Your preferred micro controller (we used a microbit v2)
  • 4 cables with crocodile jacks (your micro controller needs to handle them. Could be replaced by thin wire)


Tools you need


  • Saw
  • Knife
  • Strong wire cutter
  • Pliers
  • Battery drill, with 2-3 mm drill bit
  • Sanding tape
  • Rasp for metal
  • Rasp for wood
  • Soldering iron + solder
  • A wise comes handy, but is optional

Step 1: Metal: Prepare the Tick Wire

Prepare the thick wire. If you use a coat hanger, like we did, take the pliers and twist the coat hanger in order to undrill.

Use the the strong wire cutter to cut the coat hanger into four pieces. This step needed to be executed by an adult, due to the force required to cut the thick wire and also the risk of snipped off pieces flying around:

2 pieces, each 3-4 cm long. These will become contact pins.

1 piece, around 10-15 cm long, This will become the handle.

1 long piece, rest of coat hanger. This will become the level.

Use the metal rasp to smooth the the sharp edges. It might be easier if the rasp lays on the workbench and you move the piece of metal over the tool.

Use the pliers to straighten the pins, if they are not yet straight.

Step 2: Prepare the Board

Use the saw to cut off a piece off the side of the piece of wood. Piece will be come part of the handle, so your hand should roughly fit around it.

Use the rasp for wood to smooth the handle, and make it round, and also all other edges of the bigger piece of wood.

Use sand paper to smooth the handle and the board even further.

Use the drill to drill four holes into the bigger board, according to the pattern you can see on the pictures. A pair of holes, quite close (1-1,5 cm) to each other on the left side, another pair on the right side.

Use the spraypaint to give the the board a nice coat of color. Use a piece of paper below the board in order to to spaypaint your workbench. You also better do this outside.

Step 3: Assemble Handle

Use the pliers to first straighten the middle piece of wire (referred above as handle piece) and then form a small, but not too small rounding at one of the tip. In our case, the adult had to assist, due to the force required.

Use the wirecutter to cut around 30cm of the thin wire and use a knife to cut and remove the insulation from the ends of the wire. On one end of that wire remove a little more. Twist the thin wire around the thick wire and use the soldering iron to fixate both wires with each other.

If you have never soldered before, here a very small guide (you might want to look up specialized guides, esp also for safety instructions): use the soldering iron with one hand to fixate the two wires on a heat resistant surface. With the other hand, you feed the solder to the heated wires until a nice blob of solder is connecting both wires. Then first remove the solder and then remove the soldering iron and let the wires cool, maybe by bloating on it (also good to blow the fumes away).

Put the newly connected wires on the wooden handle and fixate once more by spinning the thin wire around the handle once. This serves as a pull relief. Then use the thick gafa tape cover Wires and handle with a few layers of tape.

Step 4: Assemble the Game

Now, the individual parts are ready and it is time to assemble the game.

Put the wires into the corresponding holes. If they do not fit tightly, you can wrap some tape around them to thicken them up and fill the drill hole nicely. For the level wire (the long one), also wrap some tape around the ends so the handle can rest there, but also pay attention to leave a little room below one side of the tape, so you can connect the crocodile clamps.

If you connect the crocodile clamps, three things are important:

  1. The clamps must sit well on the microbit side, so they dont shorten pins on the microbit.
  2. The handle must get connected with the GND PIN (we explain below why).
  3. The order of the other crocodile clamps is not as important. You just need to make a concious decision and stick to it, as the pins are reflected in the code. In our case, we connect PIN 1 with the level wire, PIN 2 with the pin on the right hand side and PIN3 with the left of our board.

Step 5: Code the Game

We do not explain the coding in every detail, but give you some concepts that bring you on the right track. You can find our sample code here.

The basic idea is that if the metal part of the handle touches either the level wire or one of the smaller pins, a current flows through the cables, which can be evaluated as events by the code in the microbit. As a current always runs between high and low potential (i.e. PINs 1-3 and GND), it is important that the handle is connected to the GND pin, as the handle will touch the different other wires.

If you use a Microbit v2, you need to change the pins to resistive mode.

In our version of the game, we allow one error before the game is lost of the player. In order to do so, we track the current number of errors in a variable, which we initialize on boot but also as soon as the handle touches the right PIN.

If the player touches the level wire with the handle, the code analyzes the current number of already committed errors and reacts correspondingly with a symbol and a melody.

If the player touches the left pin with the handle, and has less than two errors so far, the success melody is played.

Step 6: Enjoy and Improve the Game

Now you are good to play. Enjoy your game.

Of course, the real fun lies in tweaking and improving the game. Here is one idea for the next step:

You can implement a stopwatch in order to measure the time required to complete the game. In order to do so, I give you some hints: Microbit counts the number of microseconds since start. So, in order to measure the time for a game, you measure the time once the game starts and save that timestamp in a variable. If the game ends, you measure the time again and subtract the first timestamp from this timestamp. Divide that difference by a Million and have the time played in seconds.

Micro:bit Contest

Runner Up in the
Micro:bit Contest