This self-balancing robot was designed and built by Kerry Wong and uses just a few ICs and some basic electronic components to get the job done. This project is definitely more up your alley if you’re interested in using discrete components rather than a microcontroller designed for prototyping, but the cost in doing it this way makes it attractive.

From Kerry’s site:
I used a LPY450AL for the gyroscope and anMMA8453Q for the accelerometer. These two devices are rather inexpensive and the IMU can be built for well under $10.
The toy truck I used for this project has a single motor that drives both of the rear wheels. Since I only need the drive wheels, I cut off the unused front portion. The toy car’s plastic chassis is not rigid enough so I hot-glued a few pieces of plastic and metal support on the back. The extra support is important as excessive vibrations affect the accuracy of the sensor measurements.
Here is the bill of material in my build:
Platform: Toy truck (0 – $20)
Controller: ATmega328P (~$4)
Accelerometer: MMA8453Q (~$2)
Gyroscope: LPY450AL ($4)
H-Bridge: SN754410 (~$2)
Miscellaneous: ~$10
[via Hacked Gadgets]
More:


From the video, it looks as if compensating for dis-balance would have been easier if the batteries were moved all the way to the bottom and the gyroscope – all the way to the top (where the acceleration would have been increased by increasing the distance to the center of rotation). I am intrigued why the builder chose to put the heavy batteries all the way up, even extended them further out on the stick? This seems like a conscious choice I can’t explain.
Putting the batteries up high raises the center of mass. This increases the rotational inertia. The higher rotational inertia means the pendulum is slower to fall, although it does require a stronger push to compensate. But this also means the slower response motors and control circuitry are up to the task of balancing.
it is meant to make the robot look more jmpressive and it proves that it stabilizes well.
Yes, I thought the rotational inertia would have something to do with it. My guess is this particular design would not be as good at showing tricks of quick recovery or putting itself upright from an “OFF” position as I’ve seen on other Youtube videos. And still, wouldn’t it make more sense to move the sensors (pardon the pun) as high as possible to further increase the mass at the top and also add to the acceleration which would probably make the sensor respond even quicker? You can guess: I’m collecting some preliminary info for starting my own self-balancing project
Can i get the code………..
me a student gng to proceed further having problem with gyro interface?
// What's Trending
Raspberry Pi Design Contest
Maker Faire: Day Two
Maker Faire: Day One
Seventeen Sneaky Secret Hides
10 Things to Connect to Your Raspberry Pi
DIY Hacks & How To’s: Swiss Army Key Ring
Adam Savage Exhorts the Makers to “Work Hard and Work Smart”
A Photo Tour of Maker Faire
// What's Shared
A better way to slice a pumpkin
DIY Nerf Darts
In the Maker Shed: Minty Boost USB Charger
100 Dollar Store Organization Ideas for Craft Rooms and Beyond
Mad’s Mouse House
Lace Princess Crowns
I Have a (Puzzling) Dream
Play the Rings of a Tree Trunk Like a Record
// Most Commented
DIY Hacks & How To’s: Get Emergency Power from a Phone Line
Resin Casting: Going from CAD to Engineering-Grade Plastic Parts
Ten Tips for Screws and Screwdrivers
Ten Tips for Better Measurement
Makers on TV: Big Brain Theory
Arduino Announces New Wireless Linux Board
Pitches with Prototypes: Solar Tracker
Tool Review: BioLite CampStove
Trending Topics
Get our Newsletters
About Maker Media
Subscribe
to MAKE!
Get the print and digital versions when you subscribe