PDA

View Full Version : Detect fast movement using photodiode



Pic2008
- 21st November 2008, 16:12
I have used LDR and a LED to detect small objects moving across it ~ 1 cm.
The object is 5mm x 5 mm.
This design is useful to detect slow object.

But I would like to detect very fast movement across LED and photodiode.

However the output of a photodiode is analog. How do i go about interfacing this circuit to PIC16F877? To detect the photodiode input, I plan to enable PortB INTB interrupt so it will send a serial message to PC immediately. Is this circuit sufficient to detect fast movement or do I need IR or laser? The distance between tx and rx is ~1cm.

Any suggestion is welcome.

mackrackit
- 21st November 2008, 17:34
No need for analog.

Tie the cathode of the photo diode to the PIC pin with a 10M ohm pull up. The anode of the photo diode to zero(ground). When no light is detected the PIC pin will go LOW.

Used an IR diode for a dedicated light source.

You will have to shield from ambient light to keep from having false readings.

This is very similar to how a mouse works. Very fast and reliable.

I have used this setup to detect parts moving in excess of 6 inches per second.

Pic2008
- 22nd November 2008, 03:23
That means I just connect the IR LED continously to 5V with series resistor , no need to modulate the IR Tx?

mackrackit
- 22nd November 2008, 07:38
That means I just connect the IR LED continously to 5V with series resistor , no need to modulate the IR Tx?
Correct.
As long as you do a little shielding for ambient light. Basically you can look at the modulation used in IR remote control applications as a way of electronically shielding.

Ty it. Take a photodiode, put a piece of heat shrink or something else around it so only the end can receive light. Connect it to a meter instead of the PIC, have sitting in a shadow. Hit the end of the photodiode with IR or some other light source and test.

You can also reverse the photodiode connection and have it detect light instead of dark.

Archangel
- 22nd November 2008, 08:58
Word on the street is: Use a PIC with Schmitt trigger inputs for better results. Better results due to Schmitt triggers hysteresis's gives input port a snap action, dampens analog effect.

Acetronics2
- 22nd November 2008, 10:10
Word on the street is: Use a PIC with Schmitt trigger inputs for better results. Better results due to Schmitt triggers hysteresis's gives input port a snap action, dampens analog effect.


Yesss Joe ...

Much better, as comparators directly can generate the interrupt ...

Over that I'd try to use a compensation stage to correct for ambiant light ... look at the attached scheme ... left side of Transistor T2.

Alain

mackrackit
- 22nd November 2008, 10:24
Along the same lines, the data sheet for the part Alain points out has on page 11 another nice way of doing it.
http://www.google.com/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.intersil.com%2Fdata%2Ffn%2Ffn 1%2Ffn1050%2Ffn1050.pdf&ei=1tsnSZ6xHZmWsAPv2OCdAg&usg=AFQjCNGrMKlQc5944IJ_ndE4YtTqenvMEw&sig2=6mhnuFXJSILdHEv5RRcHYQ

Acetronics2
- 22nd November 2008, 10:46
Along the same lines, the data sheet for the part Alain points out has on page 11 another nice way of doing it.
http://www.google.com/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.intersil.com%2Fdata%2Ffn%2Ffn 1%2Ffn1050%2Ffn1050.pdf&ei=1tsnSZ6xHZmWsAPv2OCdAg&usg=AFQjCNGrMKlQc5944IJ_ndE4YtTqenvMEw&sig2=6mhnuFXJSILdHEv5RRcHYQ

Hi, Dave

Not so nice ...

as the goal, here, is to take care the detectors are not saturated by light ...

Alain

mackrackit
- 22nd November 2008, 10:58
Hi, Dave

Not so nice ...

as the goal, here, is to take care the detectors are not saturated by light ...

Alain

Maybe... but if the OPs part was to pass the two detectors causing the differential ?? then saturation may not be a problem ??

I am going to try it some day. Just an idea.

Acetronics2
- 22nd November 2008, 11:01
then saturation may not be a problem ??

I am going to try it some day. Just an idea.

Halas !!!

when saturated ... your detectors won't "see" anything ... both of them !!!

no differential signal nor ...

Alain

mackrackit
- 22nd November 2008, 11:11
Halas !!!

when saturated ... your detectors won't "see" anything ... both of them !!!

no differential signal nor ...

Alain
I am thinking along the lines of both detectors being saturated but spaced maybe a centimeter or so apart. When the piece being detected cast a shadow on one and not the other then the differential. I guess it would only work if the light source was coming from one direction only........Darn, now I am back to square one :o

Pic2008
- 22nd November 2008, 13:49
Halas !!!

when saturated ... your detectors won't "see" anything ... both of them !!!

no differential signal nor ...

Alain

From that datesheet, it said that the circuit will not be sensitive to changes in light as the source ages, this means saturate right?

That means I can't connect IR TX continously?

Acetronics2
- 22nd November 2008, 14:07
From that datesheet, it said that the circuit will not be sensitive to changes in light as the source ages, this means saturate right?

That means I can't connect IR TX continously?

Hi,

That means aging will modify BOTH sources ... but "saturate" means the sensors ( not the source ...) cannot make any difference in light changes.

just as if you look straight at the sun ... you can't distinguish anything more in the sky , even in front of you !!! ( the model plane you should fly is a "good" example here ... lol : little chanche for you to keep it in the air ... )

Alain