# operational amplifier in project...urgent

Discussion in 'Embedded Systems and Microcontrollers' started by SSMNITHMR, Mar 21, 2009.

1. ### SSMNITHMR Thread Starter Member

Feb 22, 2009
12
0
http://www.scribd.com/doc/13394345/shankarnitian contains the circuit diagram .
i wish to know the function of the operational amplifier..LM324.as i understand,the dark current of the photransistor is 100 nA and on-state current is around 1mA.when the photransistor is blocked ,the input to the single supply op amp goes low and it's output is high(5v),while if the light is allowed to fall on the phototransistor,the 1mA current causes the output to go low(0v).but logical '0' is pereived in ucontroller only if 0.45 v is received and high if 2 v is received.i can't understand how this happens.please someone explain me the use of having an led and 1k resistor connected to output of opamp also.

2. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
782
Logical low will be anything less than or equal to 0.45V and logical high will be anything greater than or equal to 2V. As long as the signal value lies outside of the "indeterminate" range of 0.45 to 2.0V there is no ambiguity as to the logical state.

The LM324 operational amplifier is being used as a comparator to detect the two logical states of either photo-transistor condition - that is being in the "on" or "off" state.

3. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
As far as the red/green LEDs and 1k resistors, they are simply indicators to show when something is detected by the sensors. The 1k resistors limit the current through the LEDs so they are "indicator dim" rather than very bright.

4. ### SSMNITHMR Thread Starter Member

Feb 22, 2009
12
0
if the leds glow when something is detected by the sensors,the output of op am has to go low,i.e 0v,.hence do i need to check a low on the port 1.0 to indicate that ir sensor is blocked?

5. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
What is being detected? Is it an opto-interrupter so light not reaching the phototransistor is "something detected"?

Or is it detecting a reflection of a light colored surface, where light reaching the phototransistor is "something detected"?

The LED's don't care either way, in a manner of speaking. Seeing them blink simply lets you know that the infrared and comparators are working when they are supposed to (either on on detection or off).

6. ### SSMNITHMR Thread Starter Member

Feb 22, 2009
12
0
the phototransistor is supposed to be receiving the ir rays from ir leds constantly.in case an object passes in between,the ir rays momentarily fail from reaching the phototransistor .so what is output of op amp in either case?

7. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
The output of the comparator will go low, lighting the LED, but the uC will receive a low input when the phototransistor is illuminated.

8. ### SSMNITHMR Thread Starter Member

Feb 22, 2009
12
0
well sir,that's what i want to know.how will the uc receive a high input when the pototransistor is blocked?

9. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,357
718
The output of the comparator will go high when the transistor doesn't have enough light on it. The uC needs to test for low, or switch the + and - inputs to the comparator to make it active high.