# Opto Iso circuit, will this work??

Status
Not open for further replies.

#### MrUmunhum

##### New Member
Hi guys,
I'm working on a project that requires the use of an 4N25 Opto-Iso.
I need for the trigger to pull a pin on a 74138 low. Will this circuit work?

#### dknguyen

##### Well-Known Member
Use a resistor going from the pin 5 to +V (or whatever HI voltage is normally on the pin) and connect pin 4 to ground. When the output transistor is off, no current flows in the resistor. No current flow = no voltage drop so both ends of the resistor have the same voltage (+V). WHen the transistor turns on, the pin gets shorted to ground and current flows through the resistor to make a +V-GND voltage drop.

You should check the BJT is actually "shorting" the pin to ground by enough though since an opto transistor might not be activated enough in which case you would need to use the opto output transistor to instead power an amplification transistor (which is connected to ground on one end and connected to +V through a resistor on the other end same as before, just with an external transistor rather than with the opto transistor.

All that said... I have no idea why your circuit is the way it is. WHat's with the 5VDC? and the two pins on the IC? It appears very incomplete or incorrect. YOu also did not tell us which pin you were trying to pull low.

Last edited:

#### MrUmunhum

##### New Member
DK,

The circuit is not complete. My understanding of electronics is crude. I'm a software guy by training.

What I am trying to do is use a 74148 to transform 1 of 8 bits into a BCD representation of that state.
Code:
1 => 001
2 => 010
3 => 011
etc.
So there will be, in fact, 8 Opto-Isolators. Hope that clears things up?

#### crutschow

##### Well-Known Member
The 74148 is a decoder and does the opposite of what you want, it converts BCD to 1 of 8 outputs.

You want an encoder circuit such as the CD40147. On the CD40147:

Connect 9 inputs (1 through 9) individually to Gnd (Vss) using nine 10k ohm resistors.

Connect input "0" to +5V (Vdd) (this makes the output 0000 when all inputs are "0").

Connect the emitter (pin 4)of each opto isolator to it's respective input 1 through 8.

Connect the collectors (pin 5) of all the opto isolators to +5V (Vdd).

Make sure there is a resistor in series with each opto input (pin 1) to limit the input current to the desired value.

Turning on any of the opt isolators will pull its respective output to +5V (logic 1). The outputs (A,B,C,D) will be the BCD value of the selected input, as you desired.

#### MrUmunhum

##### New Member
I'm confused!

crutschow wrote:

The 74148 is a decoder and does the opposite of what you want, it converts BCD to 1 of 8 outputs.

You want an encoder circuit such as the CD40147.
According to the datasheet from Philips, the 74F148 is an encoder?
Code:
   8-input priority encoder     74F148
FUNCTION TABLE
Inputs                    Outputs
EI   I0 I1 I2 I3 I4 I5 I6 I7   GS A0 A1 A2 EO
H    X  X  X  X  X  X  X  X    H  H  H  H  H
L    H  H  H  H  H  H  H  H    H  H  H  H  L
L    X  X  X  X  X  X  X  L    L  L  L  L  H
L    X  X  X  X  X  X  L  H    L  H  L  L  H
L    X  X  X  X  X  L  H  H    L  L  H  L  H
L    X  X  X  X  L  H  H  H    L  H  H  L  H
L    X  X  X  L  H  H  H  H    L  L  L  H  H
L    X  X  L  H  H  H  H  H    L  H  L  H  H
L    X  L  H  H  H  H  H  H    L  L  H  H  H
L    L  H  H  H  H  H  H  H    L  H  H  H  H

H = High voltage level
L = Low voltage level
X = Don’t care
Other than that, thanks for the info.

#### ericgibbs

##### Well-Known Member
hi,

As you say the 74F148 is an 8 bit to 3 octal encoder.

#### MrUmunhum

##### New Member
Just checking

hi,

As you say the 74F148 is an 8 bit to 3 octal encoder.
Thanks, just want to make sure I an not losing my mind.

#### ericgibbs

##### Well-Known Member
Thanks, just want to make sure I an not losing my mind.
hi,
Connect the emitter of the 4N25 to 0V, connect a 4k7 resistor from the 4N25 collector to the +5V supply, the junction of the collector and resistor goto the input pin of the 148 ic.

The EI pin should be connected to 0V and the EO pin to +V via a 4K7.

OK.?

#### MrUmunhum

##### New Member
What is a 4K7 resistor

hi,
Connect the emitter of the 4N25 to 0V, connect a 4k7 resistor from the 4N25 collector to the +5V supply, the junction of the collector and resistor goto the input pin of the 148 ic.

The EI pin should be connected to 0V and the EO pin to +V via a 4K7.

OK.?
Typo? Did you mean a 47K resistor?

#### crutschow

##### Well-Known Member
Yes, it's 74F148 is an encoder. Must have somehow been looking at the wrong data sheet.

#### ericgibbs

##### Well-Known Member
Typo? Did you mean a 47K resistor?
Hi,
It just another common way of writing the decimal point, so 4K7 == 4.7K

Its a 4.7K resistor you need.

Status
Not open for further replies.