Skip to content
Parallax Learn

Parallax Learn

  • 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
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • 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
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Sensors with the micro:bit and MakeCode

Sensors with the micro:bit and MakeCode

Infrared Object DetectionCopy

This infrared detection system is kind of like an infrared flashlight.  If the invisible beam from the IR LED reflects off an object and is picked up by the IR receiver, it’ll send a low signal.  Otherwise, it sends a high signal.  One thing about the infrared beam, it has to be flickering on/off at 38 kHz (38,000 times per second) for the IR detector to “see” the reflection.

Parts

(1) LED shield 350-90005 
(1) LED standoff 350-90004 
(1) IR LED 350-00003 
IR Receiver 350-00039 
(1) 2 kΩ resistor (red-black-red-gold
(1) 220 Ω resistor (red-red-brown-gold)
Jumper wires: Red, (2) black

Schematic

Wiring

Make sure you are using an infrared LED and not phototransistors.  The infrared LED has a taller and more rounded plastic dome:

Assemble the IR Headlight

The infrared LED is designed to sit in the standoff tubes a certain way.  The flat spot on the LED dome matches a flat ledge inside the tube. Holes on the bottom of the tube are labeled for the anode (+) and cathode (-) leads.

  • Insert the infrared LED into the LED standoff tube, threading the anode and cathode leads through their respective holes in the bottom.  If properly aligned, the LED should drop in place without pushing.
  • Slip the short tube over the IR LED’s clear plastic case, tab end first. The tabs should snap into the standoff, holding the LED in place.

Breadboard Connections

Script


Tests

Face an object like a box, your hand, or a piece of paper so that the infrared LED shines light at it.   The distance should be 6 inches or less.  The micro:bit should respond by displaying a checkmark.  Take the object away, and the micro:bit should respond by displaying an X.


Printer-friendly version
FlexiForce Pressure Sensor
Prev

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress