Introduction: Arduino Driven Balance Board
We build here a Computer connected balance board.
I am currently working on a new Version, where you not longer need Processing!
You can then, with your "balance", control a board on the PC where you can collect coins and reach the next level.
A unitypackage is included.
Let s start,,,
Step 1: Collect Stuff
You need the following Materials to start:
Balance board, where you can open the top.
Arduino Uno (I use it)
MPU 6050 Gyroscope Board
Something to mount the Arduino and the MPU 6050 (I use a cheap circuit board)
USB AB cable 3-5 Meter is good.
simple drill machine.
I have a basket here on reichelt.de but without the MPU 6050 and Balance board.
They have also a big sortiment for makers:
The balance board and MPU 6050 board i grabbed from ebay. For example:
Software you need is Processing, Arduino, Unity 3d (it is big, but it is worth to download it)
http://unity3d.com/get-unity (Personal Edition is free)
Here you can grab the unitypackage and the Arduino - Processing files. Also you need some libraries to install which i describe in the instructable (You should put all in an own folder):
The basics for my tutorial are from here:
Do not be scared, it is easier you think!
Step 2: Prepare the Balance Board
Remove the cap from the balance board and you see a big black hole :)
It is a good place to put some stuff in.
Arduino UNO and the MPU 6050.
First i drill a hole with ca. 12mm driller, so the plug from the USB-Cable can dive in our black hole.
You should use a position, where do you mean this is a good place to identify the front later.
The Arduino UNO is placed on the ground, and should first fixed with hot glue, or something, when it is working, not before.
Where the USB Cable leave the edge of the board you should make a little dent, so the cable are not damaged when hit the ground during balancing. I use a cable clip for this with a cable strap.
For the MPU 6050, there are 2 connectors dual tilted and straight. Choose what do you think it fittest best and solder the connectors. I use dual tilted.
Now on the next step wiring the Arduino UNO and the MPU 6050 together in the next step.
Step 3: Marriage the Arduino UNO With the MPU 6050
See the Image above.
The image is from.
Check your connections twice!
Install some guru Software stuff and feel a professional on the next step.
Step 4: Install All the Software and Do Some Tests.
Install Arduino Software and libraries:
After installing Arduino extract
copy the I2Cdev (Is in the Arduino folder) folder to Arduino library folder:
On my PC: C:\Program Files (x86)\Arduino\libraries
Then copy the MPU6050 folder also to the library folder:
On my PC: C:\Program Files (x86)\Arduino\libraries
When you now start the Arduino Software and you see when you go to File -> Examples -> MPU 6050 -> MPU6050_DMP
you have done it right.
Now connect the Arduino to an USB Port and extract:
MPU6050_calibration_v1.1.zip and click/open MPU6050_calibration.ino
From now on the MPU 6050 should are absolute precisely lie on a ground.
Upload with click on the arrow the MPU6050_calibration.ino to your Arduino UNO and start the serial monitor:
Send a character or press c to start calibrating, nothing should move the MPU 6050, go away or do not move.
When all is running fine you get some values, you can store them in a notepad file for example.:
When after 5 minutes nothing happen, calibrate again.
When done, extract: MPU6050_DMP6_T and open MPU6050_DMP6_T.ino with the Arduino software:
Now you can add your calibrate settings to this file, for example :
// supply your own gyro offsets here, scaled for min sensitivity
mpu.setXGyroOffset(84); // replace with you values
mpu.setYGyroOffset(-39); // replace with you values
mpu.setZGyroOffset(-8); // replace with you values
mpu.setZAccelOffset(1401); // replace with you values
Ready? Then upload to your Arduino and go over to the next Step (Processing and Unity)
Step 5: Install and Setup the Processing File
Install Processing and extract: processing_MPU6050_serialport_to_osc.zip
Connect your Arduino to your PC and start the sketch:
When you start the sketch you should see a small window, it takes some seconds and the MPU6050 is initialized.
Do not move it in this time.
After initialization you can move your MPU6050 and the values should change.
Close all and disconnect the Arduino, take a break.
Then go to the next step and do some unity3d related stuff.
Step 6: Install and Setup Unity 3D to Have Some Fun
Install unity take some time.... .... .... .... .
After installing start unity and make a new 3D Project name it like you want.
Then go to Assets -> import packages .> custom package and use MPU_Balance.unitypackage
what you have downloaded from my site before.
load a scene ( ball ) from folder Assets.
For a first test, put the balance board for your feet, you can sit for a first test.
Then make sure the balance board is showing to front. (Where do you know position of the MPU6050 is showing to front)
May be you have a marker to mark it. :)
OK do not step the Balance board. First start the processing sketch and start it, after initialization start your unity scene by pressing the play button. When all running fine you can now tilt your Balance board with your feets and collect coins, when you hit the green cube, the next level is loading. Every coin give some score for motivation.
Have fun to make new Level and Obstacles. And always! Safety first!
Make sure you have enough space when falling from the board.
For first steps someone should help you balancing.
Some known issues: When flipping to hard, the ball is falling through the collider, and you have to restart the scene.
The Project is an example to show you what is possible.
This is possible :)
When you run in trouble, fill the comments and i try to help.
We have a be nice policy.
Please be positive and constructive.