Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to work with Infrared transistor (Sensor) in normal daylight.

Status
Not open for further replies.

sandeep041

New Member
I am working on a project involving a robot to follow a dark line. I hv used a IR sensor to detect the dark(black) line.

I am following the notes from here:
**broken link removed**

1) Now the problem is I am noting tht the sensor is developing potentials from the day light. But as in tht article above I want to use the LED as the source for radiation. How do I achieve tht.

2) Is there any other sensor which I can be replaced for tht( if tht is easier to work with).

Thanks guys in advance:):)
 
LDR's respond slower than phototransistors, though. And they're going to have the same problem, being affected by sunlight. Can you shroud the detectors to prevent sunlight coming in?
 
of course they do. but you can avoid that by setting a threshold using op-amps, since the intensity of an LED light is constant compared to sunlight and at close proximity to the LDR,the LED wins in terms of intensity.
 
Any optical sensor is going to be activated by daylight which contains all wavelengths from infrared to ultraviolet.

What you need to do, is pulse the LED on and off at a certain frequency (for example 32kHz) and use a filter to ensure that your circuit only responds to that frequency.

You can buy IR sensor modules which the filter built-in.
 
Also, though I havent done it, I think using a second light sensor for a reference should take care of this. If you're not using a microcontroller I think it can be done with a Dedicated voltage comparator.
 
Take a look **broken link removed**. The page explains how to make a sensor insensitive to ambient light just like you want.
 
if you want the ldr or the phototransistor you can do this:
take an ordinary projector film, expose it to the ir radiation, devolop it, and you have made an IR filter..!
 
Take a look **broken link removed**. The page explains how to make a sensor insensitive to ambient light just like you want.

This technique seems curious the way it was implemented. I wonder if the author actually tested it. The output is pulled high by default and the sensor pulls it low. So the "LED off" reading would be higher than the "LED on" reading and, hence, the result would be negative and unreliable. Am I missing something on this?
 
Hi upand_at_them

The technique was used in an obstacle avoidance robot last year and works fine. There is no reason why more IR light can not be represented by a lower voltage. That does not make de result unreliable.

If the second measurement is lower than the first, there is reflected light falling on the photodiode. This means there is an obstacle. If the second measurement is equal to the first there is no reflected light an and no object

Slorn
 
That's my point, more light will result in a lower voltage. So the "total" variable will always be less than or equal to "ambient", but the result is "total - ambient".

Edit: Also, I don't know the processor speed used in that example, but LEDs aren't instantaneously on or off. They have a rise and fall time. I would wait 5-10uS between setting the LED and reading the sensor. And the LED should probably be turned off at the end of the routine instead of leaving it on...save on batteries.
 
Last edited:
You're right, there is a mistake in the code. It should be ambient - total. Thanks for pointing that out. The principle is correct though: measure the ambient light and the total light separately; subtract them to get the reflected light.
 
Good point about the rise/fall time. The ADC routine we used had a 125 us delay after the channel selection though so in our case it wouldn't have been a problem, but I can imagine that in some cases you'll need to account for this.
 
Last edited:
Slorn, this got me to thinking...Is "int" an unsigned 8-bit value? If so, then you may have had it right the first time:

Maximum ADC = 255
ambient light reading = LEDoff
ambient light offset = 255 - LEDoff
actual reading = LEDon + (255 - LEDoff)....yes, add, because the offset brought the value low it needs to be added back in
...so this should be the same as LEDon - LEDoff (because of rollover)
 
@upand_at_them:
I just checked our original code, it computed LEDon - LEDoff + 1023 (our PIC's ADC is 10 bits) -- which would in turn be interpreted just as a raw reading, i.e. as running from 1023 (no light) and going down for increasing reflection...
 
Hi Sudhanshu Nimbalkar, welcome to ETO!

This thread is from April of 2010--nearly 3 years ago. Chances are the OP has either received the answers he was looking for or moved on. There's generally no need to bring old threads back from the dead ;)

Regards,
Matt
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top