I have a circuit with a dsPIC which communicates to a computer using a MAX232 (there ain't any optical isolation).

The circuit ground is not bounded to the earth. But the equipment case is earthed. The computer is connected to the equipment through a DB9 connector on the rear panel of he equipment.

It works fine most of the time. But some clients (not much) after receiving the equipment complain about the RS232 link, which doesn't work. When I get back the equipment I see that the MAX232 is not working, and I have to replace it (but it worked before, I have tested it).

Is there a "good practice" of putting some protection for the RX, TX after the MAX232, like a TVS or something? Or my mistake is to not bound the circuit GND to the earth to prevent voltage differences when the serial cable connects the equipment's GND to the computer GND?

edit: Device in question (from comments)
enter image description here

  • \$\begingroup\$ maybe use MAX232E instead of plain MAX232... \$\endgroup\$ – MarkU Apr 10 '15 at 20:01
  • \$\begingroup\$ Hang on, are your saying that the PC and PIC board have different grounds? \$\endgroup\$ – Dejvid_no1 Apr 10 '15 at 20:30
  • \$\begingroup\$ @Dejvid_no1: When the equipment is connected to the PC, the equipment ground is connected to the PC serial port GND, so they became just one ground. \$\endgroup\$ – Alexandre Bueno Apr 10 '15 at 20:35
  • \$\begingroup\$ @MarkU: I've checked the datasheet. Seems to be a good option. Thanks. \$\endgroup\$ – Alexandre Bueno Apr 10 '15 at 20:47
  • \$\begingroup\$ Could you post a link to your device? That could give us more context. By the way, I wouldn't connect the signal ground directly to Earth. \$\endgroup\$ – Nick Alexeev Apr 10 '15 at 20:52

Ideally on an interface you want signal ground to make before any signal lines and break after any signal lines. If it doesn't you can get surges on the signal lines as any potential difference between the grounds of the two circuits discharges through the signal lines rather than through the ground wiring.

Unfortunately rs232 is an old interface. The plugs and sockets do have a shell that can be grounded but there is no gaurantee that any given serial cable or port will actually have wired that up. The main pins are all the same length so there is no gaurantee which will mate first or break last.

Normally I wouldn't worry too much about it but the fact your device is a hipot tester probablly means a greatly increased risk.

You say you have "no opto isolation", does that mean that one side of your hipot output is tied to the signal ground of your interface? if so then I really think you need to build isolation into your device.

| improve this answer | |
  • \$\begingroup\$ I second the use of isolation in this case. \$\endgroup\$ – rdtsc Oct 13 '15 at 19:01

I don't know if I understood you correctly. I envision your circuit like this:


simulate this circuit – Schematic created using CircuitLab

I would couple earth with my device ground over a high ohmic resistor. But I do not know if this is mandantory. I believe your problems are more likely to result of some problem with electronic discharge or overvoltage on your signal wires.

The secure option for devices out in the fields and in higher production quantities would be having an optical isolation. If that is not possible/too expensive, try to protect the interface with some ESD and overvoltage protection devices. There is (as far as I know) no standard approach, because every environment is different. What works in a lab environment may fail out in the field.

Most of the time I see varistors for overvoltage, coupled with some ESD protection ICs. Serial resistors with values from 100 to 500 Ohms reduce burst. Additionally you will have to pay close attention to your PCB routing, as the deflected ESD energy has to go somewhere (ideally directly to GND and off your device, not trough your microcontroller). If the client uses signals with too high voltage, limit them with a zener and a resistor in serial. This also makes error searching easier, as a burnt zener is a foolproof sign for misuse by the customer.

Side note: depending on how your connector looks, some clients will destroy the interface by plugging in wrong cables, wrong polarizations...

| improve this answer | |
  • \$\begingroup\$ My circuit looks like this one you drawn. But the GND pin from the DB9 (which comes from the PC) is connected to my board's GND. But my board's GND is not bounded to the EARTH ground (the protection earth ground). Should I connect them? \$\endgroup\$ – Alexandre Bueno Oct 13 '15 at 14:31
  • \$\begingroup\$ @Alexandre Bueno: Ah, so the PC GND is directly bound to your device GND? OK, then I will delete the first paragraph of my answer. Normally I connect EARTH to my GND over a relatively high ohmic resistor. But I don't know if that is mandantory. \$\endgroup\$ – jwsc Oct 14 '15 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.