Project 5.01 First Look at the Phototransistor
This is a simple sketch where we read the value from the phototransistor using the analogRead statement and output the value to the serial monitor. The phototransistor is an analog device. It does not give us a simple LOW or HIGH value. The voltage on the pin connected to the phototransistor increases as the amount of light increases. Upload the program, wait a moment, and then start the serial monitor. Hold the board close to different light sources or near a window. When the reading reaches 1023, the phototransistor is saturated and can’t register any additional increase in the amount of light.
Concepts: analogRead, voltage divider
Circuits:
Concepts: analogRead, voltage divider
Circuits: