Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   New Infrared Remote Control Software (http://www.chiefdelphi.com/forums/showthread.php?t=65065)

writchie 09-03-2008 21:56

Re: New Infrared Remote Control Software
 
Beware of Differing Pinouts on Vishay IR Sensors.

There are different versions of the Vishay sensors in Identical packages.
The TSOP48xx family is one that works as documented with Gnd on Pin 2.
However, the TSOP322 family, which is arguably better because of its 2.7 - 5.5V power supply range, has ground on pin 3 and power on pin two. This is
reversed from TSPO48xx family.

IF YOU USE A TSOP322XX FAMILY SENSOR AND FOLLOW KEVIN'S DIAGRAM
YOU WILL INSTANTLY FRY THE SENSOR.

Good practice is to always make sure you have a datasheet for the actual
device you are using and double check the connections.

writchie 09-03-2008 22:19

Re: New Infrared Remote Control Software
 
Quote:

Originally Posted by gauntletguy (Post 713313)
would it be possible to wire multiple sensors together?

Short answer is yes. The output is a transistor with a 30K pullup. It should
remain well within spec with 3 additional identical devices plus the current
sourced from the Robot Controller. So you should be able to have a total
of 4 sensors on one input. (You could probably have several more but then
you will be outside the 250mV max output low voltage specification.

Beware, however, that you be subject to interference from any sensor
which may prevent your desired signal from getting through. An interfering
signal on the same carrier frequency being received from any of the sensors
will interface will all sensors.

A more robust approach would be to use separate interrupts for multiple sensors
f you have the available interrupts (from 3 to 6). This way, an interfering signal being received from one sensor will not mess up the signal
being received at the other sensor. You will need to modify the code to
share a timer.

writchie 09-03-2008 22:29

Re: New Infrared Remote Control Software
 
Quote:

Originally Posted by neoshaakti (Post 713295)
correct me if I am wrong, but isnt that IR receiver the same kind that is locating in any computer mouse?
I know that if you are using a mouse with a ball in it, when the ball turns and moves it spins a shaft. On the end of the shaft there is a disk with usually 36 slits so that an IR beam can be picked up by an IR receiver to determine the movement of the mouse.
I have a rough understanding...
yea

-Neel

IIRC a mouse uses a fairly simple interrupter. The Vishay IR receiver modules have a more complex integrated receiver that handles pulse bursts of a specified frequency and use AGC, a bandpass filer, and a demodulator to produce a very stable output pulse train. Interference is not an issue inside a (mechanical) mouse. It's a big issue for remote controls.

Ian G 10-03-2008 23:41

Re: New Infrared Remote Control Software
 
Would it be possible to use the sensor off of the IR board instead of buying a new sensor? Thanks.

Kevin Watson 11-03-2008 00:30

Re: New Infrared Remote Control Software
 
Quote:

Originally Posted by Ian G (Post 716144)
Would it be possible to use the sensor off of the IR board instead of buying a new sensor? Thanks.

Assuming you can remove it without damaging it, it should work just fine. Here's the datasheet.

-Kevin

Ian G 11-03-2008 14:10

Re: New Infrared Remote Control Software
 
Quote:

Originally Posted by Kevin Watson (Post 716166)
Assuming you can remove it without damaging it, it should work just fine. Here's the datasheet.

-Kevin

Thanks, I had to check before we wasted valuable time on Thursday.

Ian G 18-03-2008 09:31

Re: New Infrared Remote Control Software
 
I tried to make a quick fix to increase the coverage of our IR sensors by quickly adding a second interrupt and third interrupt. I knew the way I did it wasn't right, but it mostly worked enough. I was wondering what I would have to do to properly add more interrupts to the the IR code. I don't like wiring multiple sensors in parallel, because it looks like if the sensors receive signals at different times, their output pulses will interfere.

Here is what I did:

Code:

                #ifdef ENABLE_INT_3
                if(Port_B_Delta & 0x10) // did external interrupt 3 change state?
                {
                        IR_Sensor_ISR(Port_B & 0x10 ? 1 : 0); // call the interrupt 3 handler (in interrupts.c or encoder.c)
                }
                #endif
                #ifdef ENABLE_INT_4
                if(Port_B_Delta & 0x20) // did external interrupt 4 change state?
                {
                        IR_Sensor_ISR(Port_B & 0x20 ? 1 : 0);//Int_4_ISR(Port_B & 0x20 ? 1 : 0); // call the interrupt 4 handler (in interrupts.c or encoder.c)
                }
                #endif
                #ifdef ENABLE_INT_5
                if(Port_B_Delta & 0x40) // did external interrupt 5 change state?
                {
                        IR_Sensor_ISR(Port_B & 0x40 ? 1 : 0);//Int_5_ISR(Port_B & 0x40 ? 1 : 0); // call the interrupt 5 handler (in interrupts.c or encoder.c)
                }

Thanks in advance!

writchie 18-03-2008 12:42

Re: New Infrared Remote Control Software
 
Quote:

Originally Posted by Ian G (Post 720171)
I tried to make a quick fix to increase the coverage of our IR sensors by quickly adding a second interrupt and third interrupt. I knew the way I did it wasn't right, but it mostly worked enough. I was wondering what I would have to do to properly add more interrupts to the the IR code. I don't like wiring multiple sensors in parallel, because it looks like if the sensors receive signals at different times, their output pulses will interfere.

Here is what I did:

Code:

                #ifdef ENABLE_INT_3
                if(Port_B_Delta & 0x10) // did external interrupt 3 change state?
                {
                        IR_Sensor_ISR(Port_B & 0x10 ? 1 : 0); // call the interrupt 3 handler (in interrupts.c or encoder.c)
                }
                #endif
                #ifdef ENABLE_INT_4
                if(Port_B_Delta & 0x20) // did external interrupt 4 change state?
                {
                        IR_Sensor_ISR(Port_B & 0x20 ? 1 : 0);//Int_4_ISR(Port_B & 0x20 ? 1 : 0); // call the interrupt 4 handler (in interrupts.c or encoder.c)
                }
                #endif
                #ifdef ENABLE_INT_5
                if(Port_B_Delta & 0x40) // did external interrupt 5 change state?
                {
                        IR_Sensor_ISR(Port_B & 0x40 ? 1 : 0);//Int_5_ISR(Port_B & 0x40 ? 1 : 0); // call the interrupt 5 handler (in interrupts.c or encoder.c)
                }

Thanks in advance!

From what I see above, you will still be subject to interference. All three
sensors will generate edges and if 2 or more are active at the same time
the pulse width measurement will be messed up.

One solution is to dedicate timer1 as a free running timer (which is what we
do). We use it to count 100ns clocks. It overflows every 6.5536 ms. The
interrupt for the timer increments a global "tick" which can be used for less
precise timing tasks and to tell whether overflow has occurred, i.e. more
than 6.5ms has passed.

For short interval time measurements (like the IR pulse widths) you can
store the values from the timer (and the tick) and compute the time
interval that has passed.

You need to be sure to use 16 bit read/write mode on the timer
(RD16 control bitof T1CON) and read TMR1L first followed by TMR1H.
The read of TMR1L latches the upper bits of the actual counter into
a temporary buffer so that overflow is not a concern.

You should also disable interrupts globally while reading the two timer bytes
to eliminate a race conditions. You might want to include your reading
of the current global "tick" value within the same critical section.

Hope this helps!

Joe Ross 01-04-2008 20:39

Re: New Infrared Remote Control Software
 
We are using this software with the IR sensor in the kit. Since we had already made a nice enclosure for the IR board, we just cut the traces to the IR sensor and soldered a PWM cable per Kevin's diagram.

Once we found a remote that had the right protocol, we had no problems.

MattLopez 18-04-2008 16:41

Re: New Infrared Remote Control Software
 
Our team is currently using the IR code, but have a problem with interference when two Sony remotes are on the field. Is there anyway to set it to only respond to a specific remote control?

billbo911 18-04-2008 18:14

Re: New Infrared Remote Control Software
 
Quote:

Originally Posted by MattLopez (Post 738800)
Our team is currently using the IR code, but have a problem with interference when two Sony remotes are on the field. Is there anyway to set it to only respond to a specific remote control?

One way that might get around this is to have your code only respond to a given pair of "Address" and Command". For instance, only the pair of Address = 26 && Command = 3 will cause it to take a specific action.

One thing that I noticed when playing with my Universal remote, most of the Sony devices ==> (Address), use the same Commands when the same button is pressed. So if you are just looking at Command, you may have issues.


Here is something that might also help. When you configure the remote to control a Sony Audio amplifier, it uses really odd "Command" values. ie: 63, 57, 67 for buttons like 1, 2 and 3. Also 3-9 use the same command. (This is the odd behavior I mentioned in a different thread, and we took advantage of this year. We never once had interference.)

Maicon Lima 22-05-2008 16:02

Re: New Infrared Remote Control Software
 
at?


All times are GMT -5. The time now is 08:02.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi