PDA

View Full Version : InfraRed Data Com



rayzrocket
- 9th March 2010, 03:45
In an effort to perform ~10kbits/sec data com via IR;
I've tried to recreate a somewhat PIC Serial Input coherent square wave at 10khz.
And I get a Sawtooth(~1volt) wave, Channel 1, at the PIN photodiode using a 120k resistor....as it recieves 950nm IR from a LED driven by a Square (1.2 volt) wave, Channel 2, from the PIC16f688.

Ch1 is on a 1.00v scale Ch2 is on a 500mV scale.

Although, when I did inject the phtodiode's signal into a PIC16f688, it would rarely get the correct data.

See the pict's

I can get a very low level (25mv) square shaped signal from the photodiode using a 15k resistor instead of a 120k. Problem is the NOISE!! There is about 10mv of noise, so my SNR is horrible at this point. The PIN is only two inches away from the LED, when the PIN is moved away, the signal gets weaker, but the noise floor remains.


Is there a design that can fix this issue?:o
(The LED is rated for 800ns rise and fall time,,the PIN is rated for 5ns)
I am trying several transimpedance amp designs now using a single supply op-amp by Microchip.


LED driver code:
'************************************************* ******************************
OSCCON = $70 'Use intosc of 8Mhz
Define OSC 8 'Use 8mhz timing for PBP timing such as pause & serout
'************************************************* ******************************
'
'ADC settings:
ANSEL = %00000011 'Turn-Off Analog inputs except for ANS1(-Vref & ANS0(ADC)are analog
TRISA = %00000011 'Port A is all outputs exept A.0 A.1 are inputs
TRISC = %00000000 'Port C is all outputs
CMCON0 = 7 'Turn-Off comparators
'
'
'************************************************* ******************************
Start:
pauseus 50
high PORTC.4
pauseus 50
low PORTC.4
goto start
'************************************************* ******************************

mtripoli
- 9th March 2010, 16:09
You need to do some research... there is a ton of information out there for this stuff. I'll give you a heads-up; you need to condition the photodiode - the TA is a good place to start...

inse
- 12th March 2010, 20:45
Rayzrocket,

can you supply more information about your project?
What distance do you want to bridge with you transmission.

If you want to transmit the data similar as you use a remote control, you will not get it working with your approach.
As the received signal will vary in a huge range you will have to use a AGC circuit, furthermore you will have to block ambient light.
Also it will become necessary to modulate the signal to a carrier frequency.
Maybe you adapt to a standard like RC5 fir IR remote controls or IRDA for communications and you will find specific receiver circuits and maybe even code you can use...

languer
- 13th March 2010, 00:25
You really need to understand what you are trying to achieve and the components required.

This link (http://www.rentron.com/Infrared_Communication.htm) provides good basic information on IR communications. If you do not have to use the PHOTO diode, a better choice is an IR receiver (e.g. PNA4602M, TSOP1240, etc). These have the PHOTO diode and required conditioning circuit built-in.

If you must use the PHOTO diode, first of good luck. Second look at an IR receiver to get an idea of what is it you need to add to the PIN diode itself.

An example diagram is attached.

rayzrocket
- 29th March 2010, 02:38
Thanks,
I only need a range of three feet. But its going underneath a car, where it will get much ambient solar background; as well as any IR coming off hot objects.
The IRda recievers commercially available are made for OOK on some operating frequency such as 38khz.

I am currently building a AGC with a variable value comparator using the PIC's built in comparator with Vcref value control.

Thanks for your inputs.

Once I get things working, I'll post my design.

-ray

Melanie
- 29th March 2010, 15:42
I can get a very low level (25mv) square shaped signal from the photodiode using a 15k resistor instead of a 120k. Problem is the NOISE!! There is about 10mv of noise, so my SNR is horrible at this point.

On another thread I described how you can get your Comparator to amplify your signal and filter noise. Looks like you're already thinking down that route. Simply squirt your Data & Noise into a Comparator and software set VRef a millivolt or two above the noise. Suddenly you're left with clean 0-5v swinging data and no noise. You can be even more clever, by sampling the average noise level using an ADC, you can then calculate WHERE to set VRef on the Comparator. That way you can automatically track the noise, ensuring the Comparator always extracts good data regardless of conditions. Your Data only needs to be a couple of mV above the noise to extract it.