Step 19: Electronics

Picture of Electronics
NOTE March 2014: See link on title page to my newer Instructable on how to wire one of these up to an Arduino, with code.

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.

eyhseow2 years ago
Dear Sir
Do you have any spare anlalog IMU-5DOF or 6DOF that I can purchase from you? Please advise.
eyhseow2 years ago
Dear Sir
Do you have the software code for the whole project using the digital 6DOF, and the full schematics diagram for the whole project. If not the connections between the digital 6 DOF and the Arduino. I will greatly appreciate for your help.
Pizzapie5003 years ago
Hi! I'm new to electronics and stuff, so this may be an "easy to figure out" question. Anyhow, how come in the picture, the gyro has nine wires coming out of it, but in the arduino connection diagram, the gyro is only connected to six ports? Is it connected to something else than the arduino?
nimith3 years ago
Hi John,

I just purchased the New replacement of IMU -5DOF from SparkFun and this one already have building Reg for 3v . Can I use the same code that you have ?

I believed the same of your configuration.

miguipda4 years ago
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 ;-)
kriogenic4 years ago
Hey there, I am going to experiment but I was wondering if you knew if this IMU unit would be applicable.


I have no idea really but think it will be fine without the capabilty of resisting sudden turns?
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.

karandex5 years ago
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