LM358 as a differential amplifer gain not coming out right

Status
Not open for further replies.

Thread Starter

amad1

Joined May 25, 2019
50
@amad1
First, correct your amplifier schematic using comments made above. Post your updated schematic. Even without correcting your circuit for the AC input signal, you should get a viewable output. If we confirm that your schematic is okay but you cannot see anything in the MultiSim oscilloscope, then you may need to seek help in a MultiSim forum. Once you get the circuit working and MultiSim displaying the output signal, then we can work on resolving the AC voltage input issue, and the "memory" issue.

Please note that working with large AC voltages is dangerous, especially so if the AC is from a power line. Be especially careful with grounding; often what "ought" to be ground is not. In your description you speak of shorting and unshorting a 55Ω resistor; please do not attempt to do that with AC power applied!
Sir thankyou very much for your guidance..please find enclosed corrected circuit advised by you..with output still not according to gain?
 

Attachments

Thread Starter

amad1

Joined May 25, 2019
50
@amad1
If your only requirement is to light an LED when the 55Ω resistor is unshorted, there are indeed simpler schemes not involving op-amps & comparators. Is this truly the only thing you must do, or is using an op-amp a requirement for a solution acceptable to you? Essentially, I (and others) am still asking what exactly are you trying to do? Is this part of a larger project? Describe.
Sir thankyou verymuch for your valuable response...Yes my purpose to light led/relay when there is short across point ab shown in previous figure.Led/RELAY turn ON when there is short and off when there is load acorss ab.
If there is other simple solution ,please recommend..thankyou
 

Bordodynov

Joined May 20, 2015
2,776
Sir thanksalot for your valuable guidance..A furthur guidance is required regarding TL3905(OPTOCOUPLER i think) operation in circuit?
Secondly Zener rating please?
Thirdly frequency is 50 Hz its output will be same?,
Zener rating 5V. I took this type of zener because it works well at 10 µA.
It'll be the same at 50 hertz.
 

Audioguru

Joined Dec 20, 2007
11,249
Don't you want the LED or relay to activate on both the positive and negative voltage of the neon bulb current?
Then the LM358 amplifier is not biased for an AC input and have an AC output.

If you do not want to bias the opamp correctly then it will need a positive and negative power supply.
Your 'scope does not show important DC voltages.
 

Attachments

Audioguru

Joined Dec 20, 2007
11,249
I see that the Toshiba Photovoltaic IC produces a negative voltage to bias the (-) input of the opamp then biasing the (+) input positively is not needed.
 

Thread Starter

amad1

Joined May 25, 2019
50
Don't you want the LED or relay to activate on both the positive and negative voltage of the neon bulb current?
Then the LM358 amplifier is not biased for an AC input and have an AC output.

If you do not want to bias the opamp correctly then it will need a positive and negative power supply.
Your 'scope does not show important DC voltages.
Sir thankyou verymuch for your valuable response....
Yes It doensot matter it is positive or negative cylce,as long as its magnitude is greater (ie if 3 Vac(assumed) is greater than 2 Vac(assumed),then led/relay turn OFF)than some reference(a vlaue selected from experimentation by shorting pint ab) ,then led/Relay should be OFF(it will indicate there is some load connected between point ab) and if there is short across ab ,then led/relay should turn ON...So first;y i am sensing ac volatge across ab ,ampliying it to a sufficient value to be fed to comparator, and then drive led/relay based on input to comprator..
How to bias LM358 correclty?can you share circuit please?
 

Thread Starter

amad1

Joined May 25, 2019
50
Don't you want the LED or relay to activate on both the positive and negative voltage of the neon bulb current?
Then the LM358 amplifier is not biased for an AC input and have an AC output.

If you do not want to bias the opamp correctly then it will need a positive and negative power supply.
Your 'scope does not show important DC voltages.
Sir thankyou very much for your valuable feedback...
when i connect 50 ohm load across point ab ,then am getting 110millivolts across point ab,when i short point ab ,i am getting almost 1.4millivotl(due to meter sensitivityand wire resisitance instead of 0 volt),when there is load connected i need to turn off led/relay,when point ab shortted i need to turr on led/relay...this is my purpose..
In the figure you asked about resistor values for LM358,i just choosen to get ampliifed signal 10 times(gain),if you can suggest practical values of resistors for LM358 for my objective,it would help me alot,please suggest..
 

