I have set up the IR receiver and IR LEDs like this :
I tested the left infrared (pin 9 and 10).
It detects white paper and black line the same ( it reads 0)
Is there any way to make the infrared only read a dark object (black line) and ignore a white object (white paper)?
white color reflects the infrared light
black absorbs all infrared light
that is why all infrared sensors are black in color
its the property of color
if you want to detect black line then its only reliably detected when that black line is painted over white color or a very light color
Why don't you just reverse the action in the sketch logic?
You have a high sometimes and a low sometimes; you know which of those is light and dark, so just take care of that in logic.
Pseudo code:
read high
do dark stuff
read low
do light stuff
or....
read low
do dark stuff
read high
do light stuff
Sorry I think I did not make myself clear
so the infrared reads black line and white paper the same.
It produces 0 when it detects black line or white paper
I think the problem is with this part of the code (example from the parallax website):
int irRight = irDetect(2, 3, 38000);
int Left = irDetect(10, 11, 38000);
It will still read 0 for white paper and black line.
The thing is, I tried to change 38000 hz to 3800 hz and it works (reads black line as 1 instead of 0) but only for one infrared sensors
I tried to code it for 2 sensors and it would only works for one of the sensors (I tried for each of them)
It would not work if i want to do it at the same time
Hi,
I don't see the point in running line detection at 38KHz! just use DC, the sensors are usually under the vehicle and don't see much ambiant light!!
Also they both need to be pointing in the same direction and your's don't seem to, or is it just the image that looks that way. you could use a device that contains both the IR-Led and IR-Photo trans, see Vishay TCRT1000/1010 or TCRT5000L this is the way I usually go (Cheap fron China). I have just used the TCRT1000 for detecting teeth on wheels for turning control.
@ arpitgupta363 If IR sensors are all black to absorb IR, no IR would get to the sensor element, IR sensors are black to filter out all visible light!! which is why IR works thro' some plastics, black bin bags, etc. And why you can't use IR film in a plastic bodied camera..
Hope it helps, for more info www.melsaunders.co.uk under electronics
Regards
Mel.
You didn't provide the model number of the IR sensor (? receiver) you are using.
If it is a standard TV IR receiver, you most likely will not see much of a (=any) difference between white & black at close range.
Knowing the model number would help, along with a photo of your setup or alternatively a drawing.
Hi,
Just finnished my line follower PCB, test seems to prove it's working as it should, but I need to fit it and test more yet.
Here's a picture, if it helps.
Regards
Mel.