What is a robot? A robot is a system that combines mechanical, electronic and electrical parts to implement one or more functions. Robot control is done with help of electric and electonic circuitry. To obtain the desired behavior, the control components vary current and voltage throughout the circuitry.
Robots can be implemented with discrete components (resistances, capacitors, and transistors). However, there are several integrated circuits (ICs) that makes it easier to design robots (logic gates, memory, microcontrollers, LCD interface chips, operational amplifiers, timers, etc.).
Take for instance Bobette, one of the robots that I designed. This robot can move in an arbitrary environment looking for lit candles (see picture).
This robot has a base, a locomotion mechanism, an array of sensors and a control circuitry that allows it to gather sensor data and control its peripherals (motors, LCD, etc.).
Bobette's brain is its microcontroller. The microcontroller is an integrated circuit very similar to a PC microprocessor. Just like the microprocessor, the beauty of the microcontroller is its ability to execute very diverse programs that are tailored to the application at hand. This component is quite versatile as it allows the execution of an arbitrary sequence of instructions. However, there are differences between the two devices that make the microcontroller better suited for a host of robotics applications.
Microcontrollers provide some capabilities that are not found on a typical microprocessors. Examples of such capabilities include: flash memory to store programs, specialized functions to control motors and convert analog to digital data, support for UART, I2C and SPI interfaces. If a microprocessor were used, we would likely need to add external chips to support these functions. This might require the implementation of an address and data bus which yields to more complex architectures.
In general, the microcontrollers are not very powerful when it comes to arithmetics. They are also usually much slower than microprocessors because the applications that they implement does not require fast number crunching. When flash or EEPROM memory is built into the chip, it is possible to store the microcontroller program directly in this special memory, but the amount of code space is usually fairly limited (less than sixty-four kilobytes). In addition, the amount of RAM is usually lower than this. On most devices, RAM space is under a kilobyte. For instance, Microchip PIC16F877 has 368 bytes of RAM. We're not talking megabytes here, not even kilobytes! With all these limitations, it is very important to write tight programs.
But even with the above limitations, to build a robot that uses a microcontroller leads to a simple architecture. Such a robot can easily be built with a handful of components (resistances, capacitors and a few specialized ICs). The table below shows a list of integrated circuits used on Bobette.
|PIC16F877 Microcontroller: This microcontroller is the brain of the robot. It controls the behavior of the robot.|
|7805 Voltage Regulator: This integrated circuit insures a stable source of 5V is available throughout the circuit.|
|L293D H-bridge: This integrated circuit interprets control commands from another device (the microcontroller in our case) to drive the motors in the appropriate direction and speed.|
|Hex Inverter: This IC allows to invert an input and is used in the motor drive system to reduce the number of pins that the microntroller must use to control the direction of the motors.|
|LM741 Opamp: This operational amplifier can be used for different applications. It can be used as a voltage comparator (for instance to compare the reading of two thermistors to determine which of two temperature is higher). It can alo be used to amplify a signal such as the alarm signal that is captured by the Bobette's microphone.|
|LM567 Tone Decoder: This integrated circuit detects fixed frequency tones and can be used for instance to detect the alarm of a smoke detector or telephone tones.|
|Flip-flop Memory: This memory queues bits to send to the LCD. This reduces the number of pins that are required to drive the LCD from six or ten to two.|
|MAX232 IC: This specialized IC converts +/- 15V signal that is typically generated by a PC serial interface into a TTL 5V compatible signal compatible with most microcontrollers.|
Once the control board is designed, sensors must be added. Bobette uses a host of sensors to map its environment. The following table describes Bobette's sensors.
|Sharp GP2D12 Infrared Distance Sensor: This sensor can be used to detect obstacles 10 to 80 cm away. An infrared beam is sent by the LED on the sensor. The sensor photodiode adjust the output voltage according to the amount of reflected infrared light it receives. The closer the obstacle is, the higher the infrared light intensity will be.|
|Devantech SRF04 Ultrasonic Module: This sensor detects obstacle up to three meters away. To determine the distance, the delay for the ultrasonic sounds to echo back to the module is timed.|
|QRB1114 Proximity Sensor: This sensor, just like the Sharp GP2D12, is a combination of a LED and a photodiode. Output voltage is read at the emitter of the photodiode and reflects the amount of infrared reflections that bounces back to the photodiode. A white surface reflects more than a black surface, so it is possible to use this sensor for white line detection.|
|Vector 2X Electronic Compass: This electronic compass can be used to determine where the robot is heading.|
|OP800SL Phototransistor: This sensor can be used to estimate light intensity. The greater the light intensity, the lower the output voltage at the emitter. With this sensor, Bobette can detect the flame of a candle.|
|Electret Microphone: This microphone captures environmental sounds.|
There are other types of sensors, like photoresistances (for which resistance based on light intensity), thermistors (for which vary resistance based on heat), ultraviolet sensors, tilt and gravity sensor, touch screens, etc.
We can classify sensors in two categories: analog and digital. For analog sensors, we observe the output voltage to determine the appropriate measurement. For instance, the output voltage of a Sharp GP2D12 is proportional to the proximity of objects. Roughly, the greater the distance is, the lower the output voltage is. Once the voltage reading is performed, the microcontroller can convert this analog value to a binary value.
Digital sensors transmit their information in a digital manner. Sometimes they report their measurement in a binary form. Sometimes, they vary the duration of a signal (the greater the signal duration, the greater the distance or the greater the direction in degrees).
Once a robot has access to its sensor data, it can use this information to change its behavior (for instance, change direction or control a robotics arm). Microcontrollers can control different peripherals as outlined in the table below.
|Motor: There are several motor types (direct current, alternate current, step). Bobette uses 12V DC motors with gears that rotate at 100 RPMs.|
|LCD: LCD provides means to display information.|
To reach me, send an email to: mdubuc at domain freeshell.org.
Last updated: October 6, 2004