reading IR photoresistor


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2006
    Posts
    76

    Default reading IR photoresistor

    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...ue_sensors.asp] setup (at the bottom of the page) because I have this [http://www.radioshack.com/sm-infrare...i-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
    Last edited by mbw123; - 27th January 2007 at 15:49.

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    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.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    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.
    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.
    Attached Images Attached Images  

  4. #4
    Join Date
    Jul 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    Thanks guys. I'll try it out and post my results.

    -Mike

  5. #5
    Join Date
    Jul 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    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

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mbw123 View Post
    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?

  7. #7
    Join Date
    Jul 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    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?
    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

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Hi,

    May be THIS could help ???

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

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mbw123 View Post
    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.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.

  10. #10
    Join Date
    Jul 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    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

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. PIC16F877A pwm use for IR transmission
    By mcbeasleyjr in forum General
    Replies: 0
    Last Post: - 11th July 2009, 18:51
  3. Plz help in completing RC-5 IR remote lamp dimmer project
    By vu2iia in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2008, 08:44
  4. PIC10F200 Automated IR Light Switch
    By Bruce in forum Code Examples
    Replies: 7
    Last Post: - 3rd May 2007, 11:40
  5. how to get pic to pic communication
    By kinsiro in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th August 2005, 17:12

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts