All About Circuits Forum 4N25 Optocoupler (Optoisolator)
 User Name Remember Me? Password
 Register Blogs FAQ Members List Today's Posts Search Today's Posts Mark Forums Read

 The Projects Forum Working on an electronics project and would like some suggestions, help or critiques? If you would like to comment or assist others with their projects, this is the place to do it.

#1
03-15-2010, 05:22 AM
 chumarkrch New Member Join Date: Nov 2009 Posts: 7
4N25 Optocoupler (Optoisolator)

This is my first time positing to the forums and I am simply trying to use the 4N25 optoisolator to electrically isolate a DC voltage so it can be sensed by a microprocessor on the output side. Here is the basic circuit I am using:

This is the same circuit I've seen on other websites describing how to use the 4N25. I have varied the R1 and R2 values from 100 Ohms up to 10 KOhms and varied the input V1 from 0 to 10 V but the output either remains at some constant value in the mV or it is equal to V2. However, it never is equal to V1 which is what it should do.

Somebody please let me know what I am doing wrong.
#2
03-15-2010, 05:43 AM
 SgtWookie Expert Member Join Date: Jul 2007 Location: In the vast midwest of the USA; CST Posts: 22,030

They're designed to be used as optically isolated logic switches, not as linear devices.

Your circuit is wrong. R2 needs to be in the wire that goes to +5v instead of between pin 5 and Vout. Wired the way it is, you would always read 5v on the output.

The pin numbers for 4 and 6 are in the wrong place; exchange them.

The emitter side (on the left) has a Vf of around 1.2v @10mA. Calculate your current limiting resistor R1 as:
Rlimit = (Vsupply - 1.2v)/10mA
So, if your V1 is either 5v or 0v, then:
Rlimit = (5v-1.2v)/10mA = 3.8/0.01 = 380 Ohms. Use the closest standard value, or use resistors in series or parallel to get 380 Ohms.

The 4N25 has a current transfer ratio of 20%
Don't expect the output to sink much current. Use a 2.5k to 3k resistor for R2.
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
#3
03-15-2010, 03:56 PM
 BMorse Senior Member Join Date: Sep 2009 Location: Vermontville, Michigan (GMT -5) Posts: 2,658 Blog Entries: 15

Quote:
 Originally Posted by chumarkrch This is my first time positing to the forums and I am simply trying to use the 4N25 optoisolator to electrically isolate a DC voltage so it can be sensed by a microprocessor on the output side. Here is the basic circuit I am using: This is the same circuit I've seen on other websites describing how to use the 4N25. I have varied the R1 and R2 values from 100 Ohms up to 10 KOhms and varied the input V1 from 0 to 10 V but the output either remains at some constant value in the mV or it is equal to V2. However, it never is equal to V1 which is what it should do. Somebody please let me know what I am doing wrong.

VOut should also be connected between the pin and the resistor, not where you have it on the circuit or else you will always be reading the value of V2....

B. Morse
__________________
There is no spoon -Neo-
Disclaimer: The example programs,circuits, projects and information I provide or post on this web site are for educational purposes only. By copying anything from this site posted by me, you agree to the "as is" nature of the programs, circuits, information and to the statements listed in this disclaimer.No warranty or liability is expressed or implied. Working with AC /DC voltages can be dangerous and even deadly. Proceed at your own risk!
#4
03-15-2010, 11:12 PM
 chumarkrch New Member Join Date: Nov 2009 Posts: 7

I tried your solution with the following circuit:

Maybe I'm not understanding something. By an optically isolated switch, does that mean it requires some signal to go high or low to start? How exactly does this start? Also, will it simply output the same DC voltage on V1 on the output?

Thank You.
#5
03-15-2010, 11:26 PM
 hgmjr Super Moderator Join Date: Jan 2005 Location: Tennessee, USA (GMT-6) Posts: 9,030 Blog Entries: 11

Here is a link to the wikipedia section the topic of opto-isolators. This material will help provide you with a bit more background on the subject. Hopefully it will answer you main questions. Anything that is not clear you can come back here and ask for clarification.

hgmjr
#6
03-16-2010, 12:41 AM
 BMorse Senior Member Join Date: Sep 2009 Location: Vermontville, Michigan (GMT -5) Posts: 2,658 Blog Entries: 15

Quote:
 Originally Posted by chumarkrch I tried your solution with the following circuit: Maybe I'm not understanding something. By an optically isolated switch, does that mean it requires some signal to go high or low to start? How exactly does this start? Also, will it simply output the same DC voltage on V1 on the output? Thank You.

With the circuit above, you should read V2 on Vout.

If you disconnect V1, then you should read almost 0 volts on Vout.

You "activate" the opto coupler by turning the LED side on or off to control the state of the output phototransistor...

B. Morse
__________________
There is no spoon -Neo-
Disclaimer: The example programs,circuits, projects and information I provide or post on this web site are for educational purposes only. By copying anything from this site posted by me, you agree to the "as is" nature of the programs, circuits, information and to the statements listed in this disclaimer.No warranty or liability is expressed or implied. Working with AC /DC voltages can be dangerous and even deadly. Proceed at your own risk!
#7
03-16-2010, 01:34 AM
 SgtWookie Expert Member Join Date: Jul 2007 Location: In the vast midwest of the USA; CST Posts: 22,030

You misunderstood me when I said the pin numbers were swapped.

You also misunderstood me when I said the resistor needed to be moved to the wire going to Vcc.

You have likely destroyed the optocoupler, but here is how you should have connected it. Note the corrections in red.

Attached Images
 2010034n25v2.jpg (10.8 KB, 500 views)
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
#8
03-17-2010, 06:25 AM
 chumarkrch New Member Join Date: Nov 2009 Posts: 7

Thanks for all your help.

I still can't seem to get it working so I think the optocoupler may not be the right solution for what I'm trying to do.

I'm trying to isolate the DC voltage of a battery so I can send it to the analog input of a microprocessor. Can anyone offer up a type of circuit or solution that would do this.
#9
03-17-2010, 06:54 AM
 retched Senior Member Join Date: Dec 2009 Location: Baltimore, MD Posts: 5,198 Blog Entries: 14

Why do you want to isolate it? And you were right that the optocoupler was wrong for the job.

If you want to isolate something from its power source, you should use an isolation transformer. Isolation transformers have the same number of windings on the primary and secondary windings so they do not raise or lower the voltage, just physically isolate it.

You may want to put it out there and just tell us what your trying to do. That will help save time with the wild goose chases.
__________________
-rm-
#10
03-17-2010, 04:01 PM
 chumarkrch New Member Join Date: Nov 2009 Posts: 7

It's a battery management system that will be a part of a Formula Hybrid vehicle. The rules say that the high voltage circuit must be isolated from the low voltage circuit. However, we have to sense the battery voltages for the battery management system to work. It is also to protect the microprocessor.

 Tags 4n25, optocoupler, optoisolator

 Related Site Pages Section Title Textbook Mutual inductance and basic operation : Transformers Textbook Voltage regulation : Transformers Textbook Resonance in series-parallel circuits : Resonance Textbook Simple parallel (tank circuit) resonance : Resonance Textbook Series resistor-capacitor circuits : Reactance And Impedance -- Capacitive Textbook The common-emitter amplifier : Bipolar Junction Transistors Textbook Active mode operation : Bipolar Junction Transistors Textbook Simple parallel circuits : Series And Parallel Circuits Textbook Simple series circuits : Series And Parallel Circuits Textbook Scientific notation in SPICE : Scientific Notation And Metric Prefixes

 Similar Threads Thread Thread Starter Forum Replies Last Post yehezkel2 General Electronics Chat 1 01-06-2010 09:55 PM rapseez The Projects Forum 17 08-13-2009 02:25 AM mikemania General Electronics Chat 3 07-20-2009 02:59 PM SIcam The Projects Forum 2 09-03-2008 10:37 PM Marie The Projects Forum 10 02-12-2008 03:43 PM

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Electronics Forums     General Electronics Chat     The Projects Forum     Homework Help     Electronics Resources Software, Microcomputing, and Communications Forums     Programmer's Corner     Embedded Systems and Microcontrollers     Computing and Networks     Radio and Communications Circuits and Projects     The Completed Projects Collection Abstract Forums     Math     Physics     General Science All About Circuits Commmunity Forums     Off-Topic     The Flea Market     Feedback and Suggestions

All times are GMT. The time now is 12:20 PM.