Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

12v current on and off using a 4n25 optocoupler

Status
Not open for further replies.

dataplex

New Member
hey guys

i am trying to switch a 12v current on and off using a 4n25 optocoupler.

12v are hooked up to the collector - but when i turn on the diode - the emitter will only give me around 5 volts. i tried switching power supplies, even gave it 24v, which resulted in a 7v output from the emitter...

i have an arduino digital pin connected to a 220ohm resistor to the anode, cathode goes to arduino ground.

i don't think the resistor between the arduino and the 4n25 is too big, the led should light up nicely... so where is all my current going?

any help would be greatly appreciated!!

thanks
 
Last edited by a moderator:
if my memory serves my rite, my optocouplers were only rated at 1.8v @ 50ma max, i had to run a transistor after them.
 
Why is the load on the emitter? Your base resistor should be fine. The load should be on the collector. This is the data sheet, see Figure 14, the switching schematic. Using 10 mA for the emitter section LED would require about a 370 Ohm resistor with 5 volts applied. You want it configured per the figure in the data sheet. You want the emitter to ground and the load on the collector.

Ron
 
Why is the load on the emitter? Your base resistor should be fine. The load should be on the collector. This is the data sheet, see Figure 14, the switching schematic. Using 10 mA for the emitter section LED would require about a 370 Ohm resistor with 5 volts applied. You want it configured per the figure in the data sheet. You want the emitter to ground and the load on the collector.

Ron
I think the transistor will saturate with the load in the collector or the emitter, providing the drive current is sufficient.
 
I think the transistor will saturate with the load in the collector or the emitter, providing the drive current is sufficient.

Hi Roff

I agree, I am just questioning how they have things setup. The drive is from an Arduino D/O. The voltage they are seeing sort of leads me to believe the 4N25 is not being saturated.

Ron
 
hi data,
The way you described the set up is like this image, if so, then the LOAD path to 0V when measured from the emitter to 0v is acting as an emitter resistor.

So depending upon value of this load resistor, as the 4N25 emitter diode is being driven at ~17mA and the CTR [current transfer ratio] of the 4N25 is only 20% , ie: the current in the detector transistor only ~ 6mA. [max]

Looking at the graph of Vce versus Ic @ diode drive current, for 18mA drive the transistor Ic is only ~6mA.

Reconfigure the circuit and add a current amplifier transistor after the 4N25 transistor

EDIT:
Look at the 2nd circuit for an option.
 
Last edited:
thank you guys for all the help...

unfortunately, im not an engineer - but a musician way over my head.

eric, i think that last schematic looks exactly how my circuit is... is an extra transistor necessary? is there no way the opto can handle passing 12v through??

arduino digital pin ---------> 220ohmresistor ------> opto anode
arduino ground ----------------------------------------> opto cathode

12v wall wart ------------------------------------------>opto collector
LM386 --------------------------------------------------> opto emitter

the LM's output is very low since the optocoupler only outputs around those 5volts instead of the desired 12v.

so i guess the optocoupler cannot handle the 12volts? i tried connecting 24 volts to it and they all survived, giving me steady 7volts from the emitter. i feel there must be another solution to this than buying a 40v wallwart to power up 12v opamps....

im very slow with this, sorry. any help would be greatly appreciated... im running low on time here!
 
hi data,
Its not the 'voltage out' thats the limitation, its 'amount' of current the 4N25 can carry/pass thru its transistor, its VERY little, the extra transistor increases the current available to the output

You noted the small change in output voltage between 12v and 24v,,, this the point, its the current... An LM386 cannot be powered in this way.

A simple way to do what you want, is to drive a 5V relay/transistor pair from the Arduino and use the relay contacts to switch the LM386 power [ thats what I would do]
 
Last edited:
...or you could use a FET instead of a relay:
 
thanks guys, i am almost there...

i have a couple of TIP120 lying around somewhere... could i use the 5v emitter output im getting from the optocouplers to open up a 12v current to the LM386? that would prove to be a very nice solution... something like this:

