Using Transistor Optocoupler for level shifting

Thread Starter

JayDeeTES

Joined Aug 13, 2021
5
Hi Im using a NPN Transistor output Optocoupler (Toshiba TLP290) as a level shifter.
I have a source squarewave and a constant current chip (20mA) in series to drive the Optocouplers internal LED.
The idea is that the constant current chip will allow the optocoupler to be safely and consistantly driven given a varying input.
Source signal is a DC square wave and peak to peak could vary from 3.3 to 15V.

On the output, I have a 3.3V pull up resistor on the collector and tap of a signal at this point.
When active I was expecting the transistor output to hard pull to ground, pulling both the reistor and signal line to ground.

But I'm not getting a clean squareware output, I've played with different values but I'm either getting rounded edges or the output wave form will not pull cleanly to the upper or lower rail.

I have not used a dedicated level shifter chip as the input square wave signal could be anything from 3.3V to 15V PP and most seem to be for 3.3 to 5V.
any thoughts... :)
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,766
hi jay,
Welcome to AAC.
You will get rounded outputs, the circuit is only an active Pull down and 3k3 resistive pull up.

Look at the CD4050 when down level shifting, I have used them for 12V down to 5V level shifters

E

Added the CD4049 for inversion.

ESP_ 668 Aug. 13 11.02.png
 

Attachments

Last edited:

Thread Starter

JayDeeTES

Joined Aug 13, 2021
5
Yep that would have helped! Source signal 10Khz, square wave, rise and fall times ~80nS.
Optoisolator output (using a 1K pull up to 5V)
rise time 12uS! to a high level of 4.87V
fall time 240nS to a low level of 0.125V
If I decrease the pull up to an agresive 120R, I improve the rise time significantly but the low level is at 2.25V and
down stream logic does not get a clean level change.

As Eric stated an Actively driven output would clearly help, but I'm on a SO4 footpint... but I think this board is getting re-spun once the dev work is done. :)
 

Ian0

Joined Aug 7, 2020
9,667
You’ve found out just how slow optoisolators can be!
Sometimes less current through the LED can hurry them up a bit.
Try running it closer to its optimum CTR of about 2mA
 

Thread Starter

JayDeeTES

Joined Aug 13, 2021
5
The Signal feeding the input of the opto looks good, as best I can measure the input is switches to a solid ground so should be triggering the internal LED correctly.
Lowering the LED current really helped improve the switch on time. Thanks.
I have used a couple of trimmer on the input resistor and pull up resistor, by playing with these I have values that allow the circuit to work.
I think I need to look for an alternative to the current optoisolator. The CD4049 is worth a look but will also look for a a single channel smaller package option. J.
 

Papabravo

Joined Feb 24, 2006
21,159
Hi Im using a NPN Transistor output Optocoupler (Toshiba TLP290) as a level shifter.
I have a source squarewave and a constant current chip (20mA) in series to drive the Optocouplers internal LED.
The idea is that the constant current chip will allow the optocoupler to be safely and consistantly driven given a varying input.
Source signal is a DC square wave and peak to peak could vary from 3.3 to 15V.

On the output, I have a 3.3V pull up resistor on the collector and tap of a signal at this point.
When active I was expecting the transistor output to hard pull to ground, pulling both the reistor and signal line to ground.

But I'm not getting a clean squareware output, I've played with different values but I'm either getting rounded edges or the output wave form will not pull cleanly to the upper or lower rail.

I have not used a dedicated level shifter chip as the input square wave signal could be anything from 3.3V to 15V PP and most seem to be for 3.3 to 5V.
any thoughts... :)
There are several lines of logic devices that have a Vcc of 3.3 Volts with inputs that are tolerant of higher input voltages.
74LVC1Gxxx is one such line where xxx identifies the specific function.
The venerable LM393(dual) and LM339(quad) comparators may also fill your needs. To some extent they have the same problem as the optos with an active pulldown and a passive pullup. It is not as bad however.
 

BobTPH

Joined Jun 5, 2013
8,809
Do you need isolation? If not, why use an optocoupler?

Edited to add: Also, the slow response might be due to your current source rather than the opto.

Bob
 

Thread Starter

JayDeeTES

Joined Aug 13, 2021
5
The Opto isolation is probably overkill and the switching speed and wide input range are bigger issues.

74LVC1G14 I looked up was 5v max on input...I might have miss read.
The CD4049 looks a good fit, I'll get some on order. Thanks guys.
 

Ian0

Joined Aug 7, 2020
9,667
The Opto isolation is probably overkill and the switching speed and wide input range are bigger issues.

74LVC1G14 I looked up was 5v max on input...I might have miss read.
The CD4049 looks a good fit, I'll get some on order. Thanks guys.
You did say "On the output, I have a 3.3V pull up resistor on the collector".

I think there is also 74HC1G14 which will stand 5V, but not a 74HC1G17.
Also you could use a 555.

@BobTPH makes a good point about the speed of the current source.

If the isolation is less important than the speed, get rid of the isolator! Go straight in from your 3V-15V signal with a resistor and a zener to clamp it.
 
Top