InfraRed Data Com


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24

    Default InfraRed Data Com

    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?
    (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
    '************************************************* ******************************
    Attached Images Attached Images   
    -ray
    "Imagination is more important than knowledge", Albert.E.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    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...

  3. #3
    Join Date
    Jul 2007
    Location
    Bavaria
    Posts
    28


    Did you find this post helpful? Yes | No

    Default

    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...

  4. #4
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    You really need to understand what you are trying to achieve and the components required.

    This link 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.
    Attached Images Attached Images  

  5. #5
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Thanks

    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
    -ray
    "Imagination is more important than knowledge", Albert.E.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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.
    Last edited by Melanie; - 29th March 2010 at 17:05.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 05:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 02:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 03:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 15:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 29th November 2004, 00:56

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts