When it is dark outside, you may have noticed that a brighter flashlight lets you see objects that are further away. By making the cyber:bot’s infrared LED headlights brighter, you can also increase its detection range. 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
(2) Resistors, 470 Ω (yellow-violet-brown)
(2) Resistors, 220 Ω (red-red-brown)
(2) Resistors, 1 kΩ (brown-black-red)
(2) Resistors, 4.7 kΩ (yellow-violet-red)
(1) Red LED
(1) Misc. Jumper Wire
Piece of white paper
Ruler
First, let’s use a red LED to actually see the difference that a resistor makes in how brightly an LED glows. All we need to test the LED circuit is a script that sends a high signal to an LED.
# P7_led_on from cyberbot import * bot(7).write_digital(1)
As you work, put the cyber:bot board's power switch in position 0 for changing resistors, and position 1 for running the test. Also, the same script will run when you reconnect power, so you can pick up right where you left off with each test.
We now know that less series resistance will make an LED glow more brightly. A reasonable hypothesis would be that brighter IR LEDs can make it possible to detect objects that are further away.
#test_both_IR_indicators from cyberbot import * bot(22).tone(3000, 1000) while True: irL = bot(14, 13).ir_detect(37500) irR = bot(1, 2).ir_detect(37500) bot(20).write_digital(irL) bot(21).write_digital(irR)
You will need two each of the resistor values you used with the red LED test, along with a piece of paper and a ruler. The goal is to measure the object detection distance for different resistor values in series with the IR LEDs. As you work, remember to put the cyber:bot board's power switch in position 0 for changing resistors, and position 1 for running the test. Remember also that the same script will run when you reconnect power, so you can pick up right where you left off with each test.
Series Resistance on IR LED | Maximum Detection Distance |
4700 (yellow-violet-red) | |
2000 (red-black-red) | |
1000 (brown black-red) | |
470 (yellow-violet-brown) | |
220 (red-red-brown) |