Electrical – Non-inverting amplifier clips to unexpected voltage

non-invertingoperational-amplifiervoltage-clipping

I'm trying to build a circuit where I control a small DC motor using an Arduino. My goal is to be able to sense the load on the motor, and shut it off or reverse when the load is too high or the motor is stalling.

My idea was to use a shunt resistor and a op-amp to sense the current through the motor and control it accordingly.

I'm powering the motor using 3.3v. The no-load current is ±10mA while the stall current is ±80mA.

I've build the following circuit (non-inverting amplifier):

enter image description here

Where:

  • Rsense = 0.1Ω, R1 = 2k, R2 = 1M

The op-amp I'm using is the LM324AN, which I power with 3.3v

effectively resulting in:

enter image description here

The voltage I measure over Rsense is in the range of 0.0011V and 0.0082V (which is as expected).

The problem is the Vout. I would expect this to be between ±0.5 and ±3.3v (the voltage it's supplied with). Since the Gain = 1 + R2/R1 ≈ 500.

However Vout is not coming above 2.06V. It seems some clipping is happening, which I expected. But I expected it to happen at 3.3V and not 2.06V.

Is there an explanation why the Vout is not coming above 2.06V?

Thanks, R.

Best Answer

I presume you have read the data sheet. Regardless, look at this one and on page 6 you'll see output voltage swing specifications. Granted, this is only given for a 30 volt power supply, rather than a 3 volt supply, but notice that a 324 is only guaranteed to put out 22 volts under those circumstances - although typically it will do much better.

So, when running at a 3 volt supply, you simply cannot get more than a volt or 2 out of the op amp. If you can't live with that, get an op amp which is specifically rated as "rail to rail output". This won't actually get perfectly to the rails, but it will do much better than an LM324.

Furthermore, running an LM324 at a gain of 500 is a really bad idea. Referring to the data sheet, on page 5 you'll see "Input offset voltage". This is an error voltage which every real op amp displays, and for the LM324 it can be as high as 3 mV. Multiply that by 500 and for zero current in the shunt the output voltage can theoretically be as much as +/- 1.5 volts. It's perfectly possible to compensate for this by providing a variable voltage at the ground end of the 2k resistor, in the range of +/- 3 mV, but this will not provide compensation for changes in the offset with temperature. This temperature drift is not specified for an LM324, and this should give you some warning that it is not intended for very high gain DC applications.

Finally, an op amp does not magically produce voltage. It can only produce an output between its power supply voltages. This means that for a single-supply setup such as you have, it cannot produce voltages less that ground. If you must have a negative voltage swing you must supply a negative voltage to the IC.