Use PMOSFET to drive motor

Hello
(I AM A NOVICE)

I'm trying to power a 12VDC pump with 6-10V through a p-mosfet.

i use a summer to get the levels (0-5) from the Arduino, amplify it by 2.4, then use a follower to "equalize" the voltage on the power circuit to the amplified output. At least this is my intention.

I'm finding that when it's all connected, i always have 12 volts on the power circuit, regardless of input.

what i expected to see what that the non-inverting input of the opamp would read 'actual' voltage, and inverting input would read 'set' voltage, then the output would change the output to 'equalize' the non-inverting output to the inverting one.

That second op-amp is configured improperly if it's as shown.
The input should be to the non-inverting input and the output should be connected to the inverting input (that's negative feedback) for a "buffer"(X1). If you want an inverting buffer (X -1), it's a different situation (not a matter of pin swapping.)

Is the O-5V from the Arduino from analogWrite or digitalWrite?

Thanks for the reply.

Digital write.

The input on the first op amp is variable 0-5, not PWM. in reality, it will be one of 5 discrete values from 0-5V

Sorry, i am not familiar with X1 or X-1... but i am realizing now, you are right, i am looking for NEGATIVE feedback.

So, I cannot merely switch the pins? I must say, I have tried that. it didn't work.

odimachkie:
Sorry, i am not familiar with X1 or X-1...

Oh, me...
"times 1", multiplied by 1
"times negative one", multiplied by negative one (-X1 ?)

odimachkie:
So, I cannot merely switch the pins? I must say, I have tried that. it didn't work.

Anyway, an op-amp is the wrong way to go.
You just need to switch the Gate bias between +12 and Gnd.
I would do that with a transistor.

For instance,

with the circuit furthest to the right, the common emitter amp.
With the LED omitted, so it's just R2 between "9V" (that could be 12V, too) and the Collector, you have just what you need.
Connect the Gate to the junction of R2 and Q1's collector.
When Digital output is Low, the transistor is Off, the FET Gate is High and the FET is Off.
When Digital output is High, the transistor is On, the FET Gate is Low and the FET is On.

Probably go with a higher value of R2 (5K to 10K), and a low value resistor (100?) connecting the Gate to the R2-to-Collector junction.

You are trying to do an analog power control circuit when a PWM would be more efficient.
Or is there some reason PWM isn't suitable?

You also need to understand op-amp circuits a bit better (which will come).

MarkT:
You are trying to do an analog power control circuit when a PWM would be more efficient.
Or is there some reason PWM isn't suitable?

Incorrect, the p-channel MOSFET is also inverting so the polarity of the second
op-amp is right, its just that you cannot drive a power MOSFET gate direct from
most opamps! They are many nF of capacitive load and you'll get instability.

You need to get a bit cleverer for this kind of circuit, as the impedance and gain
of the MOSFET vary a lot - a secondary negative feedback network is needed from
opamp output to its -ve input to give high frequency stability, then a resistor between
opamp and MOSFET gate limits the current to what the opamp can handle without
saturating. Instability may still be an issue.

The circuit is basically that of an LDO regulator and these are tricky to get
stable. Here an NPN darlington to boost the opamp in emitter-follower mode
would be the easiest option.

MarkT:
Incorrect, the p-channel MOSFET is also inverting so the polarity of the second
op-amp is right, ...

Really? Bullocks.
Unless he changed that Dwg, the second op-amp has no negative feedback, the output's tied back to the non-inverting input.

Adding links --

http://www.eecs.tufts.edu/~dsculley/tutorial/opamps/opamps5.html

http://www.eecs.tufts.edu/~dsculley/tutorial/opamps/opamps1.html

I confess I nearly missed that myself, being so use to the normal pass-transistor
configuration.

JohnLincoln:
When you add an extra inverting stage that is within the feedback loop it effectively changes the inverting input to a non-inverting input, and the non-inverting input becomes inverting. The feedback needs to go to the "new" inverting input, (formerly the non-inverting input).

No, No, No - a thousand times, No.

Anyway, as I made clear in Reply No 3, there are two op-amps too many.
One transistor between the Arduino output and the FET's Gate will suffice.

Oh, look, this very matter was covered 2-3 years ago.

http://forum.arduino.cc/index.php?topic=61308.msg442835#msg442835

If the gate goes low, the output of the PMOSFET goes high. Thereby inverting. So for a buffer, that is the correct output.

I'm concerned that if things were wrong in the MOSFET, the output of the second Op Amp should be acting as if it had no feedback, not following the input. Are you sure you measured that on pin 7, and not on pin 6?

As pointed out, there are simpler ways to do this not involving Op Amps, using PWM. It seems to me that all you are doing with the 5 outputs into a summer circuit could be done as a single pin PWM feeding a transistor and PMOSFET directly, without all the extra stuff.

Look at the 2nd circuit in the first message in the link Runaway Pancake gave, but put D1 across the pump motor.
http://forum.arduino.cc/index.php?topic=61308.msg442835#msg442835

BTW, referencing your schematic, you really don't need D1. The diode across the motor will handle the inductive spike, and the diode integral to the MOSFET should handle any voltage generated by a turning motor, if somehow it generates something higher than 12V.