Multiple IR-LEDs and IR-detectors for obstacle detection (Help needed)
Archiver
Posts: 46,084
Hi all,
This is my first posting in this forum so i'm sorry if the question
has been up for discussion before.
My problem is the following. I have connected three IR LEDs and two
IR detectors (wich sets a pin high when they receive a signal at
37500 Hz) to my BS2e. They are physically arranged like this:
[noparse][[/noparse]LED1 detector1 LED2 detector2 LED3]
By flashing the LEDs one by one and detecting reflecting light it is
possible to decide where in four sectors i detect an obstacle.
The code looks like this:
PAUSE 20
FREQOUT 11,2,38500
IR_Detect1=IN14
PAUSE 20
FREQOUT 12,2,38500
IR_Detect2=IN14
PAUSE 20
FREQOUT 12,2,38500
IR_Detect3=IN15
PAUSE 20
FREQOUT 13,2,38500
IR_Detect4=IN15
Here's the problem:
everything works fine with three of the of the sensings. When i add
the fourth (actually the first in the sequence) everything start to
flicker. I get random high and low readings on all the inputs.
When i run the first LED alone it works fine. I have tried switching
inputs, switching the LED and changing places of different pins. I
am completely puzzeled. Does it make any sense?
Regards
Magnus,
Stockholm, Sweden
This is my first posting in this forum so i'm sorry if the question
has been up for discussion before.
My problem is the following. I have connected three IR LEDs and two
IR detectors (wich sets a pin high when they receive a signal at
37500 Hz) to my BS2e. They are physically arranged like this:
[noparse][[/noparse]LED1 detector1 LED2 detector2 LED3]
By flashing the LEDs one by one and detecting reflecting light it is
possible to decide where in four sectors i detect an obstacle.
The code looks like this:
PAUSE 20
FREQOUT 11,2,38500
IR_Detect1=IN14
PAUSE 20
FREQOUT 12,2,38500
IR_Detect2=IN14
PAUSE 20
FREQOUT 12,2,38500
IR_Detect3=IN15
PAUSE 20
FREQOUT 13,2,38500
IR_Detect4=IN15
Here's the problem:
everything works fine with three of the of the sensings. When i add
the fourth (actually the first in the sequence) everything start to
flicker. I get random high and low readings on all the inputs.
When i run the first LED alone it works fine. I have tried switching
inputs, switching the LED and changing places of different pins. I
am completely puzzeled. Does it make any sense?
Regards
Magnus,
Stockholm, Sweden