WorkIt!- an Arduino based wristband motion controller

WorkIt! is an Arduino based motion controller using an MPU-6050 for motion detection, and an HC-06 Bluetooth module for communication with the Android host Program. I’m Just going to explain what the project is all about, and outline exactly how you can create your own.

WorkIt! started out as a simple motion based fitness tracker and motivator that we could make and program for Y-Hack, which i posted about previously here. We eventually realized that the idea was pretty similar to Fitbit, but with a lot more fine detail over the motion of the arms. So, while our y-hack project had to do with fitness, the units can be used for any motion control, and we will most likely continue the project as some sort of video game controller.

Hardware

The main Parts list is as follows: ATMega328P HC-06 Bluetooth module MPU-6050 Triple axis Accelerometer&Gyro 7805 voltage regulator Two 10 μf capacitors Two tactile switches, Four leds w/ current limiting resistors 2×3 pin icsp header WorkIt_schemThe above schematic shows pretty much everything that is involved circuitry wise. It is basically the basics of a breadboard arduino with the bluetooth module, some leds, the 6dof IMU, and the vibration motor for haptic feedback. In this case I utilized the ICSP method of programming the mcu, but you could just as easily go with the bootloader/ftdi route, the only difference being that you would have to move the BT serial pins to some other digital pins and use the software serial library as opposed to the built in hardware.

20131210_120335

After all of the hot gluing, sewing and soldering, the modules came out like this.

MPU-6050: The 6 degree of freedom board that we used was the MPU-6050, which gives both acceleration and rotational velocity in each of the three axes. It communicates over I2C, and provides 16 bit readings over a bunch of different scales of measurement. It was really good for this application because it was super cheap (~$5) and easy to use. HC-06: The HC-06 is a nifty little bluetooth board on a breakout that gives a lot of good features in an easy to use package. The breakout board is nice because it makes the actual module 5v tolerant, and is only slightly more expensive than the non-breakout version. The board has 4 communication pins, 2 for serial (TX,RX) and 2 for alternative functionality. There is a state pin, which goes high when you have paired the device, and a key pin, which you have to set high at specific times in the boot cycle to enter the device into AT command mode, the baud rate of which is determined by the sequence you use to pull the pin high. Trust me, just look in the datasheet, its all there. In retrospect, i would have gotten the HC-05 instead. They have exactly the same hardware, but with different firmwares. The 05 is much more flexible, with a larger set of AT commands, and it can be both a slave and master, which the 06 cannot. I have been using the 05 in newer projects and have been much happier with it. You can find some good information about both here.

Firmware

The idea behind this, in terms of what we were able to actually implement at Y-hack is pretty simple, do some exercises such as jumping jacks or punches, read the IMU data to get a feel for how the data should look, and create a very simplistic profile of the activity.

IMG_0087

Robert spent a lot of time looking at numbers and punching towards his laptop screen

The activity gets easier to analyze when you are wearing both bands. In the time we had, we literally just checked for extreme values of data over time and sent a string of the activity name over bluetooth(jumping jacks and punches). Eventually, we would want to do some sort of training of the gestures via a Hidden markov model/bayesian classifier.

Android Application

The application side was written mostly by everybody except me, as I had my hands tied with like 14 hours straight of soldering and writing the firmware. Mainly the app consisted of a core set of features Bluetooth data parsing, GUI stuff, and  Wolfram alpha exercise statistics, worked on by Robert, Michael and Jazmine, respectively.

Basically, the cool part is the wolfram alpha Mathematica api. I didn’t actually work on it, so I may be butchering this, but essentially, Mathematica has all of these great functions to query the vast knowledge that is stored within wolfram alpha. For our purposes, we used it to set goals of calories, or times, and utilized the functions to figure out how much time/how many reps were needed, or how many calories were burned. This was different for each exercise we had, which were jumping jacks and punches. We were pretty enthralled with the api and it’s power.

Overall

We did not end up getting to the finals, but we generated a lot of interest in the project, and it definitely sparked our interest in the hackathon community, as well as hardware/software combo projects.

Any-who, you can find the code for the whole project here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s