Connect with us

ir sensor range

Discussion in 'Microcontrollers, Programming and IoT' started by gurjant.sandhu33, Mar 3, 2014.

  1. gurjant.sandhu33

    gurjant.sandhu33

    51
    0
    Dec 10, 2013
    i have made an ir sensor obstacle detector for pic 16f870 and written code for it. it is working but its range is very less only about 3cm. is there any way to improve the range and also can i use some other sensor to improve its range. i want about 4 m range.
    this is the code-
    void main()
    org 0x10
    {
    TRISB=0x00;
    trisc=0xff;
    while(1)
    {
    if(portc.f0 == 0)
    {
    portb.f0=1; //on when there is interference
    delay_ms(2000);
    }

    if(portc.f0 == 1)
    {
    portb.f0=0;
    }
    }
    }
     

    Attached Files:

  2. jpanhalt

    jpanhalt

    426
    4
    Nov 12, 2013
    Which IR emitter and receiver are you using?

    Are you using an IR receiver that has noise cancelling circuitry and requires a pulsed IR emitter for maximum sensitivity? The pulse is usually 38 KHz more or less. And that pulse stream itself must be turned on and off at a defined rate. That is all explained in the datasheets.

    John
     
  3. gurjant.sandhu33

    gurjant.sandhu33

    51
    0
    Dec 10, 2013
    i used simple sensors which i bought from local shop they dont have any markings in them for part no.
    i have attached image for rx tx.
     

    Attached Files:

  4. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,266
    Nov 28, 2011
    Can the local shop tell you the part numbers? It's unusual for a shop to sell you parts but not know what they are.

    Infra-red may not be the best way to detect obstacles. If the obstacle is matte black it won't reflect any light so it will be invisible.

    John is talking about pulsed (amplitude-modulated) infra-red. This is the system used with infra-red remote controls. The IR transmitter is turned ON and OFF at a "carrier" frequency of around 40 kHz and the receiver has a bandpass filter so it detects only IR light that is modulated with that carrier frequency. This allows the receiver to reject other sources of IR light such as incandescent or fluorescent lights and sunlight, so it can give much greater range.

    You can buy IR receiver units that have the filter and detection circuitry included, and you may be able to generate the carrier directly with the PIC using a timer. Otherwise you might be able to derive it from the PIC's clock using a frequency divider.

    This method might give you better range. I'm not sure it would be reliable for detecting obstacles though. Have you considered ultrasonic?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-