Adjust the Detection Range

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

LED Brightness

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.

  • Leave all the current IR object detector circuits in place.
  • Put the cyber:bot board's power switch in position 0.
  • Add a red LED circuit connected to P7.

Example script: P7_led_on

  • Put the cyber:bot board's power switch in position 1.
  • Enter, save and flash the script P7_led_on.
  • Run the script and verify that the LED in the circuit connected to P7 emits light.
# P7_led_on

from cyberbot import *


Try this: Test LED Brightness with Different Resistors

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.

  • Replace the 220 Ω resistor that goes from pin 7 to the LED’s cathode with a 470 Ω resistor. Note now how brightly the LED glows.
  • Repeat with a 1 kΩ resistor. Is the red LED brighter or dimmer?
  • Repeat once more with a 4.7 kΩ resistor.  Now how bright, or dim, is the red LED?
  • You can remove the 4.7 kΩ resistor, red LED, and jumper wire before moving on to the next portion of this activity.
  • Explain in your own words the relationship between LED brightness and series resistance.