So now I have a Chassis for my Balance Bot, it consist of couple of acrylic sheets with a couple of cheap DC motors. The things to think about for controlling this bot are
Gyroscope / accelerometer
Let’s start off with the processor. I normally use Raspberry Pi’s for this sort of thing, but for the actual balancing system I think a dedicated micro controller would be better. This will not get interrupted dealing with WiFi, reading controllers and any other high level stuff. I had a few 3.3v Arduino Pro Mini clones, so this is what I will use. This does not have a USB socket so to programme I needed to get a USB to serial converter, I used this one from Pimoroni
As mentioned in my previous posts, I have a MPU-6050 6DOF gyroscope/accelerometer and I’ve also seen a few projects on the internet use this device so this is exactly what I will be using. It connects to the Arduino over the I2C bus.
The are many options for motor drivers, they can be purchased in many shapes and sizes. I wanted to keep the device quite small and I had some L293D motor driver chips in my storage box, so this is what I’ll be using for this project. The motors I’m using are not high power so the little 16 pin DIP chip will be perfect.
Power systems can get complicated very quickly. The Arduino needs 3v3, the MPU 6050 needs 5v and the motors need at least 5v with the motor driver needing 5v to power the internals of the chip. I wanted to keep the bot light since the motors are not very powerful. In line with my current philosophy, I wasn’t going to start over thinking this again, I plumped for a 2000mAh 3.7v Lipo battery with an Adafruit 1000mA boost/charge board. This gave me a small battery with 1000mA current at 5v to power the other components. The Arduino I have has a built in voltage regulator so I could power from 5v and it would drop it down to the required 3v3. All the other components I could power straight from the 5v from the boost/charge board.
To give me flexibility, I cut a bit of strip board down to size, added some fixing holes and soldered all the components on and wired together. I put a quick sketch together to test the motors, powered it up and nothing. I spent some time checking my wiring with data sheets for the Arduino and motor controller and found a problem. It turned out I had wired the motor controller incorrectly. So I quickly corrected this and this time the motors fired up, both forward and reverse.
I mounted the battery and strip board circuit onto the chassis. I now had a platform that worked, all that was left to do was programme the Arduino to tell it how to balance. Easy right! Think I’ll leave his part to another day.