Page 460 - Robot Builder's Bonanza
P. 460

PROGRAMMED BRAINS  429


                                                                  Figure 34- 1  A few parts from
                                                                  basic electronic components form a
                    Photo                      Resistor
                   transistor                                     workable robotic brain. Depending
                                                                  on how the parts are configured,
                                                           Output
                                   Output                         the robot can display different
                                                                  “behaviors.” In one variation of
                       Resistor                                   this  light- detection circuit, the
                                            Photo
                                           transistor             rebot responds to light; in the other
                                                                  variation, the robot responds to
                                                                  darkness.


                     Figure 34- 1 shows a common form of robot brain made from from simple parts. Wired
                   one way, this brain makes the robot reverse direction when it sees a bright light. The circuit
                   is simple, as is the functionality of the robot: light shining on the photodetector might turn
                   on a relay or actuate some other circuit.
                     Variations of this circuit could make the robot stop when it sees a bright light. By using two
                   sensors, each connected to separate motors, you can make the robot follow a bright light
                   source as it moves. By simply reversing the sensor connections to the motors, you can make
                   the robot behave in the opposite manner: it steers away from the light source, instead of
                     driv ing  toward it.
                     You could add additional simple circuitry to extend the functionality of robots that use dis-
                   crete components for brains. For instance, you could use an LM555 timer as a time delay:
                   trigger the timer and it runs for 5 or 6 seconds, then stops. You could wire the LM555 to a
                   relay so it applies juice only for a specific amount of time. (This is the basic function of the
                   enhanced RBB Bot in the My First Robot lessons.) In a  two- motor robot, and using two
                   LM555 timers with different time delays, your robot can be made to steer around things.


                   Programmed Brains

                   Perhaps the biggest downside of making robot brains from discrete components is that
                   because the brains are hardwired as circuitry, changing the behavior of the machine requires
                   considerable work. You need to either change the wires around or add and remove compo-
                   nents. Using a solderless breadboard (see Chapter 32) makes it easier to try out different
                   designs simply by plugging in components. But this soon gets tiresome and can lead to errors
                   because parts can work loose from the board.
                     You can “rewire” a robot controlled by a computer simply by changing the software run-
                   ning on the computer. For example, if your robot has two light sensors and two motors, you
                   don’t need to do much more than change a few lines of programming code to make the robot
                   come  toward a light source rather than move away from it.


                   TYPES OF PROGRAMMABLE GRAY MATTER
                   An almost endless variety of computers and  computer- like devices can be used as a robot
                   brain. The five most common are:

                   •  Microcontroller. A microcontroller is programmed in either assembly language or a  high-
                     level language such as Basic or C. Figure 34- 2 shows a Parallax  BOE- Bot robot kit, which









 34-chapter-34.indd   429                                                                   4/21/11   11:57 AM
   455   456   457   458   459   460   461   462   463   464   465