Interfacing photodiode into PIC microcontroller

Status
Not open for further replies.

msenniappan

Newbie level 3
Joined
Nov 27, 2015
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
37
My project is to detect the object passing through the photodiode and count it. But the problem is, the object passing the photodiode in fraction of seconds(in milliseconds) it makes very small amount of voltage difference in the output pin of the comparator. Google says we have to use transimpedence amp or so, I don't know much about theory. So can somebody help me to fix the issue. All I need is when object crossing the photodiode(whatever it's speed) I have to receive logic 1 or 0.

Note: I cannot change the sensor, because it's the can be mounted easily.
Thanks
MS
 

Hi,

whatever it's speed
This specification is impossible to achieve.

I cannot change the sensor
This implies we should not suggest you to use another sensor, but on the other hand you don't tell us what sensor you use.
This makes helping difficult.

All I can say is, that I agree with google.

Did you try it?
If no, why not?
If yes, what was the result?

How can we help?

*******
Besides the speed problem, there is often the problem of ambient light. Therefor a lot of sensors use a modulated light source.
In your case there is a need for a some kHz light source. Then only the modulation frequency is filtered and processed.

We need more information

Klaus
 

Hi, Sorry for the inconvenience. Let me explain my project briefly.
Photo-diode and LED will be placed in approx 5cm distance. When the light falls on photo diode it has to give a logical high/Low output. If no light it has to give opposite output. But the problem is. Object is crossing the sensor in fraction of second, so it gives very little voltage(millivolts) difference. So how to sense that voltage. Please find attached picture(FIG 1) for the circuit I'm using. And I don't know what type of photo diode it is. It look similar to LED.
One more thing, The same setup has been made by someone else using LM324 op-amp IC It works fine. But i couldn't understand the circuit. Can you help me to understand the circuit if possible. I have attached the circuit also on FIG 2.





Thanks
MS
 

Yup, its a drawing mistake. Actually the circuit works when the object moves very slow. But Its not working if object moves very fast. All I need is to improve fraction time.
 

Why are you operating the photo diode forward biased? This gives you about no sensitivity.

- - - Updated - - -

How about reducing the filter capacitor values? If you are referring to the first schematic, there are no filters.

What's the speed of the object you want to detect?
 

I think it's actually reverse biased but the polarity of the supply input is shown as negative instead of positive (fig 2).

It certainly isn't the way to get a fast response and the diagram in fig.2 seems way over complicated and mostly unnecessary. We need to know the length of the shortest anticipated light blockage to be able to suggest better ways of filtering (if actually needed). Connecting 122nF across the signal is crazy!

Brian.
 

Hi,

about your circuits of post#3:
* The first is an OPAMP LM324 but used as comparator.
--> I recommend to use a comparator when you need a comparotor circuit.
--> The 10k with the diode connection makes the circuit slow. Uusally there is light on the soensor, so there is current through the sensor, pulling the voltage against GND. But the "release", when an object crossing the sensor is slow. I thas no protection against ambient light. Is the sensor protected against ambient light?

* the second circuit is a three stage amplifier folowed by a comparator circuit with hysteresis. But the input circuit is very slow.

***
I recommend to read some application notes about photodiode connection to a transimpedance amplifier.
Usually any capacitance makes a circuit slow. The benefit of the transimpedance amplifier is, that the voltage across the diode never changes (negligible). With no voltage change the charge current of the capacitance is neglegible. The circuit is fast.
--> Use a high speed amplifier. Use a low noise reference voltage for biasing the diode (to In+ of the transimpedance amp). Best is to add an RC low pass filter.
Select the feedback resistor in a way that the opamp output never saturates.
To get a reliable threshold with a bit of ambient light suppression: I ´d add an RC lowpass combined with a voltage divider (to VRef, about 90%) at the transimpedance amp output. This gives the one input to a comparator. The other imput is the direct connection of the transimpedance output.

How it works:
Lets say you use single +5 as supply. 1.25V as bias reference. Use RR IO opamp and comparator.
IN+ is 1.25V. The same is across the photodiode. choose feedback so that with full light to the photodiode there is max. 4.5V at OPAMP output.
The LPF at the output should be slow ( tau of about 1s or so), The LPF will give an output voltage of (1.25V + (4.5V -1.25V) * 0.9 after a while. = 4.175V
Every time an object passes the sensor the photodiode current decreases very fast and the OPAMP output voltage decreases also. Maybe from 4.5 down to 4.0V.
The LPF voltage is slow, so you may calculate with 4.175V or a bit less.
But the direct output changes fast from 4.5 to 4.0V... Therefore the comparator switches state.

The LPF gives a bit of ambient light suppression. But if there is a very slow object passing the sensor the LPF may be problematic.

Hope this helps.

Klaus
 
Why are there two schematics?
Why is the photo-diode in the first one reverse-biased like it should be but is fed by a 10k resistor with a value that is much too low instead of 1M? The word "photodiode" should be IR LED and "IR receiver" should be IR photodiode.
Why is the photo-diode in the second hard to see (grid lines, brown background) schematic forward-biased so it does not work?

This is the very first time I have seen a single supply opamp with a negative supply.
 

Yup, it's been protected by ambient. Hope this will work, let me check and let you know.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…