Re: Serial port isolation


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Jul 2005
    Location
    Midwest
    Posts
    81

    Exclamation Re: Serial port isolation

    Hi,

    I will soon be interfacing a trimble GPS to a pic and I'm wondering if there is a nice neat way to isolate it from the pic?

    All I need from the GPS is the TX line to read the NMEA string. The TX line goes from -9 to + 9 volts dc during transmission.

    Can I drive an opto coupler or something similiar to isolate the GPS from the pic?

    I've looked online a bit and searched the forums, but no hints so far.

    Thanks,
    Steve

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947

    Default

    Why do you want to isolate it? If there is no reason other than level translation, there is no need to. If the supplies to the GPS and the PIC are generated from the same power module, you do not need isolation. An incorrectly biased opto can cause more headaches than solve.

  3. #3
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by Steve_88 View Post
    I will soon be interfacing a trimble GPS to a pic and I'm wondering if there is a nice neat way to isolate it from the pic?
    I'm not sure you need isolation in this case but search for Microchip AN811. It shows how to isolate RS232 using optocouplers.

  4. #4
    Join Date
    Jul 2005
    Location
    Midwest
    Posts
    81

    Default

    Thanks Jerson and Dave for the comments.

    There will be times that the computer and GPS will be on different power supplies and at times the same. I've thought of just level shifting the signal and sending it to the pic, but thought since I'm at it might as well isolate the two units. The combined value of the GPS and PC is very pricey. I'll try the appnote Dave provided, looks simple enough even I maybe able to do it.

    Additional comments also welcome.....


    Thanks again,
    Steve

  5. #5
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257

    Default

    Quote Originally Posted by Steve_88 View Post
    Hi,

    Can I drive an opto coupler or something similiar to isolate the GPS from the pic?

    I've looked online a bit and searched the forums, but no hints so far.
    Steve,

    You are right, it's always a good practice to isolate the talker (gps) and listener (pic), esp. when you have multiple listeners connected in parallel to the talker.

    In some cases the signal can drop pretty low and eventually some of the listeners will stop.

    Also its eliminates any nasties when connecting devices that use RS232 and RS422 together.

    In your case, use a standard opto isolator (6n136) with a 560 ohm resistor in series with TX line, and put a fast switching diode (1N4118 etc) across the input.

    On the output side , use a 22K ohm resistor between Vcc and the out line, which connects to the pic.

    Cheers
    Squib

  6. #6
    Join Date
    Jul 2005
    Location
    Midwest
    Posts
    81

    Default

    Hi Squib,

    The microchip application note shows a 470 ohm resistor from the TX output to a 1N4148 diode then onto the opto.

    TX -------/\/\/\/-----------1N4148---------optodiode--------ground

    Is this the same general idea you suggested?

    I'll attach the appnote, AN811

    Thnks,
    Steve
    Attached Images Attached Images

  7. #7
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    IIRC, the circuit in the app note has a 470 ohm resistor in the PIC TX circuit to limit the current through the opto and a 10K resistor in the PIC RX circuit to limit the current to the PIC pin. The circuit gives you isolation, level translation and inverts the signals but it may not work for you since it draws its power from the RTS & DTR lines.
    Last edited by dhouston; - 11th September 2007 at 12:27.

  8. #8
    Join Date
    Jul 2005
    Location
    Midwest
    Posts
    81

    Default

    Hi Dave,

    I'm only needing to interface the TX line to my PIC. I don't believe that the TX portion of the circuit has any connections other than TX and ground?

    Thanks,
    Steve

  9. #9
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257

    Talking

    See the attached image. Its a cut and paste from one of my circuits....

    In a nutshell, RXC is your TX line from the GPS, RXD is the ground from your GPS. These connections can be either 232 or 422.
    The diode can be any fast switching type.

    TX2 goes to your PIC, serial pin, but best if you use a USART pin for flexibility.

    Good luck

    Cheers
    jared
    Attached Images Attached Images  

  10. #10
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by Steve_88 View Post
    I'm only needing to interface the TX line to my PIC. I don't believe that the TX portion of the circuit has any connections other than TX and ground?
    Yes, just use the section that connects to TX & GND and on the other side of the opto to RB1 and the PIC ground. Include all three resistors

  11. #11
    Join Date
    Jul 2005
    Location
    Midwest
    Posts
    81

    Smile

    Thanks everyone for the suggestions. I have implemented the optocoupler for isolation as described in the microchip appnote. It works very well.

    -Steve

Similar Threads

  1. serial port program in c
    By naveenupendran in forum Off Topic
    Replies: 0
    Last Post: - 28th February 2009, 11:47
  2. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 22:35
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. serial port control relay
    By win_832001 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd June 2006, 23:56
  5. Replies: 2
    Last Post: - 28th April 2006, 12:10

Members who have read this thread : 1

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