#MyoCraft: Gesture-Enable Your Arduino Project With a Myo Armband




About: I'm a Developer Evangelist at Thalmic Labs! We make the Myo gesture control armband! My views are my own.

You can build a lot of cool stuff with an Arduino. Wouldn't it be nice to be able to control it with a flick of your wrist?

Let me show you how to add wireless gesture control to an Arduino project using a Myo armband. We’ll do this via MyoDunio (available for free in the Myo Market) running on a PC. This sample was built to connect up to the display you see above, but it's definitely not specific to it, and you can use it to activate any pin on your board.

Let’s go!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Requirements

Before we get started, you’ll need the following items.

  1. A Myo armband running the latest firmware
  2. An Arduino board like the Uno
  3. The Arduino software/IDE
  4. A Windows PC
  5. An Arduino project you want to to gesture-enable. We hooked our board up to a bunch of LEDs. If you're not sure, something basic like this would probably work.
  6. The MyoDuino project. You will also need the Microsoft Visual C++ Runtime, if you don't already have that installed.

Step 2: Import Sample Library

Make sure you have extracted the MyoDuino project somewhere. Open up the Ardunio SDK and add the MyoDuino/Arduino/Myo Controller folder as a library.

Step 3: Open the Sample

Import the MyoController example project.

Step 4: Set Up Your Arduino

The sample is set up to use pins 4-8, with one pin for each hand pose (wave in, wave out, fist, fingers spread, and double tap). When a new pose is detected, that pin is set to HIGH. When the “rest” pose is detected (which generaly happens between every pose), all the pins are set to LOW. You can either make sure your project works with that setup or..

Step 5: (Optionally) Change the Sample

(The above code is copyright 2014 Thalmic Labs Inc. and licensed under the MIT License)

If you don't like the pin activation scheme, change the sample. If you check out the code (attached) you will see it's pretty straightforward to change which pins are activated by which gesture. Just change the defines up top.


#define FIST_PIN 4

could be changed to

#define FIST_PIN 5

to make the 5th pin active on a fist.

All five Myo poses are supported. You can use as many or a few as needed.

Step 6: Upload Your Sketch

Upload the project to your Arduino via USB, and leave it connected.

Step 7: Launch MyoDuino

Make sure you are wearing your Myo armband, it's connected to your computer via Bluetooth, and your are synced. Then, navigate to MyoDuino/bin/ and launch MyoDuino.exe. Set the COM port to the one your Arduino is on (you can see this in Tools->Ports in the Arduino IDE). It’s up to you whether you want locking to be on or off, but I recommend off for our test.

Now you should be staring at a terminal window. It will tell you which arm you are wearing the armband on and the current gesture (for debugging purposes). Make sure this window is in the foreground, and start making poses!

Step 8: Next Steps

Easy peasy. This was a pretty simple hack, but it’s a good place to start.

From here, you could obviously go crazy with complicated Arduino setups, but you could also modify the source code of MyoDuino itself. The Myo Armband has a built in 9-axis IMU that normally captures arm motion, but isn't being used here. By expanding MyoDuino you could create motion gestures to really open up your control options.

You could also build your own pose “edge” behaviour, like you see in Myo Scripts (Meaning that you get one event when a pose is started, and another when one stops). As it stands this will keep setting the relevant pin to HIGH over and over as long as you hold a pose, which may not be ideal for your application.

Finally, if you want to enable casual usage you could tweak the locking behaviour so it won’t lock you out in the middle of a pose.

That's all beyond the scope of this guide though! If some of those ideas sound interesting to you, you can get started at http://www.myo.com/makers

Automation Contest

Participated in the
Automation Contest

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    17 Discussions


    4 years ago on Introduction

    That's awesome! Like you said at the beginning you can build anything with an Arduino!


    10 months ago

    the link to the myduino project seems to be broken. Are there any updated links?


    1 year ago

    hi , can i use myo with HC 05 bluetooth?


    1 year ago

    i want to ask,how to coonect myo to arduino without pc , direct bluetooth


    2 years ago

    Hi There,

    Thanks a lot for this informative article. I followed the steps outlined and could get to Step 7, where I have to lauch MyDuino to connect to Uno on the COM port that Uno is running. Whenever I try and do this, I get an error "Serial Port Cannot be opened". Uno by itself is functioning fine and so does Myo. However, I am stuck on step 7 where the gestures from Myo are communicated to Uno. Please help.


    2 years ago

    Usando la Librería puedo realizar cualquier programa?

    Quiero mover unos servomotores.. alguien que me pueda ayudar?

    quien me puede dar una idea o de mas



    3 years ago

    is there any gesture beside this 5 gesture that i could make with myoarmband?


    3 years ago

    Hey, Paul.

    A high-school myo-developer here.

    While we(as a group) are trying to hook up a bluetooth module to our arduino uno board, we thought we might as well receive the signals straight from the arm band to our arduino board.

    We tried many things, but couldn't really figure out what we might need to do in order to "make things happen."

    Please help us with this matter, and if you have the time, could you help us with pairing our arm band with another bluetooth module?

    Thanks - WMI


    4 years ago

    Are there any other guestures available?


    4 years ago on Introduction

    Works great! But I was wondering if there is a way to do this without the Arduino being connected to the computer directly. Maybe using a Bluetooth module on the Arduino to communicate with the Myo? Do you know where I could find info on how to do that?

    2 replies

    The Myo Bluetooth protocol is published here: http://developerblog.myo.com/myo-bluetooth-spec-released/

    As far as I know, no one has implemented it and released a library yet though. I don't think it would be that hard, but the big thing to watch out for is making sure your bluetooth module is actually able to operate as a BLE client. From what I've seen, a lot of BLE capable modules can only act as a host, and even if the hardware can do client the libraries provided by the vendor aren't quite there for client mode.


    4 years ago

    Amazing! Imagine what this could do for the deaf community!