TeeKay6

Joined Apr 20, 2019
572
Sir thankyou verymuch for your valuable response...Yes my purpose to light led/relay when there is short across point ab shown in previous figure.Led/RELAY turn ON when there is short and off when there is load acorss ab.
If there is other simple solution ,please recommend..thankyou
@amad1
Here's another approach assuming the only function is to light an LED only when the 55ohm resistor is not-shorted (i.e. when a voltage appears across the resistor). I have uploaded an LTspice simulation image (.jpg) and file (.asc).

To simulate a shorted and unshorted resistor, I have set up V1 to produce a burst of 50Hz AC between two periods of no voltage (green trace in image). D2 and D3 (any general purpose rectifiers) are shown as protection against the case when R1 is not connected and V1 attempts to rise (to the presumed 240VAC); e.g. if the neon bulb or its current limiting resistor is shorted.

Operation:
Two LM339 comparators are set up with thresholds sufficient to overcome any inherent input offset of the LM339. The upper LM339 (U1) changes state when V1 is approx -22mV. (Note that LM339 inputs operate with negative inputs up to -300mV.) The lower LM339 (U2) changes state when V1 is approx +22mV. Note that LM339 outputs are open-collector NPN transistors and can thus be logically OR'd by connecting them together.

Consider first circuit operation when R1 is shorted (i.e. V1=0V). U1 inputs cause its output to be open circuit (i.e. output NPN is off). U2 inputs cause its output to be open circuit as well. Thus both U1 & U2 output transistors are off and current through R4 pulls both outputs toward +5V and no LED current flows.

Now consider the case when V1 is more negative than -22mV. The output NPN of U1 will be turned on, pulling R4 to ground...and lighting the LED as long as V1 remains that much negative. Now the case when V1 is more positive than +22mV. The output transistor of U2 is turned on, again pulling R4 to ground and lighting the LED. Thus the LED is lighted when R1 is not shorted. The LED is off for the brief periods of each AC cycle when V1 is less than +/-22mV, but is on most of the time for the expected value of V1. Thus the LED on condition is a pulsing "on" every 10mS (for 50Hz) with a very brief "off" every 10mS. At 50Hz the "flicker" should be no more than barely perceptible. In the simulation image, the orange trace shows the LED current.

View attachment 181989

ATTENTION: To those having trouble running my .asc file, I am aware that I need to handle the non-std LM339 part...but I don't yet know how that is to be done. I will update my file when I learn the correct scheme.
 
Last edited:

Thread Starter

amad1

Joined May 25, 2019
50
@amad1
Here's another approach assuming the only function is to light an LED only when the 55ohm resistor is not-shorted (i.e. when a voltage appears across the resistor). I have uploaded an LTspice simulation image (.jpg) and file (.asc).

To simulate a shorted and unshorted resistor, I have set up V1 to produce a burst of 50Hz AC between two periods of no voltage (green trace in image). D2 and D3 (any general purpose rectifiers) are shown as protection against the case when R1 is not connected and V1 attempts to rise (to the presumed 240VAC); e.g. if the neon bulb or its current limiting resistor is shorted.

Operation:
Two LM339 comparators are set up with thresholds sufficient to overcome any inherent input offset of the LM339. The upper LM339 (U1) changes state when V1 is approx -22mV. (Note that LM339 inputs operate with negative inputs up to -300mV.) The lower LM339 (U2) changes state when V1 is approx +22mV. Note that LM339 outputs are open-collector NPN transistors and can thus be logically OR'd by connecting them together.

Consider first circuit operation when R1 is shorted (i.e. V1=0V). U1 inputs cause its output to be open circuit (i.e. output NPN is off). U2 inputs cause its output to be open circuit as well. Thus both U1 & U2 output transistors are off and current through R4 pulls both outputs toward +5V and no LED current flows.

