PDA

View Full Version : reading IR photoresistor



mbw123
- 27th January 2007, 15:42
Hello everyone,

I am using a PIC18F4550 and I am trying to measure the strength of an IR beam (translating to distance). I am using this [http://www.phidgetsusa.com/tutorials/analogue_sensors.asp] setup (at the bottom of the page) because I have this [http://www.radioshack.com/sm-infrared-phototransistor--pi-2049724.html] photo transistor. I am using ADCIN to read the values of the photo transistor with a 2200 ohm resistor hooked up to it. I am unsure, however, about what resistor value to use with it because when I hook everything up, it doesn't seem to be working well. Usually it will print a value around one or two (with 8 bits conversion for ADCIN) with no IR light on. When I turn an IR led on I am getting the same value (I am positive the IR emitter is working). Please help.

PS: I know there was a recent post similar to this on this [http://www.picbasic.co.uk/forum/showthread.php?t=5592] but it doesn't have what I am looking for.

Thank you,

-Mike

paul borgmeier
- 28th January 2007, 13:55
If the link is correct, they are using a “photo resistor” as part of a simple voltage divider circuit. Your Radio Shack part is a “photo transistor” not “resistor” - you need to connect it in, I would guess, in some form of a “common-emitter” fashion – try something like 10k from the collector to 5V, 1M from the emitter to ground, and ADCIN at the resistor collector junction. You might need to vary the 1M resistor way down (even less than 10k), depending on your IR signal. Further, this transistor will pick up all wavelengths of light – not just IR so it will be affected by ambient light.

dhouston
- 28th January 2007, 14:39
You need two resistors with the phototransistor as shown in the attached GIF.

The phototransistor is an infrared sensor but you will get the best results if you use one that is designed for the same wavelength as your IR source. Ambient light also contains IR so range is usually rather limited for unmodulated IR as you cannot differentiate between signal and ambient IR. For example, IrDA which uses 850nm unmodulated IR has an effective range of about 1-2 meters.

This link might help you understand the fundamentals of IR.
http://davehouston.net/ir-rf_fundamentals.htm

I would not use the perceived strength of the IR beam to measure distance. There are two many variables that will affect it. The normal method is to send a pulse of ultrasound and measure the time it takes to echo back.

mbw123
- 28th January 2007, 21:11
Thanks guys. I'll try it out and post my results.

-Mike

mbw123
- 29th January 2007, 01:38
dhouston, you said that I should send a ultrasound pulse to find distance. But how would I track the position of a specific object (one with a IR emitter, for example) without using anything too complex or expensive like a camera? Thanks for any advice.

-Mike

skimask
- 29th January 2007, 02:10
dhouston, you said that I should send a ultrasound pulse to find distance. But how would I track the position of a specific object (one with a IR emitter, for example) without using anything too complex or expensive like a camera? Thanks for any advice.

-Mike

How about triangulating the angle between 2 narrow angle IR sensors mounted on seperate servo driven platforms X amount of distance apart? That would give you relative position and distance. Put in on a motor driven platform and you can follow anything...
Sounds like fun doesn't it? :D

mbw123
- 29th January 2007, 02:19
How about triangulating the angle between 2 narrow angle IR sensors mounted on seperate servo driven platforms X amount of distance apart? That would give you relative position and distance. Put in on a motor driven platform and you can follow anything...
Sounds like fun doesn't it? :D

Uh oh, I smell a difficult project ahead if I were to try that. If I stuck with what I am doing (IR emitter and receivers) , what difficulties would I run into as far as measuring distance using just IR?

-Mike

Acetronics2
- 29th January 2007, 09:50
Hi,

May be THIS could help ???

http://www.kronosrobotics.com/an120/AAN120.shtml

Alain

dhouston
- 29th January 2007, 13:00
dhouston, you said that I should send a ultrasound pulse to find distance. But how would I track the position of a specific object (one with a IR emitter, for example) without using anything too complex or expensive like a camera? Thanks for any advice.
I don't think there's any easy (or cheap) way to do this, especially if you want both range and direction as you've indicated elsewhere.

You might get some ideas from reading how the Sharp IR rangefinders work but you should note that they cannot tell you the direction to the object and they also require a reflective object instead of using an IR emitter on the target.http://www.acroname.com/robotics/info/articles/sharp/sharp.html
If you can modulate the IR emitter and use IR receivers designed for that modulation frequency, you can identify your target. Maybe, with multiple receivers and triangulation you can find the direction. However, the IR receivers have AGC circuitry built in that affect signal strength and they are designed to merely output a digital pulse not a continuous analog signal so you get no indication of signal strength.

mbw123
- 29th January 2007, 23:04
I appreciate the responses. I may have to abandon this project because of the aforementioned difficulties. However, for future projects, how would I strengthen the sensitivity of the ADCIN reading from the IR circuit given earilier? Should I increase resistor strength or lower it?

Once again thanks for the help.

-Mike