Datasheet

Chapter 6 Light-Sensitive Navigation with Phototransistors
192Robotics with the BOE Shield-Bot
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 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.
Test the Phototransistor Circuit
The sketch LeftLightSensor charges the capacitor in the pin 8 QT circuit, measures the
voltage decay time, and displays it in the Serial Monitor. Remember, with this circuit and
sketch, lower numbers mean brighter light.
We’ll be using this light-sensing technique for the rest of the chapter, so you can take the
BOE Shield-Bot from one room to another without having to worry about finding the right
resistors for different ambient light levels.
If there is direct sunlight shining in through the windows, close the blinds.
Create, save, and run LeftLightSensor, and open the Serial Monitor.
Make a note of the value displayed in the Serial Monitor.
If the Serial Monitor does not display values or seems to get stuck after just one
or two, it may mean that there’s an error in your circuit. If you see these
symptoms, check your wiring and try again.
Use your hand or a book to cast a shadow over the pin 8 phototransistor circuit.
Check the measurement in the Serial Monitor again. The value should be larger
than the first one. Make a note of it too.
Getting dimmer
Dark shade
Low ambient
Bright light
Back to bright light