Skip to content
Parallax Learn (Stage)

Parallax Learn (Stage)

This is the staging site. Please see https://learn.parallax.com for the official site.

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence Tutorial Series
          • Cybersecurity: Radio Data tutorialCybersecurity Tutorial Series
          • cyber:bot Tutorial Series
          • Boe-Bot Tutorial SeriesBoe-Bot Tutorial Series
          • Arduino Shield-Bot Tutorial Series
          • ActivityBot with C TutorialsActivityBot with C Tutorials
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot with BlocklyProp Tutorial Series
          • Scribbler 3 Tutorial SeriesScribbler 3 Tutorial Series
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education Tutorial Series
          • Propeller C-Language BasicsPropeller C Basics and Projects
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit C Tutorial Series
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit BlocklyProp Tutorials
          • Badge WX Tutorial SeriesBadge WX Tutorial Series
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics and Projects
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Robotics with the Board of Education Shield for Arduino

Robotics with the Board of Education Shield for Arduino

Activty 3: 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 Shield-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:

You will need some extra parts for this activity:

(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)

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 sketch that sends a high signal to the LED.

Example Sketch – P1LedHigh

  • Enter, save and upload LeftLedOn.
  • Run the sketch and verify that the LED in the circuit connected to P8 emits light.
// Robotics with the BOE Shield - LeftLedOn
// Turn on left LED for brightness testing

void setup()                                 // Built-in initialization block
{
  tone(4, 3000, 1000);                       // Play tone for 1 second
  delay(1000);                               // Delay to finish tone

  pinMode(8, OUTPUT);                        // Left indicator LED
  digitalWrite(8, HIGH);
}  
 
void loop()                                  // Main loop auto-repeats
{
}

Testing LED Brightness with Different Resistors

Remember to disconnect power and the programming cable before you make changes to a circuit.  Remember also that the same sketch will run again 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 8 to the right LED’s cathode with a 470 Ω resistor. Note now how brightly the LED glows.
  • Repeat for a 1 kΩ resistor.
  • Repeat once more with a 4.7 kΩ resistor.
  • Replace the 4.7 kΩ resistor with the 220 Ω resistor before moving on to the next portion of this activity.
  • Explain in your own words the relationship between LED brightness and series resistance.

Series Resistance and IR Detection Range

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. 

  • Re-open and run TestBothIrAndIndicators.
  • Verify that both LED indicator circuits are working properly before continuing.

Your Turn – Testing IR LED Range

  • With a ruler, measure the furthest distance from the IR LED that a sheet of paper can be detected when using 2 kΩ resistors, and record your data in Table 7‑1.
  • Replace the 2 kΩ resistors that connect pin 2 and pin 9 to the IR LED anodes with 4.7 kΩ resistors.
  • Determine the furthest distance at which the same sheet of paper is detected, and record your data.
  • Repeat with 1 kΩ resistors, 470 Ω resistors, and 220 Ω resistors.  (For the smaller resistor values, they may end up making the detectors so sensitive that they see the table surface in front of your robot.  If that happens, set the robot on the edge of the table with the IR detectors pointing off the end and try the distance measurements again.)

  • Before moving on to the next activity, restore your IR object detectors to their original circuit, with 2 kΩ resistors in series with each IR LED.
  • Also, before moving on, make sure to test this last change with TestBothIrAndIndicators to verify that both IR object detectors are working properly.

 


Printer-friendly version
Sniffing for IR Interference
Prev
Activity 4: Object Detection and Avoidance
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn (Stage) • Built with GeneratePress