Adding Protective Resistance to UART lines going "external" to device?

Go To Last Post
21 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Right, firstly, i am fully aware this question is very much in the "how long is a piece of string" type vein, but bare with me!!

 

I have a controller, and i'm going to break the UART lines (TX & RX) out to the main connector, to allow easy expansion, logging, and maybe even programming of the device in situ.

 

In order to protect those lines, i am going to add some series resistance, and clamp them to the rails with suitable diodes.  Here, the more resistance i can add, the "safer" those lines will be.

 

So, how much series R can i add?

 

It's going to depend upon my chosen baud rate, how much capacitance is present on the external and internal lines and also on the interface device (almost certainly an FTDI usb-uart bridge of some flavour or other)

 

Now it's easy enough to stick some numbers into a sim, and take a look at the signal distortion due to additional resistance, but i really need some ball park numbers to start with.

 

So, what have other people found to work to satisfy this type of requirement?

 

(i need to protect against continuous accidental connection to ground (0v), and power supply (~30vdc, perhaps as high as 40vdc), and against short ESD type pulses)

 

I'm actually wondering if i shold perhaps hide these lines behind some sort of galvanic isolation to be completely safe? (although that galvanic isolator obviously also needs to be protected, but a simple optocoupler with led/transistor should be fairly robust??)

 

Comments, Opinions and Experiences welcomed  smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does the option exist to pass your signal through a buffer chip? Even if you keep the levels at +5v/0v?

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

but bare with me!!

Since when is this a nudist forum??surprise

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Better than "bear" with me.....  ;-)

 

 

Yes, i can buffer the signal path before the IO connector.  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

max_torque_2008 wrote:
In order to protect those lines, i am going to add some series resistance, and clamp them to the rails with suitable diodes.
Do limit the current enough for most linear regulators are not two quadrant (pass only, no shunt, most are limited if any reverse capability) and the shunt inside the MCU might be somewhat to very limited in current.

Some SMPS do have an active n-channel device that will shunt (within reason)

Can add a shunt regulator such that the regulator SOA and MCU SOA are both met.

max_torque_2008 wrote:
So, how much series R can i add?
Maybe several K

Most AVR have a Schmitt-trigger input to restore slew.

Can go digital-to-analog-to-digital via analog comparators; much better CMRR than a logic buffer and likely fast enough for some UART baud.

max_torque_2008 wrote:
So, what have other people found to work to satisfy this type of requirement?
Bob likes Rugged Circuits products.

https://www.rugged-circuits.com/ruggeduino-1-1

max_torque_2008 wrote:
(i need to protect against continuous accidental connection to ground (0v), and power supply (~30vdc, perhaps as high as 40vdc), and against short ESD type pulses)
More than enough in

https://www.avrfreaks.net/forum/%C2%B1500-volt-protection-circuit

max_torque_2008 wrote:
... but a simple optocoupler with led/transistor should be fairly robust??)
There are failure modes for optocouplers.

In lieu of, consider a fiber optic cable.

At each end, limit the loop area and the current in that loop and protect the power; then should be good to go.

TOSLINK is inexpensive other than to DC (that's a order of magnitude greater in price)

With a bit of care, plastic fiber cable can be cut to length; otherwise, may simply use off-the-shelf that's locally sourced and stow the excess.

I don't know the maximum length of TOSLINK over plastic fiber cable.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

max_torque_2008 wrote:
Yes, i can buffer the signal path before the IO connector.
If can spare about 10mA at both ends then LVDS may work.

Easy to source Ethernet Base-T cable, common mode range is in a MCU's range, up to 100m long, can use telco type lightning protection.

Can power cycle the drivers and receivers if power capacity is limited.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have a look on Digikey for an article called "Protecting Inputs in Digital Electronics". It's a good read.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, i've been playing with some hardware, and have settled on a solution.  I don't need galvanic isolation, so have settled on simple series resistance and some clipping zeners to be the protection.  Using the UART set at 1MBaud, into a FTDI USB->UART bridge IC anything more than about 10k series resistance added between the AVR and the FTDI started to distort the waveform to the point where bus errors appeared  (obvious this is exact setup (parasitic capacitance) dependent).  So i then added some edge defining capacitors in parallel with the series resistance to act as a high pass elements.  With 100nf capacitors in series the bus performance was maintained right up to the highest value i tried (around 22k).

 

So i think i'm going with:  FTDI (external)  -> 12K / 100nf parallel pair -> 5v zener -> 1k series resistor ->AVR USART pin

 

 

Can anyone see any issues with this approach? It seems to work well on the bench, but that obviously doesn't mean it'll work out in the real world!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

max_torque_2008 wrote:

...against short ESD type pulses)

 