Now consider the case when V1 is more negative than -22mV. The output NPN of U1 will be turned on, pulling R4 to ground...and lighting the LED as long as V1 remains that much negative. Now the case when V1 is more positive than +22mV. The output transistor of U2 is turned on, again pulling R4 to ground and lighting the LED. Thus the LED is lighted when R1 is not shorted. The LED is off for the brief periods of each AC cycle when V1 is less than +/-22mV, but is on most of the time for the expected value of V1. Thus the LED on condition is a pulsing "on" every 10mS (for 50Hz) with a very brief "off" every 10mS. At 50Hz the "flicker" should be no more than barely perceptible. In the simulation image, the orange trace shows the LED current.

View attachment 181989
Sir many thanks for your valuable guidance and recommended circuit.I simulated circuit by drawing it in multisim as i am not having pspice.It worked as you described.However
1)Is it possible to configure converse operation of LED?Means if there is short circuit across the resistor then led should ON?and vice versa?
2)Secondly Can i drive a 5V dc relay from output ?instead of led?
Best regards
 

Attachments

TeeKay6

Joined Apr 20, 2019
572
Sir many thanks for your valuable guidance and recommended circuit.I simulated circuit by drawing it in multisim as i am not having pspice.It worked as you described.However
1)Is it possible to configure converse operation of LED?Means if there is short circuit across the resistor then led should ON?and vice versa?
2)Secondly Can i drive a 5V dc relay from output ?instead of led?
Best regards
@amad1
Here is a revised circuit and simulation image. C1 filters out the brief "off" periods of the LED; this is optional for the LED but desirable when driving a relay. I don't have a relay in my library, so I have shown an inductor. Choose a relay that will operate from 5V with a coil current of less than 250mA (depends on R5 & Q1). R9 and D4 absorb the high voltage pulse that will occur at the collector of Q1 when the relay is turned off (due to the inductance of the relay coil); R9 could be 0 ohms but relay contact life would be longer if some small R9 is used. Choose R9 low enough that a scope shows the pulse at the collector of Q1 does not exceed the rating of Q1 (i.e. start very low and gradually increase resistance so you don't destroy Q1 while deciding on a value for R9.) For Q1 you can use either an NPN transistor or an N-channel enhancement mode MOSFET.

View attachment 182075
 
Last edited:

Thread Starter

amad1

Joined May 25, 2019
50
@amad1
Here is a revised circuit and simulation image. C1 filters out the brief "off" periods of the LED; this is optional for the LED but desirable when driving a relay. I don't have a relay in my library, so I have shown an inductor. Choose a relay that will operate from 5V with a coil current of less than 250mA (depends on R5 & Q1). R9 and D4 absorb the high voltage pulse that will occur at the collector of Q1 when the relay is turned off (due to the inductance of the relay coil); R9 could be 0 ohms but relay contact life would be longer if some small R9 is used. Choose R9 low enough that a scope shows the pulse at the collector of Q1 does not exceed the rating of Q1 (i.e. start very low and gradually increase resistance so you don't destroy Q1 while deciding on a value for R9.) For Q1 you can use either an NPN transistor or an N-channel enhancement mode MOSFET.

