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
  • Visible Light Navigation for the cyber:bot

Visible Light Navigation for the cyber:bot

Build the Light Sensor Eyes

The circuits shown here can respond independently to the light level reaching each phototransistor. Each one naturally adapts to ambient light levels without having to swap out resistors. The phototransistors will be pointing upward at about 45°, one forward-left and the other forward-right.  This way, a script monitoring the values of both phototransistor circuits can determine which side of the cyber:bot is exposed to brighter light. Then, this information can be used for navigation decisions.

Parts List

(2) phototransistors
(2) capacitors, 0.01 μF (marked 103)
(2) resistors, 220 Ω  (red-red-brown)
(2) jumper wires

  • Put the cyber:bot board’s power switch in position 0.
  • Remove the old phototransistor circuit, and build the circuits shown below.

  • Double-check your circuits against the wiring diagram to make sure your phototransistors are not plugged in backwards, and that the leads are not touching.

The roaming examples in this chapter will depend on the phototransistors being pointed upward and outward to detect differences in light levels from different directions. Adjust the phototransistors to point upward at a 45° from the breadboard, and outward about 90° apart,  as shown below.

About Charge Transfer and the Phototransistor Circuit

Think of each capacitor in this circuit as a tiny rechargeable battery, and think of each phototransistor as a light-controlled current valve.  Each capacitor can be charged to 3.3 V and then allowed to drain through its phototransistor.  The rate that the capacitor discharges depends how much current the phototransistor (current valve) allows to pass, which in turn depends on the brightness of the light shining on the phototransistor’s base.  Again, brighter light results in more current passing, shadows result in less current.

This kind of phototransistor/capacitor circuit is called a charge transfer circuit.  The cyber:bot will determine the rate at which each capacitor loses its charge through its phototransistor by measuring how long it takes the capacitor’s voltage to decay, that is, to drop below a certain voltage value.  The decay time corresponds to how wide open that current valve is, which is controlled by the brightness of the light reaching the phototransistor’s base.  More light means faster decay, less light means slower decay.
QT Circuit — A common abbreviation for charge transfer is QT.  The letter Q refers to electrical charge (an accumulation of electrons), and T is for transfer.

Connected in Parallel — The phototransistor and capacitor shown in the figure above are connected in parallel; each of their leads are connected to common terminals (also called nodes).  The phototransistor and the capacitor each have one lead connected to GND, and they also each have one lead connected to the same 1 kΩ resistor lead.


Printer-friendly version
Light Levels over Larger Ranges
Prev
Test the Light Sensor Eyes
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress