# Op amp problem

**URL:** <https://forum.core-electronics.com.au/t/op-amp-problem/20711>\
**Category:** Uncategorized\
**Created:** [26 August 2024 22:36 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711 "2024-08-26T22:36:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [26 August 2024 22:36 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/1 "2024-08-26T22:36:13Z")

</div>

Hi All,

I’ve got a strange problem with using this LM324. It’s a straightforward use, nothing fancy. Problem is that the output is a constant voltage and stays that way no matter what voltage appears at pin 3 (+ve). My simulation in MultiSim says otherwise.

My circuit.

 ![U4a problem](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/4/46db1ce86fcaeef427f23f7531209a6aa6435721.jpeg)

MultiSim

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/2/22d030db50053865e38ce9b6440a9e451d5e0aaf.png)

Any thoughts?

Gerard

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 00:22 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/2 "2024-08-27T00:22:26Z")

</div>

Hi Gerard  
For a start that switch transistor is a high side switch and I think should be PNP (the one shown is NPN) with the emitter to 5V and collector to the load, the base taken to ground via resistor to switch ON and to 5V to switch OFF.

At the moment the emitter will ALWAYS be 0.6V (approx) below the base voltage whatever that is at that time. In other words you have an “emitter follower” amp.

The OP Amp circuit is not EXACTLY as shown in your Simulator. Nothing like it in fact.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [27 August 2024 00:36 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/3 "2024-08-27T00:36:45Z")

</div>

The BC547 is about to be replaced by a FET.

I know the circuit isn’t exact but it’s the best analogy I can make in Multisim.

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 00:42 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/4 "2024-08-27T00:42:58Z")

</div>

Hi Gerard

> [@Gerard163258](#):
>
> The BC547 is about to be replaced by a FET.

The same applies. It has to be a P Channel FET.

> [@Gerard163258](#):
>
> I know the circuit isn’t exact but it’s the best analogy I can make in Multisim.

Your Op Amp circuit has both sensor outputs going to the same non inverting OP Amp input.

The Sim circuit gas one source going to the non inverting input and the other going to the inverting input. To be the same both sources have to be going to the non inverting input. Should not be too hard to do. Just change the sim connection.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Jeff105671](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jeff105671/32/3729_2.png) [@Jeff105671](https://forum.core-electronics.com.au/u/Jeff105671)\
**Post date:** [27 August 2024 00:43 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/5 "2024-08-27T00:43:45Z")

</div>

> [@Gerard163258](#):
>
> I know the circuit isn’t exact but it’s the best analogy I can make in Multisim.

The way that I read it V2 should be replaced with a variable capacitor. I can’t think why Multisim would object to that. And V3 isn’t needed.

---

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [27 August 2024 01:03 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/6 "2024-08-27T01:03:40Z")

</div>

Damn! Somehow I edited the Multisim without due care. Thanks for noticing.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/d/dfd4e1abc046ec9bec30cdf95cf1f77aa92423e0.png)

So, to make it that same, I removed the external devices and put in a voltage divider across the inputs to the +ve op-amp pin as per the revised schematic. Also removed the BC547 as not req’d.

 ![U4a problem 2](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/a/ac76a1b2947fbffeae4c2e7bee79a10caefff32e.jpeg)

Output from the LM324 is the same. Maybe, there’s some noise creeping in but my observations from my 'scope doesn’t notice anything.

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 04:44 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/7 "2024-08-27T04:44:50Z")

</div>

Hi Gerard  
Excuse my ignorance but what are the voltage dividers for or they just simulating the sensors (without sensors connected).

With the circuit shown you will not see any changes at the Op Amp output as you have a static situation. What you see at the + input is correct (hall the 5V due to the dividers). The set up is basically a wired OR with a bit of gain, hence the 3.74V at the output. the 1.87V is simply the output divided by 2(the 2 2.0kΩ resistors forming a divider.

As a test disconnect output divider and connect the output to the - input directly. The output should now be the same as the + input

Incidentally this is not the best Op Amp for this application as it is NOT “rail to rail”. The maximum output for Vcc of 5V is 3.3 to 3.5V so the output you measure does not mean a thing. If it were the ideal world I would expect a gain of 2 (I think, I will have to check). and your 3.74 might be Op Amp limiting.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [27 August 2024 05:11 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/8 "2024-08-27T05:11:39Z")

</div>

Bob,

I suspect I’m the ignorant one here!!!

The voltage dividers are, as you allude to, simply removing the sensors from the equation.

I’ll test it as you suggest. Looks like we’ll just have a unity gain circuit, which is fine.

I suspect that if we used a ‘rail to rail’ op-amp, the output would be up near Vcc? I think an LF347 is such a device.

I’ll tinker some more and come back here later on.

Edit: The intent with this bit of design is to amplify the incoming sensor voltage x2. The sensors will be a couple of metres away from the PCB and I was a little concerned about loss. This concern could be misplaced since the current flows are tiny.

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 05:40 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/9 "2024-08-27T05:40:38Z")

</div>

Hi Gerard  
The gain as you have drawn it would be (R21 + R22)/R21 which would be 2. So you would expect to see an output of 5V so what you are seeing is Op Amp limit.

I don’t think the LF347 is rail to rail either. One I have used is LMC6482 (dual) or LMC6484 (Quad) which will swing to within a few mV of voltage rails.

> [@Gerard163258](#):
>
> and I was a little concerned about loss. This concern could be misplaced since the current flows are tiny.

Don’t worry about this unless there is a proven problem…

---

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [27 August 2024 05:59 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/10 "2024-08-27T05:59:30Z")

</div>

OK. Test results.

I simulated 2 results.

**Removing the 2k0 to ground and connecting the output to -ve input with sensor plugged into the +ve input.**

Initially, the output follows the +ve input but then, over several seconds, rises to about 3.7V. Something weird here.

**Replacing the sensor with a voltage divider that greatly reduces the input voltage to the +ve pin. I worked the resistor values to create 1.2V.**

In this case, the op-amp behaves exactly as we expect. 2.4V out.

Curiously, removing this divider and replacing it with the sensor (approx same voltage, about 1.2v), the op-amp heads north to 3.77V output. So, it looks like there’s something incompatible with hooking the sensor to the LM324.

---

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [27 August 2024 06:48 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/11 "2024-08-27T06:48:33Z")

</div>

Apologies…I missed this.

Why the capacitor?

Also, I left V3 in as I wanted to mimic the actual circuit as best as possible (errors in my Multisim excluded!!)

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 06:58 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/12 "2024-08-27T06:58:33Z")

</div>

Hi Gerard

> [@Gerard163258](#):
>
> the op-amp heads north to 3.77V output

What is the Op Amp input doing while this is happening. As stated the 3.77V would be about maximum from the LM324.  
The output from the sensor might be rising. That would explain it.

Cheers Bob  
PS You might not see much change at the Op Amp input pin. If you don’t try measuring at the sensor output side of R9 (R10).

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 07:07 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/13 "2024-08-27T07:07:50Z")

</div>

Hi Gerard  
Exactly what are these “Sensors”. The statement “the sensors” doesn’t tell anyone much  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [27 August 2024 07:28 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/14 "2024-08-27T07:28:44Z")

</div>

Just the common capacitive moisture sensors. Based on a 555 timer.

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 07:48 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/15 "2024-08-27T07:48:06Z")

