photocell -> ValueFilterMeter -> tvThe CdS photocell is wired to pull down a 50k ohm resister. This produces a signal that fluctuates around digital threshold. We measure its duty cycle with the tv meter which shows bigger white bars when the cell is pulling down less. Less light means less pull means higher voltage means more white: negative feedback.
A half inch of heat-shrink around the cell makes it directional. As I move it back and forth, in and out, up and down I get different feedback behavior.
Here is a movie that shows this happening.
I replaced the 50k resistor with a 100k pot and found that I could adjust photo sensitivity for interesting behavior in a variety of lighting conditions.
; vcc ; | ATtiny12 ; ~50k --v-- ; | rst pb5 -| |- vcc ; +----- pi pb3 -| |- pb2 sck ; | pb4 -| |- pb1 miso vh --470--+-- 75 ohm video ; CdS gnd -| |- pb0 mosi vl --1k---+ ; | ----- ; gnd 1.2MHzThis was the first time I carefully watched an AVR input pin responding to slowly moving analog levels. The part I tested exhibited hysteresis with the switch going low at 1.15v and going back high again at 1.32v with 3v on the supply.
So far I hadn't been taking advantage of the photocell signal's coorelation with the sweep of the tv beam. Not so today. I've reassembled the tv code making a one line change:
snowBar is a macro that generates the code for drawing a bar of specified height. Snow is a macro that displays raw input on the pi pin. Here I'm replacing the last bar with a column of raw data. With the highly coorelated photocell input the column doesn't look like snow at all. Instead it is a bar that runs right up to the position of the photocell, the point where the cell sees the beam. There can be a couple of lines of turn-on delay but one doesn't notice that while watching the bar move on the screen.
This is the same mechanism used by the graphic input device called a light pen. See wikipedia:
|Last edited December 6, 2006
Return to WelcomeVisitors