In addition to the ready made devices like LEAP or Myo, you can use an Arduino together with various sensors to detect gestures and movements.
Accelerometers, Gyroscopes and Magnetometers
You can detect different types of movements using the following sensors:
- Accelerometers – Accelerometers detect acceleration. You can get versions with different number of axes. Accelerometers are often used as tilt sensors or vibration sensors.
- Gyroscopes – Gyroscopes measure angular velocity AKA the speed of rotation. You can use them to detect the velocity and direction of rotation. Gyroscopes also often can measure multiple axes with the same sensor.
- Magnetometers – Magnetomers detect the Earth’s magnetic field. They work essentially like a compass. You will need an acceletometer to be able to compensate for the tilting of the device, if you can’t keep it flat.
IMUs – Inertial Measurement Unit
In order to get the actual orientation of an object (for example for a self-hovering quadcopter, or detecting a dancer’s body movements) you need to use a combination of the sensors above. You can get various ready-made boards that include some sort of combination accelerometers, gyroscopes and magnetometers. These devices are often called IMUs (Inertial Measurement Unit).
Adafruit 9-DOF Absolute Orientation IMU Fusion Breakout – BNO055
In Media Lab, we have one of the Adafruit BNO055 boards. It’s a very nice IMU that also comes with a very nice library that allows you to get the raw sensor values or the calculated orientation angles.
- See the Adafruit tutorial for more details
- Use with the Arduino Fio to make it wireless (details below)
APDS-9960 RGB and Gesture Sensor
The APDS-9960 RGB and Gesture Sensor is a nice little sensor that is able to do proximity sensing, RGB light sensing and gesture sensing (simple gestures like swipes).
ZX Distance and Gesture Sensor
The ZX Distance and Gesture sensor allows you to detect the distance of a hand (or an object) up to 30 cm from the sensor, the X location in a roughly 15 cm area, and some simple swipe gestures.
Making Your Sensors Wireless
There are many different ways to make your Arduino wireless: Bluetooth, WiFi, LoRa etc., but still my favorite radios are the XBee radios. They work really well, have a nice range, don’t require any pairing and come in all kinds of different configurations. An easy way to use the XBee radios is together with the Arduino Fio boards.
What is so good about them:
- Built-in XBee socket
- Built-in LiPo battery charger
- Nice and small board
- Compatible with the Arduino IDE
What is not so great about them:
- The USB port is used only for battery charging. You need an FTDI breakout board or something similar to program it.
- Runs at 8 MHz, which is slower than your standard Uno. Not really a huge issue for most things.
- They are fairly small, but could be even smaller.
- Only one serial port that is used for the XBee communication.
The updated version of the Fio includes many improvements.
- Uses the ATmega 32u4 chip instead of the ATmega328
- The USB port can be used for programming the board, not just for power and charging.
- Can be used as a USB keyboard, mouse or HID device in addition to the normal serial port functionality.
- Extra serial port
- More analog Inputs
- More interrupt pins
- Pins are in a different order to the original Fio, so any custom boards you maybe have are not necessarily compatible between the old and new versions.
- You need to install additional board definitions from Sparkfun (really easy though in the new version of the Arduino IDE).
- Wireless reprogramming is not possible (or at least I haven’t figured out a way to do it)
- Still runs at 8 MHz (not really an issue for most things)
XBee Radios (Series 1)
The XBee radios are the actual thing that will make the Fios wireless. For most cases where you just want to send data back and forth from the Fios to your computer, I recommend using the XBee Series 1 radios. The Series 2 are much more complicated to use and you will only really need them if you are building a more complex wireless network.
They come with different antenna options. All of them will work as long as you get the ones that say Series 1 or S1 on them
XBee USB Adapter
You will also need a little board that has a socket for one of the XBee radios and a USB connection so that you can connect it to your computer. The XBee Explorer USB board from Sparkfun is a pretty solid option.
Configuring the XBee Radios
You have two options for configuring the settings on the XBee radios.
- Easy way: The XBee Config Tool from the Funnel package. Download the latest funnel zip-file (funnel-1.0-r806) and you can find the configuration tool in the tools folder.
- Slightly harder way: The official XCTU tool from Digi (the manufacturer of the XBee radios)
- Plug the USB Explorer to your computer with one of your XBee radios.
- Open the XBeeConfigTool.
- Select your serial port (usbserial-XXXXXXX).
- Configure the first radio as an Arduino Fio radio (this XBee will be always connected to the Arduino Fio).
- Set the Baud rate to 57600.
- Write in a unique PAN ID (this will be the way your radios know which radio to talk to). In this case it is 2017.
- The other settings (MY ID and DL ID) will automatically change.
- Click Configure
- Unplug the XBee radio and plug it into the XBee socket of your Fio.
- Now place your other XBee radio to the XBee Explorer USB.
- This time set the mode to Programming radio.
- The baud rate and the PAN ID will be the same as above. (MY ID and DL ID will be set automatically).
- Configure the proramming radio and leave it plugged in the USB board.
- You are all set and now anything you print on the Fio should come through to the XBee connected to your computer.