IR sensor

Digital Fiber, Photoelectric, Laser Range, Optical, Temperature, Rotary Encoder, Ultrasonic, Gas, Gyro, Accelerometer, FlexiBend, Flexiforce, Compass......

IR sensor

Postby picpicpikapika » Tue Mar 01, 2011 4:22 pm

Hi, currently I am building a mcu controlled racing car and I am using IR sensor and DC motor in my project.
I am thinking of using the PR4(DIY Project) idea (using LM324 comparator) to supply digital logic signal to my mcu from the IR sensor.
But I have some problems regarding to the comparator.
Basically, I have tested the comparator circuit using LED as the comparator output, the logic works but i have a problem here, from what I know when the Vref- is greater than Vref+, the output of the comparator should be 0V and vice versa...but this logic is applicable only when the difference is big enough. As an illustration, if my Vref- is 4.5V, the output of the comparator will only become 0V when my Vref+ is less than around 3.9V. I would like to know why the comparator do not work for 4.1V, 4.2V or 4.3V since they are also less than 4.5V??? Is this the nature characteristic of LM324?? If yes, I would like to ask is there any other comparators which are more precise???
Thanks a lot...
picpicpikapika
Apprentice
 
Posts: 46
Joined: Thu Feb 10, 2011 5:57 pm

Re: IR sensor

Postby shahrul » Tue Mar 01, 2011 5:41 pm

I have use LM324 comparator, it's function but I never measure detail voltage that compared. See example PIC IR Sensor.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: IR sensor

Postby ober » Tue Mar 01, 2011 9:44 pm

Not really measure the voltage same as Shahrul case. :D

Anyway it do work fine on line following.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: IR sensor

Postby ABSF » Wed Mar 02, 2011 5:17 am

But I have some problems regarding to the comparator.
Basically, I have tested the comparator circuit using LED as the comparator output, the logic works but i have a problem here, from what I know when the Vref- is greater than Vref+, the output of the comparator should be 0V and vice versa...but this logic is applicable only when the difference is big enough. As an illustration, if my Vref- is 4.5V, the output of the comparator will only become 0V when my Vref+ is less than around 3.9V. I would like to know why the comparator do not work for 4.1V, 4.2V or 4.3V since they are also less than 4.5V??? Is this the nature characteristic of LM324?? If yes, I would like to ask is there any other comparators which are more precise???


I have tried out the LM324 used as a comparator long ago and in my memory it shouldn't be that unsensitive. I've try again with my simulator this morning and it took .2 (ie 4.3V) difference to trigger the output to 0.55V driving an LED through 330 ohm. The LM324 has quite high open-loop gain and should work fine. But you cant expect it to go all the way down to 0V(due to input offset I guess).

A better comparactor is the LM339 (quad) LM393 (dual) and LM311 (single). It was an op-amp designed as a comparator with hystersis loop built in and it has also open-collector output. Put a 10K resistor from the output to Vcc when taking voltage measurement.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: IR sensor

Postby picpicpikapika » Wed Mar 02, 2011 6:42 am

Hi guys thanks for the replies, I will try with the LM339 first...
I have another question regarding to the IR sensor.

From what I know, when the light intensity is stronger the voltage output of the receiver will be lower (I am using voltage divider circuit for the receiver). It means when a white colour or reflective surface is approaching my transmitter and receiver, my voltage divider output should be decreasing. On the contrary, when a black colour or nonreflective surface is approaching my transmitter and receiver, my voltage divider output should be increasing.

I have tried with the white colour surface and the outcome is ok...it is able to decrease to minimum 3.7V from 4.5V when I put the white colour surface above a certain distance on top of my sensor, and my comparator output was able to act accordingly.

But when I tried to experiment with black colour surface, the voltage change was insignificant, maybe from 4.5V to 4.6V...with the insensitivity of my comparator we can expect nothing will happen :lol:. So I would like to ask how to increase the voltage difference when we are using black colour surface(but I think it is quite impossible since my supply voltage to the receiver is only around 4.8V). Or is there any other methods??

Thanks a lot...
picpicpikapika
Apprentice
 
Posts: 46
Joined: Thu Feb 10, 2011 5:57 pm

Re: IR sensor

Postby ABSF » Wed Mar 02, 2011 9:44 am

picpicpikapika WROTE:
From what I know, when the light intensity is stronger the voltage output of the receiver will be lower (I am using voltage divider circuit for the receiver). It means when a white colour or reflective surface is approaching my transmitter and receiver, my voltage divider output should be decreasing. On the contrary, when a black colour or nonreflective surface is approaching my transmitter and receiver, my voltage divider output should be increasing.

I have tried with the white colour surface and the outcome is ok...it is able to decrease to minimum 3.7V from 4.5V when I put the white colour surface above a certain distance on top of my sensor, and my comparator output was able to act accordingly.