View attachment 182075
Sir thanks a lot for your modified circuit.I have simulated inmultisim and snapshot attached..working now as i requested ..However few queries
1)I am trying to vary V1(because actually I have variable different loads and i have noted voltage values across (point ab) ,below 17millivolts,LED is ON (idicating short circuit) but above 17millivolt until 85millivolts above which it becomes permanently OFF (showing unshorted ) it starts blinking slowly(may be it is in simulation only and may be it will be OFF in real hardware?Above 85millivolt,it is OFF which is ok.
2) Is this value(15milivolt) adjustable?means if i want to turn OFF lead above 5millivolt across R1?
3) Thirdly if we apply 240volt ac across point ab(R1) what will happen in real hardware?means comparators will blow?(and IF 240 Volt ac are applied most of time across V1(worst case),what will happen to comparators?
Regards
 

TeeKay6

Joined Apr 20, 2019
572
Sir thanks a lot for your modified circuit.I have simulated inmultisim and snapshot attached..working now as i requested ..However few queries
1)I am trying to vary V1(because actually I have variable different loads and i have noted voltage values across (point ab) ,below 17millivolts,LED is ON (idicating short circuit) but above 17millivolt until 85millivolts above which it becomes permanently OFF (showing unshorted ) it starts blinking slowly(may be it is in simulation only and may be it will be OFF in real hardware?Above 85millivolt,it is OFF which is ok.
2) Is this value(15milivolt) adjustable?means if i want to turn OFF lead above 5millivolt across R1?
3) Thirdly if we apply 240volt ac across point ab(R1) what will happen in real hardware?means comparators will blow?(and IF 240 Volt ac are applied most of time across V1(worst case),what will happen to comparators?
Regards
@amad1
(1)You asked for a circuit whose only function was to detect whether the 55ohm resistor was shorted or not. That is what the circuit I gave to you does.
(2) I have no idea to what you refer. There has been no mention of a "15millivolt" signal in prior discussion and I do not understand the meaning of the rest of your question.
(3) If you apply the 240VAC mains voltage directly to R1, R1 will probably evaporate with an explosion. After R1 disappears, the protective rectifiers will also disappear, and finally the rest of the circuit will melt. And if you happen to be touching any part of the circuit and ground when that happens, you too may disappear. In the USA, regulations would prohibit a direct connection to the mains without fusing and/or other protections.
 

Thread Starter

amad1

Joined May 25, 2019
50
@amad1
(1)You asked for a circuit whose only function was to detect whether the 55ohm resistor was shorted or not. That is what the circuit I gave to you does.
(2) I have no idea to what you refer. There has been no mention of a "15millivolt" signal in prior discussion and I do not understand the meaning of the rest of your question.
(3) If you apply the 240VAC mains voltage directly to R1, R1 will probably evaporate with an explosion. After R1 disappears, the protective rectifiers will also disappear, and finally the rest of the circuit will melt. And if you happen to be touching any part of the circuit and ground when that happens, you too may disappear. In the USA, regulations would prohibit a direct connection to the mains without fusing and/or other protections.
Thankyou sir for your valuable feedback .I have got a lot of help and guidance from you ...I will try to deal furthur...
What is max volatge that this circuit can safely handle(v1)?
Regards
 

TeeKay6

Joined Apr 20, 2019
572
Thankyou sir for your valuable feedback .I have got a lot of help and guidance from you ...I will try to deal furthur...
What is max volatge that this circuit can safely handle(v1)?
Regards
@amad1
The voltage at the input to the LM339 should never go more negative than -0.30V (relative to its ground pin); that will set a limit on V1. I may be able to offer further help, but I have to understand clearly what you are asking...and it is very frustrating when what you want changes after you get it. :)
 

Thread Starter

amad1

Joined May 25, 2019
50
@amad1
The voltage at the input to the LM339 should never go more negative than -0.30V (relative to its ground pin); that will set a limit on V1. I may be able to offer further help, but I have to understand clearly what you are asking...and it is very frustrating when what you want changes after you get it. :)
Many apologies sir...For disturbing you...and make troublesome..Its my immense pleasure to seek help from you..I am sharing my real problem.
In this circuit ac 240Vac supply feeds through two paths
1) one through circuit breaker
2) second through neon plus resistor(it is 110k ohm i previuosly atttached picture)
load shown is domestic load forxample(electric iron,fan or laptop charger)
Now when breaker trips due to fault in breaker,I want to know that trip is due to short circuit(across load point ab in previous figure) or due to fault breaker.Neon gets ON in both cases means if breaker trips(any reason short across load or fault in breaker) ,then NEON gets ON .I want to discriminate between SHort across point ab(load) or load connected.So Iam measuring volts and then getting LED or relay i discussd before to turn ON.So when Neon plus LED is ON means short across ab,and if only Neon ON and led OFF means no short across ab..
Regards
 

Attachments

Bordodynov