</div>

Hi Gerard  
Any identifier to say EXACTLY which one this is.

> [@Gerard163258](#):
>
> Just the common capacitive moisture sensors. Based on a 555 timer.

Not good enough  
Bob

---

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [27 August 2024 09:43 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/16 "2024-08-27T09:43:59Z")

</div>

Lemme dig out the schematic tomorrow.

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 10:09 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/17 "2024-08-27T10:09:04Z")

</div>

Hi Gerard  
Good that might make things a bit clearer.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [27 August 2024 10:38 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/18 "2024-08-27T10:38:27Z")

</div>

Hi Gerard  
Another thing to try. Disconnect one of the sensors and only work with one until this is sorted. You have an OR situation here where the output of the Op Amp will be the result of whichever sensor has the highest input (I think).  
I will have to have a think about that. But getting one to do what is expected would be a good start.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Gerard163258](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gerard163258](https://forum.core-electronics.com.au/u/Gerard163258)\
**Post date:** [28 August 2024 00:45 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/19 "2024-08-28T00:45:40Z")

</div>

I believe this is the correct schematic…

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/1/15cfb50fdb69ae3712de90c3f5bcccae3c95da73.png)

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/2/2d80c50c14ab8980755828f6bdfd9a61edbb3708.jpeg)

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [28 August 2024 03:21 UTC](https://forum.core-electronics.com.au/t/op-amp-problem/20711/20 "2024-08-28T03:21:37Z")

</div>

Hi Gerard.  
OK that says and helps a lot.  
You have marked the 1MΩ (R4) as sometimes missing. If that were the case the 1µF cap (C4) would charge up to peak voltage AND STAY THERE. In other words the circuit would behave as a PEAK HOLD detector. This resistor discharges the cap slightly between pulses and will discharge completely in the absence of pulses. I have not worked out the time constants but any change will not be immediate and might take several seconds which would verify the effect you are seeing with a seemingly slow rise to your 3.7V that you measure.

I don’t believe you want a peak hold so make sure R4 is connected and try again.

I don’t believe the outputs being connected via a couple of 1k resistors would interact. The diode D1 (or T4) would prevent any back feeding and the resistor to ground is 1MΩ so you would be getting a minimal voltage divider effect.

You will still need a rail to rail Op Amp.  
You will still have an ORing effect where the Op Amp will output a voltage proportional to the highest input.  
I am assuming that is what you want.  
Cheers Bob

[Next page](https://forum.core-electronics.com.au/t/op-amp-problem/20711.md?page=2)
