Microbit - Myoware Muscle Sensor
by Thorsgaard Efterskole in Circuits > Microcontrollers
1284 Views, 2 Favorites, 0 Comments
Microbit - Myoware Muscle Sensor
This is just a quick guide to show how you can connect a Myoware Muscle sensor to a micro:bit. The Myoware sensor can sense the tension of muscles, which is pretty cool, since it allows you to control your projects with your muscles.
Supplies
1 x Micro:bit
1 x Motor:bit
1 x Myoware Muscle Sensor
1 x 9 volt battery + battery holder
3 x Jumpwires (Male to female)
3 x Jumpwires (Alligator to alligator)
3 x Disposable Surface Electrode
Some wire (I use some in white, black and red)
Tools:
Soldering tools
Wire cutter
Soldering Wires to the Myoware Muscle Sensor
So the first thing you want to do is to solder some wire to the myoware muscle sensor. From now on I shall just call it the muscle sensor.
I soldered
red to + (Voltage)
Black to - (Ground)
White to the last hole
Put the Electrodes on the Micro:bit
Wiring
Use the jumper wires to connect:
+ (Red/Voltage) to 5 volt on the motor:bit
- (Black/ground) to gnd on the motor:bit
Data (White wire) to pin 10 on the motor:bit
In theory the myoware sensor should be able to run directly from the micro:bit, but I find that its performance becomes to bad to really be useable.
Also connect the battery holder and battery to the motor:bit.
Programming
The programming is rather easy. Remember I am danish, so the lanuage in the prorammer is sadly in danish.
First we go to the Makecode editor and start a new project.
We use AnalogRead on pin 10 where the myoware sensor is connected. The muscle sensor will give us a number betwen 0 and 1023, so we use the "map" block to get a number bewten 0 and 9 instead. We want the number to be a whole number, so we use the "Round off" block. We then show the number by using a "Show number" block in a "Forever" block.
You can also just find the program here.
Now Test It
Put the eletrode pads on a big muscle group and try it out.
The myoware sensor is actuelly really sensitive when you use it with 5 volt and you will get a whole new level of awareness about when you tense or relax your muscles.