Optocoupler to use for 0-15 V (12V) analog sensor signals on Teensy 3.3v input

Thread Starter

Thomas Prüfer

Joined Nov 22, 2017
28
Hello,

I am looking now a couple of days around for a solution to use optocouplers to step down the analog input sensor signals with approx. 0-12v (up to 15V) to use it with the analog input of a Teensy 3.5.

The Teensy has 3.3v analog inputs. I know I could use simply a voltage divider but I like the idea to secure the inputs with optocouplers.

My actual problem is to choose the right type and model of couplers.
Also from my understanding, the optocouplers specs are more pointed to the current and lineality then to the voltage. I have seen as well couplers with logic outputs but I am not sure what kind of output signal this is?! Is here logic meant like just high/low or do exist optocouplers with digital outputs like getting 0-1023 through I2C bus or something like that?

Until now I used simply voltage dividers but I had the situation where a too high voltage have blown up the analog inputs.

A bit more about what I want to build:
Translate analog signals from the older engine of my yacht / boat to a CAN bus like NMEA2000 network to be used on my multifunction display and to use some signals for my DIY autopilot. Hardware is like mentioned a Teensy 3.5 and Teensy 3.2.

Thank you for any ideas!
 

Thread Starter

Thomas Prüfer

Joined Nov 22, 2017
28
hi Thomas,
This is one type of analog opto coupler, the HCNR200.
E
Hi Ericgibbs,

thank your for the very fast answer!
That device looks interesting. I looked into the datasheet.
Like I can see do have this Optocoupler 2 outputs. If I understood this right then they are used parallel to get e better lineality, is that right?
What do you advice how to connect them? The schematics from the datasheet, some of them I know when to use but what about my case to get high lineality ?
 

ericgibbs

Joined Jan 29, 2010
18,767
hi,
On page 1-426 of the datasheet is this basic isolator.
The left side OPA drives the opto emitter LED and the right side OPA is the PD detector output [Vout]
These optos do have good In/Out linearity.

E
EDIT: note only the Yellow block diodes are in the HCNR, the OPA's have to be connected to drive the HCNR

AA1 12-Aug-18 14.45.gif
AA1 12-Aug-18 14.39.gif
 
Last edited:

crutschow

Joined Mar 14, 2008
34,285
You don't really need an optocoupler to protect the input.
Just step down the voltage with a resistive divider and protect the inputs with a series resistor and two Schottky diodes, connected as shown:
upload_2018-8-12_9-10-18.png
 

Thread Starter

Thomas Prüfer

Joined Nov 22, 2017
28
You don't really need an optocoupler to protect the input.
Just step down the voltage with a resistive divider and protect the inputs with a series resistor and two Schottky diodes, connected as shown:
View attachment 157973
Hello Crutshow,

thx for the answer. Like mentoined I used resistive voltage in the past. I have read about securing inputs by diodes, zener & schottki, have some negative effects which effects the linearity of the analog signal. Don´t ask me where and exactly how, I do not remember!
Also, doesn´t a to high voltage also destrøy the diodes until you have chosen pretty big ones?
Regards,
Thomas
 

Thread Starter

Thomas Prüfer

Joined Nov 22, 2017
28
hi,
On page 1-426 of the datasheet is this basic isolator.
The left side OPA drives the opto emitter LED and the right side OPA is the PD detector output [Vout]
These optos do have good In/Out linearity.

E
EDIT: note only the Yellow block diodes are in the HCNR, the OPA's have to be connected to drive the HCNR

View attachment 157967
View attachment 157968
regarding the OPA´s, which one would advise?
I am really not up to date or have enough experience in this subject to find the right devices..
 

ericgibbs

Joined Jan 29, 2010
18,767
hi Thomas,
There is no way you can protect a MCU input from every possible over voltage.
You should look at the environment that the MCU will be working and determine what the highest possible over voltage that could occur.
You then design the protection circuit for that environment.
I have used voltage dividers and diode clamps on many marine applications, with no problems.

If lightning strikes your project all bets are off. :rolleyes:
E
 

Thread Starter

Thomas Prüfer

Joined Nov 22, 2017
28
hi Thomas,
There is no way you can protect a MCU input from every possible over voltage.
You should look at the environment that the MCU will be working and determine what the highest possible over voltage that could occur.
You then design the protection circuit for that environment.
I have used voltage dividers and diode clamps on many marine applications, with no problems.

