I am looking into a implementing a low-cost RS-232/422 opto-coupled receive circuit. The aim is surge protection and tolerance to DC offsets.

The challenge is that the inputs should be completely floating and work over a wide temperature range, say -40°C to 85°C. Speed up to 4800 baud. Logic null input 1.6V - 25V.

I considered simply chaining a 5kOhm with the diode input but the resulting forward current is too small to produce a useful current transfer ration with inexpensive opto-couplers. (Especially at high temperatures.)

How does this solution look to everybody? Am I overlooking something?


simulate this circuit – Schematic created using CircuitLab

My understanding is that this should cut in abruptly at (Vin1-Vin2)=Vf of the optocoupler with a rise and fall time of about 10µs and be fairly tolerant to CTS degradation and voltage surges on the Vin side. - Is this right?

Is it likely to be a problem, that the input impedance is 10kOhm at high input voltages rather than the standard 5kOhm?

Edit 1


simulate this circuit

  • \$\begingroup\$ Can you clarify exactly how bomb-proof this needs to be? There are some pretty robust RS485/422/232 transceiver IC's out there as RS485 and 422 get used extensively in industry where transients and stray voltages (and lightning strikes) are quite common. \$\endgroup\$ – John U Aug 11 '14 at 8:22
  • \$\begingroup\$ @JohnU To be honest I don't quite know what protection limit is required. I need to think hard on this for a while. I thought I could avoid doing so by just going for optical isolation but even at 4800 baud this seems non-trivial... \$\endgroup\$ – ARF Aug 11 '14 at 13:55
  • \$\begingroup\$ Unless you have some very funky/extreme use case I'd put money on being able to find standard driver IC's which will stand up OK. Opto-isolating comms like this can be done (my boss designed a board that did exactly that for 485 + analogue video) but it's not trivial and you've got to really need to do it. TBH if you need this doing, there are probably bigger issues at hand that you need to understand. Or if you get stuck you could probably licence the design my boss did ;) \$\endgroup\$ – John U Aug 11 '14 at 15:36

A 4800 baud rate is probably not achievable with this circuit- the Tf is typically 100usec and Toff is approaching 200usec.


Maybe if you terminate it into a resistor of a few hundred ohms and use a comparator..

  • \$\begingroup\$ I thought that with the R_L=R3=500ohm, the switching speed would be of the order of 1µs which is about 1/10 of the 4800 baud period length. \$\endgroup\$ – ARF Aug 10 '14 at 17:58
  • \$\begingroup\$ Regarding the suggestion of a comparator: will this satisfy my requirement of a floating input? What happens is the DC offset of the inputs exceeds Vcc of the comparator? \$\endgroup\$ – ARF Aug 10 '14 at 18:08
  • \$\begingroup\$ In my first comment I meant to type "switching speed of the oder of 10µs". Sorry for the accumulation of comments. \$\endgroup\$ – ARF Aug 10 '14 at 18:20
  • \$\begingroup\$ I think you'll find the switching speed will be similar to that with a 10K load. \$\endgroup\$ – Spehro Pefhany Aug 10 '14 at 18:55

Regardless of speed considerations, the circuit will not work for RS422. RS422 input levels can be as small as +/- 200 mV, and this will not even tickle your optocoupler.

For RS232, the minimum allowable input voltage range is +/- 3V. At 3 volts in, assuming an optocoupler Vf of 1.2 volts the diode current will be 120 uA. This is far outside any reasonable extrapolations of the data sheet, but such low current levels will almost certainly cause very slow operation. This represents worst-case operation, at -55 C. At higher temperatures the Vf decreases and the input current goes up, but a typical 25C curve gives a Vf of 1 volt, with a current of 200 uA, which isn't a game-changing improvement.

At these low currents CTR is very low, in the range of 10% worst case, although like I say this is an off-the-charts extrapolation.

If you want to try to make this thing work, the first thing to do is get rid of R2 and replace D1 with a simple signal diode such as a 1N4148. The forward drop of the photodiode clamps the input voltage to a much lower voltage than the zener level. Even a 25 volt input will only draw 5 mA, which is less than 1/10 of what the optocoupler can happily handle, and about .5% of the 1 usec pulse limit. Doing this will get your worst-case input current up to about 360 uA, and it still won't get near the speed you want. Note that the timing curve in Spehro's answer is operating at 10 mA, so anything you do with the levels your circuit will operate will be a good deal slower.

I suggest you look into a cascode configuration. Given the lack of transistor specifications in the data sheet I cannot even try to suggest circuit values or estimated response times.

  • \$\begingroup\$ Thanks for the explanation. I looked into the cascode configuration, however, I don't quite see how this will help. Assuming an input signal with an unknown, possibly "large" DC offset, e.g. between 12V and 15V (or also -12V to -15V) and a target output signal between 0V and 5V, I don't see how to implement a cascode configuration that will work without knowing the DC offset at design time. \$\endgroup\$ – ARF Aug 10 '14 at 22:29
  • \$\begingroup\$ RS232 doesn't care about offset - it only cares about zero crossing. I suspect that the offset you're talking about is common-mode voltage, and that is dealt with (that is, ignored) by the input isolation of the optocoupler. If the offset really is on the signal with respect to the optocoupler v2, you have a pathological situation and something is really wrong. In that pathological case, you'd want to put a capacitor on the input and filter out the DC. \$\endgroup\$ – WhatRoughBeast Aug 10 '14 at 23:02
  • \$\begingroup\$ Ok, I was truely confused. I did not realise the opto-coupler was still in the picture. Did you think of something like the schematic in my edited question? I still don't see how this could help im principle (ignoring numbers for the moment...). \$\endgroup\$ – ARF Aug 10 '14 at 23:30
  • \$\begingroup\$ Looking at the edited schematic, it won't work. In that configuration the collector current is essentially equal to the emitter current, in this case less than 1 mA. So the change in output voltage will be less than .5 volts. \$\endgroup\$ – WhatRoughBeast Aug 10 '14 at 23:49

You are making this too complicated. Proper RS-232 logic levels are from below -5 V for space to above +5 V for mark. Since the idle level is space, you want to detect the mark state by turning on a opto-isolator.

Your maximum baud rate is 4800, so 208 µs per bit. This allows the use of relatively "slow" optocouplers, up to about 20 µs, which is acceptable at 1/10 the bit time. The advantage of slow optocouplers is that they are generally available with high current transfer ratios (CTR). The cheap and available FOD817D comes to mind, which has a minimum guaranteed CTR of 3, and a maximum delay of 18 µs.

Let's say you want the output of the opto to do at least 1 mA when on. That means you must give the input at least 350 µA. The maximum input voltage of a FOD817 is 1.4 V. That leaves 3.6 V across a resistor with 5 V on the RS-232 line. (3.6 V)/(350 µA) = 10.3 kΩ. A 10 kΩ 1% resistor should therefore work.

Now you have a switch that is off when the RS-232 line is idle (in "space") state, and that can support up to 1 mA when in "mark" state. Since such logic level serial signals are usually high when idle, all you need is a pullup resistor in series with this switch. Since you seem to be using 5 V logic, the resistor you need is (5 V)/(1 mA) = 5 kΩ. The standard value of 5.1 kΩ should do fine.

So here is the final circuit:

You can get away with something this simple due to the low baud rate requirement. This circuit won't work at much higher baud rates.


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.