Op amp problem

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.

MultiSim

Any thoughts?

Gerard

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

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.

Hi Gerard

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

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

1 Like

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.

1 Like

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

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.

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

1 Like

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

1 Like

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.

1 Like

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.

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

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.

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!!)

Hi Gerard

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).

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

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

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

Not good enough
Bob

Lemme dig out the schematic tomorrow.

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

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

I believe this is the correct schematic…

1 Like

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

1 Like