TalkingWithLight
by Gordon McComb
Whenever you program your robot,
you're telling it what to do. So, how
about when your robot needs to talk
back? You might use sound to allow
your robot to communicate with you,
like I covered back in the March
through June 2012 issues of SERVO.
Or, you can use a more direct — and
often easier — way: with good old
fashioned light.
Using light to provide feedback for your robot can be as simple as a single LED, or more complex using multiple LED colors. A benefit of talking with light is that it also attracts attention. It can bridge the
FIGURE 1. Basic connection for illuminating an LED
via a microcontroller pin. Bringing the pin HIGH
turns the LED on.
psychological gap between machine and person. Your
robot can draw in humans by using a variety of bright
lights and dazzling colors.
In this article, we’ll discuss simple techniques to
communicate using light with your Arduino-based robot.
The projects are simple to do, with only basic components
and wiring needed. Most cost under a couple dollars.
Communicating With LEDs
One light emitting diode is all it takes for your robot
to communicate with you. The language may not be
elegant and the conversations are amazingly short, but it
gets the job done. When you don’t need a talkative bot
you can use a single LED, or for more words, you can use
multiple LEDs or seven-segment LED display panels.
The basic LED feedback circuit is shown in Figure 1.
Sequence
Short-Short-Short
Long-Long-Long
Long-Short-Long
Short-Long-Short
Short-Long-Long
. . . and so forth
Meaning
Status A-OK
Unknown trouble
Battery low
Cannot read sensors
Goal reached
Table 1.
Listing 1.
void setup() {
pinMode(12, OUTPUT);
}
void loop() {
digitalWrite(12, HIGH);
delay(500);
digitalWrite(12, LOW);
delay(500);
}
// Make D12 an output
// Turn LED on
// Wait 1/2 second (500 ms)
// Turn LED off36 SERVO 03.2013