EMG Game Console
Inventors | Aleksa Zdravković, Jovana Mrđa, Vukašin Berner, Vuk Velemir |
micro:bit IDE | Python Editor |
Additional IDE | Arduino IDE |
Best Location | Makerspace |
Project Overview
The "EMG Game Console" is a platform for creating retro games that you can play with your muscles (and maybe even your eyes). We’ve created an example game, but feel free to come up with your own ideas and extensions! 🕹️
In our Tug of War game, Spiker:bit devices measure EMG signals from the forearm muscles of two players, simulating a tug of war game both on a screen and on a physical model.
Electrodes on your forearm measure EMG signals, essentially interrupting the brain’s message to your muscles when you contract them, and send this data to the Spiker:bit.
The Spiker:bit then uses math ✨ to calculate the position of a flag on the tug of war rope and filters out any janky movement.
Materials Needed
- 2 x Spiker:bits
- 2 x micro:bits
- 1 x SG90 servo motor kit with horns and screws
- 1 x Seeed Wio Terminal
- 1 x microSD card (1GB is sufficient)
- 1 x 3D printed parts
- 1 x A piece of string
- 1 x Grove cable
- 4 x AA batteries
- 2 x BYB muscle cables
- 6 x gel electrodes
- 1 x USB C cable
- 1 x micro USB cable
- 1 x Power bank / external USB power supply
- 1 x Arduino IDE v2
- ∞ x Enthusiasm 😄 Additionally, there a re a few files in the forms of .STL and code. These can either be found via downloading this zip file: Attachments.zip or in github, here: GithubFolder
3D Printing
Before connecting the electronics, we should slice and start printing the files. If you don't have a 3D printer (bummer), you can still play the game on the Wio Terminal. If you don’t have the Wio Terminal, you can still create the physical extension (or do both if you have both).
- 3D print all parts located in the
TugOfWarGame
folder of the attached ZIP file. Apply supports as needed.
- If you don’t have the Wio Terminal: 3D print all parts in the
GameConsole
folder. Note that some files need to be printed twice, and you need to apply supports.
- Thoroughly clean the parts from the supports after printing.
Connections
-
Plug the two micro:bits into their slots on the Spiker:bit boards (facing away from the Spiker:bit). Insert two AA batteries into each Spiker:bit.
-
Cut the red (power) wire of the Grove cable. We want to power the Wio Terminal externally.
- Plug one side of the cable into one of the Spiker:bit's "digital" Grove ports (the one with the SCL and SDA - i2c pins). This micro:bit is now the "right one".
- Plug the other side of the cable into the matching i2c Grove port on the Wio Terminal (the left one when the screen is up).
- Insert the microSD card into your computer and transfer the files from the
Assets/bmp
folder of the attachment.
- Insert the microSD card into the Wio Terminal's slot beside the power switch (pins toward the screen/facing up).
Console Assembly
-
Attach the Spiker:bit holders to the stand's flat side, with the openings facing outward.
-
Slide the plates into the grooves in the Spiker:bit holders and the stand to lock them in place.
-
Insert the switches, ensuring the higher side is toward the Spiker:bit sign and they are in the OFF position.
- Insert both Spiker:bits into their holders (the right one goes to the right one) with the ports facing outward. Angle them slightly and push them in. This might take a few tries, so do it one by one, paying attention not to move the switches.
- Snap the Wio Terminal into the display holder.
- Position the display holder so that the blue button is in the top left corner and slide it onto the stand.
Tug of War Extension Assembly
- Follow the pictures to assemble the tug of war part.
- Rotate the gear in the tug of war part and snap the white servo motor horn in place (a screwdriver might be helpful).
- Connect the servo motor’s cable to the right Spiker:bit, ensuring the letters on the micro:bit port (BlackRedYellow) match the colors on the cable.
-
Flash the temporary code using the micro:bit Python Editor from the file servo_calibration.py to the right Spiker:bit. This will center the servo to 90°.
-
Put the servo in its slot orienting it so it lines up with the horn, carefully centering the gear as well.
- Secure the servo motor in place with screws. Press upwards on the gear to ensure the horn is tight on the servo.
-
Cut a piece of string a little over 10 cm.
-
Thread one end of the string through the hole in the stickman’s hand and tie a knot. Thread the other end of the string through both holes in the flag and then through the hole in the other stickman’s hand, tying it in a knot.
-
Position the flag so that its bottom points to a mark on the tug of war part.
- Done, now the angle of the servo should be proportional to the position of the flag!
Software
-
Go to the micro:bit Python Editor (use Chrome for easier device connection rather than transferring the HEX file).
-
Open the
left_microbit.py
file in the lower right corner. -
Flash the left micro:bit by plugging it in using a micro USB cable and connecting to it in the lower left corner of the editor. Click on "Send to micro:bit" after connecting.
-
Open a fresh micro:bit Python Editor instance in a new tab and close the previous one.
-
Open the
right_microbit.py
file, as before. -
Flash the right micro:bit by repeating the procedure.
-
Open the
wio_terminal.ino
file in Arduino IDE. -
Connect the Wio Terminal to your computer using a USB C cable (you can disconnect the micro:bits).
-
Follow the Wio Terminal guide to set up your IDE for programming it.
-
Flash the code to the Wio Terminal, and voila, you’re good to go! 🚀
Operation
Once everything is assembled and coded, both players should follow these steps:
-
Place one gel electrode on the back of your hand (any bony part without muscle interference will do, like your elbow). Bend your ring and pinkie fingers while you search for the muscle that contracts on your forearm with the other hand. Place two electrodes on that muscle.
-
Connect the black cable clip to the electrode on the back of your hand and the two red cable clips to the other two electrodes.
-
Connect the orange cables to the Spiker:bits, with the left player (red cable) connecting to the left one and the right player (green cable) connecting to the right one.
- Plug the USB C cable into the Wio Terminal and the other end into a power bank.
-
Turn on the switches on both Spiker:bits. Remeber, these switches are on the bottom of the containers and near the middle.
-
When the display turns on, press the blue button to select the game.
-
Press the black button on the bottom of the micro:bit and then squeeze your muscle as hard as you can until the red tick mark appears on the micro:bit.
-
Now you can play by squeezing your wrists - the stronger you squeeze, the more the flag will move in your direction. Enjoy the game that NEVER ENDS. 🤗
Credits
The 3D modeling and printing were done by Alex Hatch (based on Jovana's incredible sketches), and the project was overseen by Chethan Magnan. We thank them from the bottom of our hearts for being such open and helpful people.