Data Sheet

Project 11
Light Monitor
This project opens a window on your computer to
display measured data in real time. Build the
circuit shown. Load sketch Light_Monitor into
Snapino
TM
using the programming instructions in
project 3. When the upload is finished, click on the
Tools menu, then pick Serial Monitor from the
list. A window opens on your computer screen,
displaying the measured light value. Vary the
amount of light shining on the phototransistor (Q4)
and see how the number displayed changes.
Programming Note:
The Serial commands open the window, then display some text
with the light measurement.
Changing the amount of light shining on the phototransistor
changes its resistance, and so changes the voltage measured at
the A0 input. The analogRead command has 10-bit accuracy, so
the measured number will be from 0 (darkest) to 1023 (brightest).
The 10KW resistor (R4) allows the voltage at the A0 input to fall
when it is dark and rise when there is light on the phototransistor.
The voltage measured depends on the ratio of the
phototransistor resistance to the 10KW resistor (R4). The
measured value will be about 512 when the phototransistor
resistance equals R4. Replacing R4 with another resistor would
shift the measured light value.
-22-
Serial monitor window:
SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 23