PDA

View Full Version : Re: Serial port isolation



Steve_88
- 9th September 2007, 22:04
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

Jerson
- 10th September 2007, 05:42
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.

dhouston
- 10th September 2007, 14:53
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.

Steve_88
- 10th September 2007, 21:54
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

Squibcakes
- 11th September 2007, 02:02
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

Steve_88
- 11th September 2007, 04:31
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

dhouston
- 11th September 2007, 13:21
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.

Steve_88
- 12th September 2007, 01:09
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

Squibcakes
- 12th September 2007, 02:32
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

dhouston
- 12th September 2007, 05:29
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

Steve_88
- 9th October 2007, 15:18
Thanks everyone for the suggestions. I have implemented the optocoupler for isolation as described in the microchip appnote. It works very well.

-Steve