Maker Pro
Maker Pro

ir sensor range

gurjant.sandhu33

Dec 10, 2013
51
Joined
Dec 10, 2013
Messages
51
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;
}
}
}
 

Attachments

  • images.jpg
    images.jpg
    13.8 KB · Views: 94

jpanhalt

Nov 12, 2013
426
Joined
Nov 12, 2013
Messages
426
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
 

gurjant.sandhu33

Dec 10, 2013
51
Joined
Dec 10, 2013
Messages
51
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.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    20.2 KB · Views: 84

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
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?
 

Similar threads

G
Replies
3
Views
1K
Phil in Melbourne
P
B
Replies
5
Views
2K
Bob (Robot Wars Thumper 1997)
B
B
Replies
0
Views
1K
Bob (Robot Wars Thumper 1997)
B
R
Replies
12
Views
1K
Tom Twist
T
Top