Chapter 7: Navigating with Infrared Headlights
· Page 247
ACTIVITY #3: INFRARED DETECTION RANGE ADJUSTMENTS
You may have noticed that brighter car headlights (or a brighter flashlight) can be used to
see objects that are further away when it’s dark. By making the Boe-Bot’s infrared LED
headlights brighter, you can also increase its detection range. By resisting electric current
less, a smaller resistor allows more current to flow through an LED. More current
through an LED is what causes it to glow more brightly. In this activity, you will
examine the effect of different resistance values with both the red and infrared LEDs.
Parts List:
You will need some extra parts for this activity.
(2) Resistors – 470
Ω
(yellow-violet-brown)
(2) Resistors – 220
Ω
(red-red-brown)
(2) Resistors – 2 k
Ω
(red-black-red)
(2) Resistors – 4.7 k
Ω
(yellow-violet-red)
Series Resistance and LED Brightness
First, let’s use one of the red LEDs to “see” the difference that a resistor makes in how
brightly an LED glows. All we need to test the LED is a program that sends a high signal
to the LED.
Example Program – P1LedHigh.bs2
√
Enter, save and run P1LedHigh.bs2.
√
Run the program and verify that the LED in the circuit connected to P1 emits
light.
' Robotics with the Boe-Bot - P1LedHigh.bs2
' Set P1 high to test for LED brightness testing with each of
' these resistor values in turn: 220 ohm , 470 ohm, 1 k ohm.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
HIGH 1
STOP