Balancing Robot, With No Microcontroller
Introduction: Balancing Robot, With No Microcontroller
A self-balancing robot normally needs a microcontroller to make it work, or more complex electronics such as in the Segway. This one shows what can be accomplished with only a motor, two switches and four batteries.
The basic idea is to move the robot to keep it from falling. This is done in one direction or the other, depending on which way the robot is tilted, fast enough for the tilt to flip to the opposite direction. The robot then moves in that direction, to flip the tilt again. The robot sways back and forth. This is similar to what happens if you try to balance a stick with one end on the palm of your hand. The hand never stays still.
When researching other self-balancing projects, I learned that the robot should not be short and should be top-heavy. This results in slower falling when the robot starts to tilt, and that allows the motor to act quickly enough to stop the falling and to flip the tilt to the opposite direction. I also read that the wheels should not be small.
I considered four methods of accomplishing this project and made three of them. Here is a summary:
1. STORE-BOUGHT TILT SWITCH
Looking for tilt switches on the Internet, I couldn’t find any SPDT (single-pole double-throw) switches. That’s what would be needed in order to have the robot move in one direction or the other, based on its tilt. If two SPST tilt switches were used, I think the tilt angles in this project would be too small for that to work. Also, since the tilt switches have a rolling ball or mercury fluid inside, there could be a possibility of both switches turning on at the same time as the robot moved. This would short out the batteries and they could be ruined or maybe explode. So, I don’t think this method is workable.
2. DIY TILT SWITCH
The next idea was to make a tilt switch by hanging a stiff wire from the upper part of the robot and making it touch one of two contacts near the bottom, depending on which way the robot was tilted. I used nails for the contacts and soldered wires to the nails. 949
But this didn’t work as I hoped. The hanging wire didn’t make a good contact reliably.
I tried adding a weight to the hanging wire, hoping it would improve the situation. This almost worked. As soon as the hanging wire made contact, the motor moved the base properly but this sudden movement caused the wire to lose contact and the motor stopped. The robot was still tilted and began to tilt slightly more, and the wire made contact again and the motor activated for an instant again. The result was that the robot was not able to right itself, and I had to use my hand to keep it from falling over.
So, this was almost a great idea but it didn’t work.
3. TWO SPST SWITCHES
The next thought was to use two SPST (single-pole single-throw) switches located at the bottom of the robot near the floor. One switch would turn on if the robot tilted to one side and the switch touched the floor, and the other switch would turn on if the robot tilted to the other side. Small cardboard pieces, glued to the underside of the robot, held the switches in place as can be seen in the photo. For experimenting with the up-down placement of the switches, they were held in place by binder clips.
Unfortunately, this idea didn’t work either, no matter how high or low the switches were located. The switches didn’t stay “on” long enough to make the motor flip the tilt to the other side.
4. ONE SPDT SWITCH
Since the switches didn’t stay “on” long enough in method #3, maybe there’s a way to have a switch keep the motor running in one direction until the tilt flips? That’s the fourth method. A double-throw switch has the motor always running in one direction or the other. The up-down placement of the switch is important. I experimented until it worked well. For some reason, my robot works well if it is placed down onto the switch after being turned on, but not as well if it is placed onto the wheels. The robot slowly travels in one direction because the motor is “on” longer in that direction than in the other.
This instructable describes the fourth method.
COMMENT: A side-effect of making this very simple robot is that it cannot do anything else. Maybe a circuit could be designed to allow some voice control of the robot to turn left or right, with a microphone, some transistors, and two motors instead of one, but still no microcontroller. 226