Joined May 20, 2015
2,776
Last edited:

Thread Starter

amad1

Joined May 25, 2019
50
I'm using LTspice. This program does not have a model of this optocoupler in the initial state. I went to the site of the optocoupler manufacturer and took this model. I have two more models of these devices, but I don't think you have them either. You can install LTspice (completely free) and add my collection of models to it. There are links to downloads on this site.
https://forum.allaboutcircuits.com/...nents-models-of-ltspice-free-download.133690/
http://bordodynov.ltwiki.org/
Thankyou verymch sir..
 

TeeKay6

Joined Apr 20, 2019
572
Hi everybody.
I am trying to amplify some input volts(very low millivolts) to be fed to another circuit.But first i need just amplification with minimum components.

I am using LM358 amplifier but output is not as acccording to gain?

Circuit is attached .can anyone one help me out please
@amad1

I am attempting to get a clear understanding of what you are trying to do.

Please review these items (1.-6.) and indicate (i.e. write in an AAC post) ANY changes or corrections you believe necessary.
1. There is a source of 240VAC/50Hz having the capability to deliver large current and power.
2. Connected to the source is a "convenience outlet" (e.g. a wall socket), the current through which is limited by a circuit breaker. This circuit breaker is known to open its contacts due to either (a) current that exceeds the breaker rating or (b) a fault within the breaker itself. I suggest that an additional fault condition--indistinguishable from an open breaker--can exist due to defective or failed wiring anywhere in the path through which the 240VAC drives current. Wires do break; wires do get damaged; screws holding wires to sockets, switches, etc do become loose--all allowing loss of contact.
3. Various appliances may be connected via the convenience outlet. During normal operation these appliances may consume a range of power (and current) from quite small (0W) to rather large (1500W).
4. Connected appliances can fail. After failing they may continue to draw current ranging from 0.0A (e.g. the appliance power switch fails: a common failure mode) to the maximum current allowed by the circuit breaker. Appliances may contain temperature sensors that turn off the appliance at certain temperatures; this may appear as a temporary failure.
5. There is a resistor in series with a neon bulb, that for brevity I will refer to as the "neon circuit." The neon circuit is connected in parallel with the circuit breaker. When driven by a 240VAC source the neon circuit will pass a current in the range of 2-10mA (depending on resistor value and specific neon bulb used).
6. It is expected that the neon circuit will light whenever the circuit breaker is "open" and some load is connected at the convenience outlet. Such load includes any appliance that is switched "on" and was (a) working normally prior to the opening of the breaker or (b) had failed before or after the breaker opened. Such load also includes any appliance that has within it an automatic switch (e.g. temperature limit) to reduces the load current to 0A.
----------
An observation: In many countries the connection of the neon circuit would be prohibited by regulations because it allows (a small) current (but potentially large voltage) to flow to the load even when the breaker is open. That is, a person should be entitled to assume that no dangerous voltage is available at the convenience outlet if the breaker is open. I do not know whether such regulation is in force at your location, wherever that may be.
----------
Your goal is to set up circuitry such that a distinct visual indication (i.e. a combination or pattern of lights) is shown whenever a LOAD IS CONNECTED (and switched "on" if that feature is available) at the convenience outlet AND one of the following conditions exists. The lights must uniquely identify which condition exists (i.e. by viewing the lights you can tell which condition exists).

I believe that the following conditions could exist:
a. The load is operating normally. The circuit breaker is closed.
b. The load was operating normally but the circuit breaker has opened due to an internal fault within the breaker, or within the wiring from the 240VAC source to the load, or within the wiring from the load returning to the 240VAC source.
c. The load has failed (as defined at 4. above) but the circuit breaker remains closed.
d. The load has failed (as defined at 4. above) and the circuit breaker, in response to the failure, has opened.

Please review the possible fault causes discussed in paragraph 4. above. Indicate which of these causes you wish to consider for your design.

Please review the operating conditions listed above (a.-d.). Indicate which of these conditions your design must identify.

Thank you for clarifying your goal.
 
Last edited:
Status
Not open for further replies.
Top