Maker Pro
Maker Pro

Laser Sensor and Counter

eptheta

Dec 20, 2009
188
Joined
Dec 20, 2009
Messages
188
I have created a circuit which is supposed to detect light from a laser (using a photodiode) and increment a counter every time the light is blocked. It works partially, but sometimes the signal bounces and the counter jumps from 1 to say 4 and then to 5 then 7 etc... it's just unstable. If i flash the laser on and off very slowly, then it registers the count more or less properly, but i want it to detect fast changes, for example me waving my hand back and forth in front of the laser.
Here's a link to the diagram of my circuit. The counter circuit works perfectly, so there's no need to include it.
http://img96.imageshack.us/img96/8761/circ.png

If you can't improve or point out the faults in my design, could you perhaps suggest an appropriate alternative circuit that would suit my purpose ?

If anyone here can help me i would be very grateful.
Thanks
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
You are leaving out some info here. Is the inverter also a CMOS gate?
If so, how do you expect to define a logic high level? The input is floating free when the transistor is not conducting. You need a pull-up resistor.
TTL gates are more forgiving about this as they have a built-in "tendency" to assume a logic high input level.
If after fixing this you still have problems you can simply add a small cap between collector and base.
 

eptheta

Dec 20, 2009
188
Joined
Dec 20, 2009
Messages
188
Hi,
Yes it is TTL and it has in-built default high logic.
I can't add a capacitor because it will cause a delay of some sort.
I want to use this device to count the number of times the laser is blocked by the wings of a paper helicopter that is rotating really fast.
Any other suggestions ?
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
Ok, that helps.
Well, I think you want a delay, the question is how much. Caps can be had down to a couple of pF which is lower than the internal capacitance already in the transistor.
How can a paper helicopter rotate "really fast"? 3600 rpm? Define fast.
What are the surrounding conditions (lights etc.)?
How well defined are the logic levels of the transistor?
A laser beam can be really narrow, maybe a wider beam is more beneficial.
 

eptheta

Dec 20, 2009
188
Joined
Dec 20, 2009
Messages
188
-Well not "really fast", just some 20 rps (honestly i'm not quite sure, but not too high), I just wanted to avoid using capacitors but if you think they might work i'll give them a try. Any suggestions about the values in pF that i have to use or do i just experiment ?
-The laser beam should do fine since both the photodiode and the laser are stationary and directly collinear to each other.
-The lighting is substantially low and won't trigger the transistor by themselves.
-I'm not sure what is meant by "How well defined the logic levels are" but its a standard NPN transistor, the generic type, nothing special.
Thanks for your help so far.
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
Well, 1200 rpm is quite fast, but still a factor 1000 less than what an ordinary optocoupler manages.
I don't remember the transistor theory enough to calculate any values so I'd experiment - starting with 100pF. It's called a Miller capacitance if you want to look around for a formula.
Well defined logic levels; when there's no light, how high is the collector voltage & how much light does it take to make it drop? And when there's light, how low is the collector voltage & how much less light does it take to make it rise?
 

eptheta

Dec 20, 2009
188
Joined
Dec 20, 2009
Messages
188
Right, i used a 100pf capacitor then a 473 pf then a 22 pf. 22 and 100 seem to work fine, and that kinda does solve my problem for now, so a big thanks. I am still quite unsure if the capacitor would interfere with the timing of the pulses,it does slow it down a bit...... Well i'll post here if i have any other problems in the near future. Thanks a lot.

Also, i know this is not the place, but ill take the opportunity to ask anyway. Instead of a counter, is there a way to input the clock signal to a computer parallel port where a program can read and save the data in say a text document ? If you know any resources or forums that deal with this sort of thing, could you please point them out ?

Thank you again.
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
Good to hear it helped.

Whenever introducing filters there's some delay/ phase shift involved. Whether it amounts to anything significant depends on how close the signal of interest is to the cutoff frequency of the filter.

It should be very easy to put the clock signal into the parallel port and make a program read it. No sites springs to mind but I'm quite sure there's plenty of recipes out there on the net. It's just a matter of searching with the right keywords.
 

eptheta

Dec 20, 2009
188
Joined
Dec 20, 2009
Messages
188
Sorry to revive this dead thread, but i wanted to reply (and i forgot to for quite a while). The project i was making turned out to be successful ! I used it to calculate the number of rotations by a model helicopter's blade for my physics project.
I wanted to thank you Resqueline, (it seems you are the only one running these forums...) for all your help.

Thanks.
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
Thanks for reporting back & for the thanks! Pleased to hear it worked out. (It's perfectly ok to revive threads for such reasons.)
I've been pretty much solo so far but there has turned up knowledegable helpers lately, so I'll have to keep on my toes now.. ;)
 
Top