But when I tried to experiment with black colour surface, the voltage change was insignificant, maybe from 4.5V to 4.6V...with the insensitivity of my comparator we can expect nothing will happen :lol:. So I would like to ask how to increase the voltage difference when we are using black colour surface(but I think it is quite impossible since my supply voltage to the receiver is only around 4.8V). Or is there any other methods??


OK, There is a way to work around this problem. On white surface the range is 3.7 to 4.5 and on dull surface it's 4.5 to 4.6V I'll give you an example how I'd do it just to give you some ideas.

First, use 1/4 of LM324 to make a difference amp and strip off 3V from the sensor input. V1 is the sensor voltage and V2 is the offset voltage (3V). The output will be 0 to 2V coming out of the 1st op-amp. Then connect this output to a second op-amp with a gain of 2.5. The output from the 2nd op-amp would be 0 - 5V. This output is then fed into your comparator so it has a bigger range of change. Even a dull surface now would have a change of 250mV. The schematic is attached here for ref.

But of course, in real world, it is not possible to get 0V output from LM324 due to the high offset input voltage (check the LM324 datasheet). So the minimum I can get is .5V on 1st op-amp and after amplified by 2.5 times, it is 1.25V on 2nd op-amp. So the output of 2nd op-amp will vary from 1.25V to ~4.5 volts.

Allen
Attachments
LM324 COMP.JPG
op-amp with offset and gain=2.5
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: IR sensor

Postby ober » Wed Mar 02, 2011 10:00 am

picpicpikapika WROTE:From what I know, when the light intensity is stronger the voltage output of the receiver will be lower (I am using voltage divider circuit for the receiver). It means when a white colour or reflective surface is approaching my transmitter and receiver, my voltage divider output should be decreasing. On the contrary, when a black colour or nonreflective surface is approaching my transmitter and receiver, my voltage divider output should be increasing.

I have tried with the white colour surface and the outcome is ok...it is able to decrease to minimum 3.7V from 4.5V when I put the white colour surface above a certain distance on top of my sensor, and my comparator output was able to act accordingly.

But when I tried to experiment with black colour surface, the voltage change was insignificant, maybe from 4.5V to 4.6V...with the insensitivity of my comparator we can expect nothing will happen :lol:. So I would like to ask how to increase the voltage difference when we are using black colour surface(but I think it is quite impossible since my supply voltage to the receiver is only around 4.8V). Or is there any other methods??
Thanks a lot...


1st, IR receiver is does not depend on light intensity, specifically, it should be infrared intensity. When you say voltage changes, you are referring to?

In your example, white surface changes the voltage from 4.5V to 3.7V as compare to nothing blocking your infrared or in other words, is non reflective objective, correct?

Black surface does not reflect any infrared or less, it is nearly same to nothing is blocking the infrared. Thus, if you compare 2 same condition, there is no significant changes, which is normal. When there is no infrared reflection, it can either be the sensor does not have anything in front of it, or something that cannot reflect infrared, therefore black surface and nothing blocking it is the same condition, or I would say nearly same in your test. The 0.1V changes might be fluctuation of mutlimeter or even noise on the circuit.

If you are using it for line following, it is normal to have only blank and white or 2 colors condition.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: IR sensor

Postby picpicpikapika » Wed Mar 02, 2011 4:10 pm

Hi, thanks for the replies...
Actually, the black colour surface that I metioned doens't mean dull surface...I am expecting to use infrared sensor to detect the black colour surface...
If the black surface and nothing blocking is the same condition to the infrared sensor...
So how if my racing car is designed to detect black colour tape on the floor???
picpicpikapika
Apprentice
 
Posts: 46
Joined: Thu Feb 10, 2011 5:57 pm

Re: IR sensor

Postby kl84 » Wed Mar 02, 2011 4:52 pm

picpicpikapika WROTE:If the black surface and nothing blocking is the same condition to the infrared sensor...
So how if my racing car is designed to detect black colour tape on the floor???

Ober is right. In this case, you can track the 'non-black' area, bro :!:
User avatar
kl84
Amateur
 
Posts: 166
Joined: Thu Jul 08, 2010 12:14 pm

Re: IR sensor

Postby picpicpikapika » Wed Mar 02, 2011 5:14 pm

Hi, I dun really understand...if I am not going to use other colour tapes except black colour one...and the runway for my car has only a black colour tape at the end...according to ober, the infrared intensity of black colour surface and normal rough surface to the receiver is the same...so how am I going to detect this black colour tape since no voltage difference(output voltage of the sensor) between this black surface and my track???
picpicpikapika
Apprentice
 
Posts: 46
Joined: Thu Feb 10, 2011 5:57 pm

Next

Return to Sensor

Who is online

Users browsing this forum: No registered users and 9 guests

cron