photoresistor
Hockey
Posts: 7
I am new to the Basic stamp and having been trying new circuits with it for about a month now.· I have a project that I need some help with.· I would like to set up a 4x4 grid of photoresistors.· Using a laser pointer hitting each of the resistors, I would like to be able to tell when an object passes over the photoresistor and know which resistor the object passed over.· Can any one help get me started I do not think that the rctime command is what I want as all I am looking for is a simple 0 or 1 when a object passes thru the sensor.· So basically, I guess I just want help building a very simple break light sensor.
·
Thanks
Mike
·
Thanks
Mike
Comments
· You could probably use·them just·like a switch array, basically (lots of info on that,·refer to·the Nuts&Volts articles over in documents at the parallax site.)
· Photoresistors are slow, in comparison with photodiodes and phototransistors.· Cd-S, I think, are· most responsive in the yellow-green region, but I'm sure that most visible light will have an effect on them.
· To see if you can use it as an INPUT, connect the photoresistor between Input pin and Ground and connect a resistor (2.2K) between that same input pin and VDD.· Then see if you can detect anything with an INPUT instruction (this would be a LO-going voltage when the light shines on it.)
· You could trigger an OUTPUT with an LED attached to it to confirm response with.
Post Edited (PJ Allen) : 2/13/2006 1:41:15 AM GMT
p2 --> to photoresister
Vdd --> to photoresister
photoresister --> Vss
then ran this code:
'{$stamp bs2}
'{$pbasic 2.5}
do
debug ? in2
loop
i recieved this in the debug window
in2 = 1
then put the light on the photo resister and no change.
Does this mean it will not work or did i screw something up in building the cirucit?
thanks for the help so for.
M
· In daylight they usually go down to 200ohms, which would pretty much take the input pin to 'ground'.· With a laser (laser pointer) I don't know.· Another·matter is how much of the photoresistor area is illuminated (just a tiny dot?)
· You'll have to experiment, so you'll need the voltmeter.
· Another experiment would be to use an ohmmeter.· Measure the photoresistor's resistance/s, out of circuit (all by itself, disconnected from anything else.)
Thanks for the ideas.
M
Bad circuit building need help correcting it.· Or maybe I got lucky and this is an OK circuit
Vdd --> photoResistor (side a)
p2 --> photoResistor (side b) --> 220k resister --> Vss
When I run the code from above:
in2 = 0
I put a laser pointer on the photoresistor i get
in2 = 1
Pretty much what I wanted.· But I think that is probably a bad circuit design.· Any help would be great.
Rember the ultamate goal is a 4 x 4 matrix.
thanks
Mike
·
[noparse][[/noparse] see attached ]
Using your diagram all i get is in2 = 1 no mater what if the laser pointer is on the photoresisotor or not.
So I put it back to the
Vdd --> photoResistor (side a)
p2 --> photoResistor (side b) --> 220k resister --> Vss
and I get a difference in signal w/ and w/ out the laser.
With the circuit you describe, you are drawing current through the photoresistor when it's on/illuminated (depending on its resistance then, it might not be such a great idea.)
But, anyway, so long as you're happy...
I agree that its not a great way for the desgin but it was the only way to get it to register the input. If I could change it to the other that would be great.
M
maybe you have a 4.7 k?· yellow violet red
I was uing the 220 ohms. I checked and did not have a 2.2K resistor but I did have a 2K resistor (red black red) I put the circuit back to your drawing and get a one w/ no laser pointer and a 0 with the laster pointer.
Thanks a bunch for your help.
M
· This way you aren't running a lot of current through your PR (they appreciate that.)· You could probably use a higher value limiting resistor (try 10K -- brown black orange)
Post Edited (PJ Allen) : 2/13/2006 9:11:22 PM GMT