Zeners are quite slow and may not clamp your short duration pulses.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

max_torque_2008 wrote:
... 100nf parallel pair ... Can anyone see any issues with this approach?
Coupling due to dv/dt of ESD and lightning though the zener will eventually (dt) clamp it and the 1K will ease current division (zener, AVR ESD diode)

A TVS is faster than a zener and has less junction capacitance.

A zener in a large package can dissipate some heat; so, reduce the 12K.

There are 50ohm 30V PPTC resettable fuses than can be used to protect the TVS or zener but a simple resistor would be easier to obtain.

There are telecommunication PPTC resettable fuses than can withstand 240Vac.

max_torque_2008 wrote:
It seems to work well on the bench, ...
DC and AC?

30V DC?

AC - there are relatively inexpensive ESD generators.

 


220R for TVS rail clamp then 100R for current division

A TVS in-lieu of the rail clamp will be better for a line strike (iow a continuous fault, a mis-wire, etc)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what have other people found to work to satisfy this type of requirement?

 There is a lot of prior art in the form of "rs232 drivers."  Your "low-end" rs232 drivers have substantial overvoltage protection (compared to 5V), many advertise ESD protection, and there is a lot of info on what else you have to add in order to confidently run a couple hundred feet of wire through ceilings and alongside powerlines to "terminals" that students and similar can poke at...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm really trying to keep costs and real estate down, because this serial data is not actually used or even connected on the end application.  It's there to allow EOL programming and testing, and to allow system optimisation (calibration) during prototype test and validation.  Hence i can't really afford to put an RS232 line driver or similar on there and not actually use it!

 

 

As this output is routed to the device I/O connector, but not out into any kind of loom, and the entire device is housed in a metal framed vehicle, i thing lightning strikes can be reasonably ruled out (if there is one, and it causes a failure, then fair enough, that would be considered outside of the normal operational parameters for this device.

 

My main concerns are ESD from handling during production and installation, and accidental and possibly effectively continuous connection to Vbatt (24Vnom, but up to 32Vpeak is allowed for)  The 12k resistors act to prevent any long term current flow into clamp diodes, and the 1k aims to limit current into the AVRs own diodes. I'm sure i could probably bump up that 1k a bit, probably up to around 3k3 or something similar which might help limit short spikes.  Obviously i can't damp short spikes with capacitance without loosing the pulse edge definition on the UART!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

max_torque_2008 wrote:
As this output is routed to the device I/O connector, but not out into any kind of loom, and the entire device is housed in a metal framed vehicle, i thing lightning strikes can be reasonably ruled out (if there is one, and it causes a failure, then fair enough, ...
For a near direct strike, lightning current flows through the soil underneath the vehicle inducing current into a current loop.

Limit induction by limiting the current loop's area.

Moot point in this case because the UART is not connected other than during maintenance.

max_torque_2008 wrote:
... that would be considered outside of the normal operational parameters for this device.
That can be the case though vehicle operators can or will operate a vehicle outside of the vehicle's safe operating area (design for worst conditions when cannot test for worst conditions)

max_torque_2008 wrote:
... and accidental and possibly effectively continuous connection to Vbatt (24Vnom, but up to 32Vpeak is allowed for)
That looks good to go.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Has anyone got a favourite (cheap!) TVS diode they use on data lines?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I like these, mainly because they have AVR in the model number

 

avrm2012c390kt  by tdk!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

max_torque_2008 wrote:
Has anyone got a favourite (cheap!) TVS diode they use on data lines?
Not an answer because it's RS485 instead of LVCMOS (intention is to prime the discussion)

CDSOT23-SM712 at about 1USD each for 100 for 2 signals.

http://www.bourns.com/docs/Product-Datasheets/CDSOT23-SM712.pdf

 


Bourns

RS-485

Serial Port - ESD / EFT / Surge Protection

http://www.bourns.com/docs/Products-General/Bourns_RS-485_Serial_PortNote.pdf

via

Bourns

TBU High-Speed Protectors (HSPs)

http://www.bourns.com/products/circuit-protection/tbu-high-speed-protectors-hsps

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What happens to this microcontroller when 'input' is connected to 24v?

 

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The MCU's Vcc shunt will over-current, the MCU will overheat, the MCU's epoxy encapsulation will out-gas, likely causing a pop and a de-encapsulated MCU.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

... and another "bad day" is marked on the calendar.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Which is why i'm using capacitively paralleled high value series resistance to block DC but allow AC though.  The issue then becomes stopping very fast AC high voltage transients, like human body ESD, from getting through!