+-5V --> optocouple --> 0-v TTL

Thread Starter

Engineerer

Joined May 22, 2013
18
Hi,

I got a pair of wires from encoder, wire A and Wire A-. When encoder moves the voltage between wires changes state form +5V to -5V and so on.

I'm trying to optoisolate these signals and convert them to 0...5V TTL.

Optocoupler is HCPL2631, and signal at this point is given from signal generator.

No matter what I do the output of the optocoupler stays at 0,28V. Paraller to led of a optocoupler I have 1N4148 to limit the reverse voltage because the led in the opto can't handle it.

When +5V is supplied, A in higher potential than A-. I measured 10 mA current in the input, and 1,4x voltage over led in the opto. So led should be lit, and output from opto (between opto GND and pin 7) about 0V. This state seems ok.

BUT, when I change signal to -5V, A in lower potential than A-. The output from opto won't jump to 5V, as i want, but it stays close to 0V. Over the led inte opto is -0,7V voltage because 1N4148 opens and about 10 mA current flows trough the resistor (opposite direction than in +5V direction)


In picture higher wire is A and lower A-


What am I doing wrong? Electronics aren't my strongest point..
 

MrChips

Joined Oct 2, 2009
19,373
The HCPL2631 opto-couplers have open-collector outputs.

Install a pull-up resistor, (2kΩ to 10kΩ) between the output (pin-7) and +5V (pin-8).
 

Thread Starter

Engineerer

Joined May 22, 2013
18
Oh my god. Thank you very much. I educated myself a little about open collector and it looks all clear now. MrChips you're a life saver! I guess it took you one second to figure out what the problem was:D I hope everything works tomorrow when I'll add resistor(s).
 
Top