Maker Pro
Maker Pro

How can I control a DC 12V motor

JPU

May 19, 2012
282
Joined
May 19, 2012
Messages
282
Hi All

I have purchased a simple 12V DC pump. Model FA-1418 Max 5A. The motor is fitted with a 100 PSI pressure switch.

I would like to be able to control the speed of the motor and therefore the amount of water pressure produced upto the 100PSI max.

The motor has two wires leading to it, positive and negative supply.

Is there a way I can do this as ultimately I would like to control the motors pressure with a PICAXE chip.

Any advice or hints at what I need to get would be appreciated. I have used controllers for brushless motors and they can be controlled by a Picaxe, is there something similar for a motor like this or what problems will I encounter?

Thanks for your help.
 

GreenGiant

Feb 9, 2012
842
Joined
Feb 9, 2012
Messages
842
You can either vary the voltage or use PWM, the PWM is more efficient but a little more complicated.

you may need to get a secondary PWM controller that will be controlled by the PICAXE.

It should be as easy as reading the pressure and telling it to increase or decrease the speed.
 

JPU

May 19, 2012
282
Joined
May 19, 2012
Messages
282
Hi

Thanks,, I have had look and they all seem to be controlled by a potentiometer. Is there a name or special phrase I can use to narrow my search for a device that can control a DC motor using a 0-5V input?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
If you want to control it from a picaxe you should not need an external controller.
The picaxe is capable of producing the PWM signal. All you need is an approriate MOSFET to switch the motor.

Bob
 

JPU

May 19, 2012
282
Joined
May 19, 2012
Messages
282
If you want to control it from a picaxe you should not need an external controller.
The picaxe is capable of producing the PWM signal. All you need is an approriate MOSFET to switch the motor.

Bob

Hi Bob

As you know I am quite inexperienced and although I have an idea of how the circuit would work I hadn't thought along those lines. I will have a look for a mosfet which can be controlled by a PWM signal, that can handle up to 5Amps. Is this what you are suggesting?

Would this be the sort of thing I need.

http://uk.farnell.com/on-semiconductor/mtd5p06vt4g/mosfet-p-d-pak/dp/1459139?Ntt=MTD5P06V

Thanks for you help.
 
Last edited:

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
N channel MOSFETS are less expensive and more widely available than P channel. You put the N channel MOSFET between the motor and ground.

You also want to look for a logic level MOSFET so that it can be switched on completely with 5V out of your PICAXE. Typical MOFSETS need about 10V to turn on fully.

Bob
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
This MOSFET looks suitable: http://www.digikey.com/product-detail/en/IPP065N03L G/IPP065N03LGIN-ND/1996760

You need to program your MCU to generate a PWM (pulse width modulated) signal. Many PICs have a built-in PWM generation circuit. Your PWM cycle frequency should be roughly in the range 100~1000 Hz. Look up PWM on Wikipedia and in the data sheet for your MCU.

The PWM output signal should drive the gate of the MOSFET through a small value resistor, say 22 ohms. The MOSFET source should be grounded, and the load (the pump) should connect between the +12V rail and the drain of the MOSFET. While the PWM output signal is high, the MOSFET will conduct and energise the pump. The average voltage supplied to the pump will be the supply voltage multiplied by the PWM duty cycle (in percent) over 100.

You MUST connect a diode across the pump, because it is an inductive load - without the diode, every time the MOSFET switches OFF, the back EMF from the pump will produce a voltage spike which could damage the MOSFET. Use something like this: http://www.digikey.com/product-detail/en/10A01-T/10A01CT-ND/1922678
 

JPU

May 19, 2012
282
Joined
May 19, 2012
Messages
282
Thanks everyone for your help so far.

I ordered these from farnell 993-5614 (http://uk.farnell.com/stmicroelectronics/stp36nf06l/mosfet-n-logic-to-220/dp/9935614?Ntt=993-5614) . They have turned up and I have put the circuit together as you have all described. With the diode in place!

I used a simple program another chap devised for me on another forum to drive a Micropuck (credit to Goeytex on the Picaxe forum) . I have replaced the micropuck with the pump and of course added the diode. I am also using the 22ohm resistor in place of the 330ohm, to the gate of the mosfet. I am not being lazy by showing you his drawing, but I have my 3 year old tugging at my leg as we are off to the swimming pool and I don't have time to redraw it. The image also includes the program I have used in the Picaxe.

The circuit works and the pump turns. However it doesnt get anwhere near max speed. At best I can get the pump to draw 1Amp and its a 5Amp 12V pump.

Can you take a look at the code for me and does it need altering for the pump. I have to say , This PWM stuff is beyond me but I think I am pretty close to getting this to work.

Thanks all for your help.
 

Attachments

  • PWM TEST CIRCUIT.jpg
    PWM TEST CIRCUIT.jpg
    28.6 KB · Views: 196

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I assume you are powering the pump from 12V? And the PIC is powered from a lower voltage?

In that case there are two clear possibilities.

1. The PWM output from the PIC is not going up to 100% duty cycle. If you're only seeing 20% of the expected pump current, perhaps the PWM signal is only going up to 20% duty cycle.

2. The MOSFET is not turning fully ON and this is limiting the current to the pump. This would cause the MOSFET to get warm, possibly even hot.

The easy way to tell is to disconnect your 22 ohm resistor from the PWM output and connect it to the positive power supply rail for the PIC. This is equivalent to a PWM signal from the PIC with 100% duty cycle.

If the pump now draws 5A, the problem was the first one - the duty cycle of the signal from the PIC was too low. This can be fixed with firmware changes.

If the pump still only draws 1A, measure the voltage across it. If it's significantly less than 12V, this means that the MOSFET is not fully conducting. What is the power supply voltage for the PIC? According to the data sheet, 5V Vgs voltage turns the MOSFET ON hard enough that its drain-source ON resistance, Rds(on), is less than 50 milliohms. So with a 5A load it should drop no more than 0.25V, leaving at least 11.75V across the pump.
 

JPU

May 19, 2012
282
Joined
May 19, 2012
Messages
282
Hi

Thanks for your help. Ill try that out and get back to you.

Thanks
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
D'oh! I didn't notice that your PIC is only running at 3.6V.

With only 3.6V gate-to-source bias voltage, the data sheet does not specify a current rating or an ON-resistance figure. There's a typical graph that indicates that the MOSFET can still supply up to about 15A to the pump, but that's not guaranteed.

You might need to use a gate driver - either a circuit, or an IC such as the MCP1402 (http://www.digikey.com/product-detail/en/MCP1402T-E/OT/MCP1402T-E/OTCT-ND/1956554) powered from the +12V rail, to guarantee reliable saturation of the MOSFET.
 
Top