If lightning strikes your project all bets are off. :rolleyes:
E
Yes that is well true and I am of course aware about that. I would say to protect against 30V must be enough. 12V is used for the sensor while 24V is available through the battery banks. If a lightning strikes the boat I think I do not think any more about the MCU at all or may the hole boat! :)

I thought more about if somebody will connect wrong or some potential from somewhere else like for example static energy, even this is much more then 30V, or whatever. I have to produce several of it for some friends who want to try this in their installations as well. The Teensies are not such expensive in case of replacing it but just for reliability, I think it will be a bit more secure. & I wanted to try something different as well.
 

crutschow

Joined Mar 14, 2008
34,285
I have read about securing inputs by diodes, zener & schottki, have some negative effects which effects the linearity of the analog signal.
A zener possibly could have a small effect due to leakage current near it's breakdown voltage, but the diodes are reverse biased with negligible leakage, so will have no measurable effect on the linearity.
doesn´t a to high voltage also destrøy the diodes until you have chosen pretty big ones?
That's why you have a resistor in series with the input before the diodes.
It limits the current due to any high voltage spike.
 

ebp

Joined Feb 8, 2018
2,332
Analog isolation that does not compromise linearity and offset will cost several US dollars per signal. If you use an optocoupler, you require one made specifically for the purpose if anything better than several percent error is necessary. You then require a power supply on the input side of the coupler, which may mean an isolated DC-DC converter, and an op amp with good performance on each side. The HCNR200 and IL300 work very well if applied carefully. I used them in a few industrial designs.

Simply using isolation does not in itself solve any problems related to high-voltage transients on the input signal, since the isolation circuit input still requires protection. Opto-ioslation is extremely useful if there are differences in potentials of the commons ("grounds") of the input signal and the circuit to which it is connected.

Where high accuracy is required, it is indeed difficult to protect inputs from voltage transients. Clamping with diodes requires that the power rails to which the signal is clamped can "absorb" the clamping current without be driven to overvoltage itself. Common signal diodes such as 1N4148 types have too much reverse leakage current for high impedance circuits. Schottky diodes are generally very much worse in terms of leakage current, though there are a few small types that are reasonably good. You can get low-leakage PN junction diodes. Depending on the voltages involved the base-emitter or base-collector junction of many ordinary silicon small signal transistors such as the 2N3904 can be used as diodes with lower leakage than switching diodes and lower cost (and better availability) than low-leakage diodes. It is a little expensive, but the gate-channel diode of a JFET can make an extremely low leakage diode. For lower voltages (i.e. 5 volts or less) breakdown diodes are true tunneling "zener" diodes (as opposed to avalanche diodes) and really horrible for analog circuit protection due to the fact they begin breakdown at a voltage well below nominal. If you have a 12 V signal with spikes, you are much better off using a zener on the 12 volt signal then a voltage divider, rather than a voltage divider then a zener. A 12 V type will be an avalanche diode, so you get the benefit of that plus the voltage division of the remaining "excess."

Circuits operating an moderate impedance are usually easier to protect without introducing errors than either high or low impedance circuits (e.g. something at 10k ohms is easier than something at 1 megohm or 100 ohms).

You must look carefully at specification, but many analog and digital parts have built-in protection diodes that can be safely used for protection against overvoltage, provided the current is limited to sufficiently low level. In some cases a series resistor of adequate value will suffice, but now you get into problems with low impedance circuits and the resistance in introduce noise and offset error (offset can often be compensated).

Generally, the lower the power supply voltage for the circuit to be protected, the harder it is to protect the inputs without interfering with the signal. For example, if you have an analog to digital converter powered with 5 volts and use a reference of 4 volts, so have a reasonably large margin (greater than a silicon PN junction forward voltage at moderate current) between the full-scale signal and damaging overvoltage. If you have an ADC running at 3 V, you would have to use 2 V as full-scale for the same margin, and now you've lost almost a full bit of input signal range.

http://www.ti.com/lit/ml/slyt701/slyt701.pdf
has a section on protecting op amp inputs

I once designed with a Linear Tech ADC with a built in multiplexer. I discovered the hard way that if any input was more than (as I recall) about 50 millivolts greater than the positive supply rail, ALL of the channels were corrupted. It took a conversation with an engineer at LTC to discover that "little" detail since the datasheet failed to make it clear.
 
Top