Adding Electronic Control to the RBB-Bot
Yesterday’s robots can teach us a lot about today’s robots. That’s because old school bots used simpler ways to control them. It was easier to understand what was happening, thanks to their reliance on simple circuits. You could see how the wires connected from one point to the next, and visualize how the juice from a battery turned on this component, or switched off another.
There’s no need to stock up on tubes and giant relays. . .we don’t need to go that far back in history! But if you’d like to step into the world of smart robotics, a great way is to learn how is to build a no-frills, no-brain mechanical pet that uses basic electronic parts to move around the floor.
What’s even better is the parts for your bot can be re-purposed when you’re ready to move to the next step. That’s the idea of the RBB-Bot, first introduced last issue. In Phase 1 you discovered how to construct the RBB-Bot using common materials like plywood or sheet plastic. And you discovered how to drive and steer it by using a pair of mechanical switches.
In this part, you’ll go to the next level: you’ll replace the manual switch control with fully automatic -- yet simple -- electronic function. Your robot will react to light, coming toward any bright light source. Using just a flashlight, you can lead your robot around a darkened room. The photo on the left shows the completed Phase 2 RBB-Bot, all ready to be guided by nothing more than photons.
Remember that the techniques you’ll learn here, and even the components you’ll use, are applied in upcoming episodes of the RBB-Bot series.
See Sources for a list of parts for the Phase 2 RBB-Bot.
Using Electronic Motor Control
Mechanical switches help demonstrate how to control the motors of a robot. As you discovered in Phase 1, motor direction is controlled by alternating the polarity of the current applied to the motor’s terminals. A double-pole, double-pole (DPDT) switch is a great demonstrator of robot motor control.
A manually controlled robot is nothing more than a fancy toy; it’s not a true robot until it can run on its own. Through electronic control, you can replace the switches with circuitry. This circuitry effectively duplicates the action of those DPDT switches. And because the circuitry can be operated electrically, other electronic components can be connected as sensors to provide automatic function.
An H-bridge circuit is the most common way to provide all-electronic control of a motor. It’s called an H-bridge because the schematic diagram of the circuit typically shows the main components -- usually transistors of one type or another in an “H” pattern. The figure below shows a simplified H-bridge (don’t try to build this circuit, it’s just for demonstration).
While there are many -- and I mean many -- workable H-bridges designs, most of the ones you can easily replicate leave something to be desired. Most rely on big and bulky transistors, so the finished circuit is ungainly. And to make the thing easier to construct at home, some components might be are omitted, which could affect its efficiency.
It’s often easier (and sometimes cheaper!) to get a ready-made H-bridge. A popular one is the L298, a complete H-bridge in a single integrated circuit. One L298 will operate two motors.
The L298 comes in a special kind of high-wattage package that isn’t designed for breadboarding, and it needs some external parts -- specifically a set of protection diodes -- to complete its circuitry.
For the sake convenience, I like to use the many ready-made L298 circuit board modules available. Most are priced at between $15 to $35, depending on features. The one I’ve specified in this article is from Seeed Studio (see the photo above), and retails from RobotShop and other online shops for under $25. You’re free to use another H-bridge module, as long as it conforms to the specifications below:
This and subsequent phase of RBB-Bot calls for a Seeed Studio L298 Dual H-bridge motor control module, available online from RobotShop.com and other retailers. This module provides the L298 integrated circuit on a heat sink, plus the required protection diodes, operating LEDs, and terminal blocks for wiring to a power source and motors.
You can use most any other L298 module, or even another module using a different type of H-bridge, as long as it conforms to these basic specifications:
- Capable of driving up to 2 amps per motor
- Three inputs for each motor: Enable, and two differential inputs (avoid the type with just two inputs for direction and on/off; although these will work, it will require you to revise the wiring from the 74HC14 shown in this phase)
- On board 5 volt voltage regulator
You can make your own H-bridge using an L298 chip. Be sure to check the datasheet for the device, and add the required protection diodes on each of the motor terminal outputs.