Shop OBEX P1 Docs P2 Docs Learn Events
Detection distance with the Infrared Receiver from Parallax an SX. — Parallax Forums

Detection distance with the Infrared Receiver from Parallax an SX.

markustermarkuster Posts: 184
edited 2008-08-07 19:52 in General Discussion
Hi,

I need to increase distance using the Infrared Receiver
(Item code 350-00014) with the Parallax IR emitter.

When I use that sensor with a Basic Stamp I can detect
an object at about 3 feet (max) , but the same sensor
with the SX 28 is about 2 inches only.

How can I increase this distance using SX28 microcontroller?

Thanks, Mark

PS:
Please see the rutine:






DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ 4_000_000

PROGRAM Start

INI:

DO
FREQOUT RB.1, 10, 38000 'RB.1 OUT LED IR
IF RB.2= 0 THEN 'RB.2 OUT from sensor IR
HIGH RB.0 'RB.0 LED INDICATOR
PAUSE 500
LOW RB.0
PAUSE 500
ENDIF
LOOP

Comments

  • JonnyMacJonnyMac Posts: 9,215
    edited 2008-08-07 17:10
    You should check your modulation frequency versus the detector you're using -- if it's close, but not right on then the detection distance will fall off considerably. You might try 38500 and 40000 in the code above to see if that gives better results. Of course, the ideal thing to do is look up the datasheet for your detector to see what the actual demodulation frequency is.

    [noparse][[/noparse]Edit] The datasheet is right on the Parallax page for that part (PNA4601M), and according to it the modulation frequency is 36700.

    www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/PNA4601M.pdf

    Post Edited (JonnyMac) : 8/7/2008 5:17:22 PM GMT
  • BeanBean Posts: 8,129
    edited 2008-08-07 17:23
    Also the sensor may need to see a pulse longer than 10milliseconds.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "A government big enough to give you everything you want, is big enough to take away everything you·have."·· Thomas Jefferson

    "It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter

    www.iElectronicDesigns.com

    ·
  • markustermarkuster Posts: 184
    edited 2008-08-07 17:42
    Thanks,

    I have made changes:

    Now , the pulse is longer than 10millisecond ( I am using more than 10 i.e 15, 20, etc. )

    and I am using different modulation frequencies but I have the problem yet.


    Many thanks for you fast response and support.

    Any way if you have an other idea about how can I increase the range
    please help.

    Thanks, Mark
  • JonnyMacJonnyMac Posts: 9,215
    edited 2008-08-07 17:55
    What is the resistor value you have between your IR LED and the SX pin? You should calculate the value to drive at 20 mA -- safe for the pin and LED, especially since it is being modulated.
  • markustermarkuster Posts: 184
    edited 2008-08-07 19:43
    Hi ,

    I am using no resistor because I need to increase the detection range.

    The same circuit works better using a Basic Stamp ( 3 feet)
    but using SX28 is about 2 inches only.

    Do you know why ?

    thanks, Mark
    PS: Please help.






    DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
    FREQ 4_000_000

    PROGRAM Start

    INI:

    DO
    FREQOUT RB.1, 20, 38500 'RB.1 OUT LED IR
    IF RB.2= 0 THEN 'RB.2 OUT from sensor IR
    HIGH RB.0 'RB.0 LED INDICATOR
    PAUSE 500
    LOW RB.0
    PAUSE 500
    ENDIF
    LOOP
  • JonnyMacJonnyMac Posts: 9,215
    edited 2008-08-07 19:52
    It's never a good idea to drive an LED directly -- you should have at least 220 ohms.

    Remember that modulation frequency affects detection distance. Your code is specifying the use of the internal RC oscillator which is not as accurate as the resonator used on the BASIC Stamp. Add a 20 MHz resonator to your circuit and change the setting to OSCXT2; this will give you the better accuracy with FREQOUT and a real chance to increase detection distance.
Sign In or Register to comment.