arduino digital pin ---------> 220ohmresistor ------> opto anode
arduino ground ----------------------------------------> opto cathode

12v wall wart ------------------------------------------>opto collector and TIP120 collector
opto emitter (5v) --------------------------------------------------> TIP120 base

TIP120 emitter -------------------------------------------------------------> LM386?


id rather keep my arduino safe with the optos this way.. ;)
 
hi,
You are mis-understanding the 4N25 transistor emitter output. The emitter is currently at ~5V which is a fault condition were it cannot supply the required emitter current

When the 4N25 transistor collector has +12V, the should emitter be approx 11.3V, this 11.3V will drive the second transistor TIP120 base, whose emitter will be close to 10.7V.
 
Last edited:
that should give the LM386 about 10V, you may some decoupling caps on the +10V if the LM386 shows signs of instability, try it as is first
 
that should give the LM386 about 10V, you may some decoupling caps on the +10V if the LM386 shows signs of instability, try it as is first
I don't think that the emitter of an optocoupler looks like an emitter follower whose base is driven from a resistor or current source whiich is tied to Vcc. I believe that the opto's transistor will saturate when the output current is less than (I(LED) times the minimum transfer ratio). The base voltage is not constrained to not rise above the collector voltage. Remember that base current is photocurrent, like from a photocell. If the transistor saturates when the load is from emitter to ground, the excess base photocurrent will flow through the collector-base junction, raising the base voltage to Vcc+0.6v (approximately). The emitter voltage should be within a few tenths of a volt (or less) of Vcc.
In other words, Vce(sat) is the same, regardless of the placement of the load.
 
Last edited:
hi Ron,
Are you talking of the OP's original circuit were he was trying to drive a LM386 directly from the emitter of the 4N25 or the modified circuit I posted.

If the former, I was explaining to the OP as the 4N25 had a emitter drive current of only ~20mA and the Transfer ration is only 20%, the 4N25 emitter would at best 'provide' ~5mA into the LM386.
That was the reason he measuring only ~5V at the 4N25 emitter with LM386 connected.

In the OP's 2nd circuit with the TIP120, this would act as current amplifier for the 5mA 4N25 emitter current, also I pointed out there would be voltage drop from the 12V to ~10.5V due to the Vbe drops.

As the 4N25 and TIP120 are configured as emitter followers the transistors would not saturate and be would as I posted, I have shown the 4N25/220R as 5V for the sim , which shows this result.

Perhaps I am misunderstanding your post.?:D

EDIT:
I 'think' you are referring to the Vce sat of the 4N25 transistor as the Base is 'floating', this is of course ~0.1V.
The LTS plot shows this.
I should have explained it more clearly to the OP, of course in his application its a minor problem.

E.
 
Last edited:
Afternoon Eric. More as a matter of curiosity would it not be more practical to just have the 4N25 drive a small reed relay like something along these lines in a DIP package? Since the object seems only turning an operational amplifier on and off? Relays like this typically draw around 25 mA when run on 12 volts. More a matter of curiosity on my part than much else.

Ron
 
Afternoon Eric. More as a matter of curiosity would it not be more practical to just have the 4N25 drive a small reed relay like something along these lines in a DIP package? Since the object seems only turning an operational amplifier on and off? Relays like this typically draw around 25 mA when run on 12 volts. More a matter of curiosity on my part than much else.

Ron

Morning Ron,
I have suggested to the OP that a 5V relay would be my choice, as you know, 5V low coil current relays are available to suit direct drive from a PIC pin, this would also give him the isolation that a opto would provide.

Eric
OT: had your 2nd coffee of the day,?:p
 
O/T

Thanks Eric and yes, generally 2 cups before leaving the house for my 30 min commute. What I really need is to be retired! :)

Ron
 
thank you guys so much, my circuit is finally working using an array of TIP120. if you guys are interested, i will post a video of my electromagnetic harp very soon!
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top