Skip to main content

The MyoTyper

MyoTyper

InventorLana Novicic
micro:bit IDEMakeCode Editor
Best LocationClassroom

Difficulty​

HardwareEasy
SoftwareMedium

Special Requirement​

SG90 Micro ServoRequired
Glue GunRecommended

Project Overview​

Myotyper is a keyboard that uses EMG technology. Write only by flexing your muscles! It could be hooked up to your leg so you could write without using your arms.

Build Instructions​

Materials​

Materials

  • 1x spiker:bit kit (spiker:bit, 3x electrodes, and 1x orange cable)
  • 1x micro:bit
  • 1x servo kit
  • 1x glue gun (or tape)
  • 1x colored paper
  • 1x pen
  • 1x clock hand (wood stick)

1. Choosing strew material​

Picture of first step

Choose something you will use a clock hand. It could be a straw, part of a three branch or you can 3D print it! (just make sure it's lightweight).

2. Glue servo to paper​

Picture of second step

Take a sheet of colored paper and servo motor. Glue the motor to the paper as shown in the picture.

3. Attach attachment to servo​

Picture of third step

Grab attachment from the bag came with servo kit (any one of them is okay to use). Then attach it on top of the servo. No need to screw.

4. Glue clock hand​

Picture of fourth step

Place the attachment onto servo. Then, glue the clock hand (wood stick) to the servo hat to align it with the servo motor attachment.

5. Write letter​

Picture of fifth step

Write the code and come back when you're done. Flex your muscles once to move the clock hand and simultaneously write the letters as you move it.

Code​

Below is the completed code in micro:bit.

MyoTyper
letter = ""
letterIndex = 0
servoAngle = 0
numOfPeaks = 0
premg = 0
emg = 0
spikerbit.start_muscle_recording()
pins.set_audio_pin(DigitalPin.P2)
servos.P0.set_angle(0)
recordedTime = 2000
textList = ["!",
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z"]

def on_forever():
global numOfPeaks, servoAngle, letterIndex, letter
numOfPeaks = 0
music.play(music.tone_playable(262, music.beat(BeatFraction.WHOLE)),
music.PlaybackMode.UNTIL_DONE)
basic.pause(recordedTime)
numOfPeaks = spikerbit.num_peaks_in_last(recordedTime)
# 1. move up
# 2. select
# 0. show
if numOfPeaks == 1:
servoAngle = servoAngle + 6
servos.P0.set_angle(servoAngle)
elif numOfPeaks == 2:
servos.P0.set_angle(0)
letterIndex = servoAngle / 6
servoAngle = 0
letter = "" + letter + textList[letterIndex]
elif numOfPeaks == 0:
basic.show_string(letter)
letter = ""
basic.forever(on_forever)

Operating Instructions​

  • Plug the motor cable into the Spiker:bit. Stick the electrodes to your arm and connect them using the orange cable.
  • Download the code onto the micro:bit and start it.
  • Relax your arm and squeeze your muscles after every beep to change the letter.
  • When you reach the letter you want to select squeeze twice. After each letter is selected the clock hand will automatically go back to the beginning.
  • To write out the word just relax your hand and wait a few seconds and the word should appear on the micro:bit.
tip
  • It takes a bit of time to get used to it but the beat helps in catching the rhythm
  • You can also change/adjust the number of muscle contractions for different functions however you like