3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Easy build self balancing electric skateboard

Step 19Electronics

Electronics
NOTE added Feb 2012:
See my comment on intro page regarding use of a 6dof "Razor" IMU from Sparkfun instead as this 5dof one is becoming difficult to obtain any more.



Original text:
There is a 5 degree of freedom inertial measurement unit (IMU) from Sparkfun.
This is cheapest one they do that will do the job - a situation that is always changing by the way.

It has a 3 axis accelerometer. We will only use one of these.
It has 2 solid state gyroscopes. One is used with the accelerometer (using a "combination" filter) to make the thing balance.

The other is used to allow machine to resist sudden changes in direction (one wheel hitting a pebble for example) so it does not spin you off. This is easier and more reliable possibly than using wheel speed encoders which is the other way to do this.

I like ribbon cable as it is neat. I also use blu-tack when doing this sort of soldering as it holds wire in exactly the right spot as well as holding the little circuit board still.

I tin the wire ends then solder them to the holes.




NOTE: Someone has already found a cheaper (different) IMU here:
www.gadgetgangster.com/find-a-project/56.html
You would have to work it out for yourself and modify code perhaps but it also looks ideal for a project like this. It is amazing how these things have come down in price. The one-axis gyro in my monowheel was about £100 ($150) on its own.
« Previous StepDownload PDFView All StepsNext Step »
6 comments
Aug 6, 2011. 10:16 AMmiguipda says:
Hi John,

thanks to share your arduino segway like project. Because I also think to make a segway like but my knowledge is limited in electronic. I am sure I can do it with an arduino and I enjoy to read your project.

Just two thinks I need to ask you and may be that will upgrade your project :

1) At 1:19 on this video we can see that a segway use five gyros : http://www.youtube.com/watch?v=OVCzB1AZPA0
may be for front to back + left to right + one wheel up or down the other.
What do you think about this ? I mean if your "segway" like have one wheel a little a bit up the other does it continue to run anyway ? If well what the need of five gyros on the real segway ?

2) to answer to your question concerning the fact to reduce the cost of your segway like I just discovered this gyro reduction. In place of paying it 100$ you can build it to 8$ (as he said) : http://underfinished.blogspot.com/
May be can you give us your project with this use.

3) Do you think that overclocking the arduino can help for the answer time or unneeded ?

4) Can the one chip arduino be cheaper and or more useful (consumption with some LiPo battery in place of weight battery) ?

Sincerely thanks for your informations and have a nice day.

Miguipda ;-)
http://www.geocities.jp/arduino_diecimila/obaka/project-2/index_en.html
Apr 8, 2011. 9:26 PMkriogenic says:
Hey there, I am going to experiment but I was wondering if you knew if this IMU unit would be applicable.

http://www.sparkfun.com/products/9250

I have no idea really but think it will be fine without the capabilty of resisting sudden turns?
Apr 20, 2011. 6:13 AMkriogenic says:
Hey there,

I got a few things for this project underway now,

I got my motors, motor controller, IMU and arduino.

Using your examples I got the accel and gyro to give me usable figures....

Using the motor example I got my motors to run fine.

Using your balancing only code and a few tweaks I have gotten the IMU to spin the motor depending on its orinetation. however the motor controller seems to cut out after the motor reaches 100%, i am not sure why this is. I can post a video for you if it would make it easier.

Thanks,
Kriogenic.
Jul 3, 2011. 5:29 PManiles jr says:
what if you put it up to 80% because i want mines to go fast

thanks

adrian
May 28, 2010. 11:24 AMkarandex says:
I am from india and i dont have access to 5 axis can i use 3 axis accelerometer and single gyro ? I have access to this shop please suggest parts
rhydolabz.com 
Jun 4, 2010. 8:05 AMMontspy says:
I rewrote your code to use it with the WM+ and Nunchuk code from the Arduino forum (complementary filter). I'm waiting for parts to be delivered but I can send you the code if you want. Actually it's quite sure it won't work beacause I can't test the whole thing
Jun 4, 2010. 11:13 AMkarandex says:
Thanks but i desided to use IMU as i found a vender in my country. My thinking is that if there is project make it as the instruction say and then improve or customize on it and not to start from scratch
May 29, 2010. 9:10 PMkarandex says:
 thank you but i got a vendor in india with 5dof tenet technologies
is this code robust that if i keep the electronics same it will work with any low CG configuration ? I was thinking to build a prototype with DC motors, what rpm or voltage should i use ?
Also one more thing , can i make segway with it ?

Thank you for your valuable time.
Aug 5, 2010. 11:07 AMmrityunjay says:
hey i m from india too can u plz help wer u got 5dof ?

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
127
Followers
10
Author:XenonJohn