Arduino or Digital Pot to control speed of DC Motor?

Pardon me I am a beginner.

My messy diagram shows an off the shelf 12v DC vibration motor as it comes with a simple speed controller box which uses a potentiometer. Yes it has 4 wires so I assume there is some ECU inside the motor casing? The wire back to the pot reads as 5v.

Q. Must I employ a digital pot to control this via Arduino or may I send PWM 0 to 5v directly from Arduino pin to the motor via its input wire? Then how to ground and not blow anything up?

Seeking your guidance. Ideally wish to control 4 x motors via one Arduino so keen to hear your recommend solution.

Without knowing what is in the off-the-shelf motor housing, you will probably not get useful advice. The very least you could do is post a link to the actual item you want to modify.

The next step would be to open up the item and post the details of what you find. Or, by searching the web, you might even find that someone has already done that.

For more posting hints, have a look at the "How to get the best out of this forum" post, linked at the head of every forum category.

Google "low side switch". I don't know any Arduino board that has enough current capacity to drive a motor directly.

Your best approach is to configure a MOSFET as a low side switch and drive the MOSFET with a PWM signal.

Here is the motor FYI I have a 50w 12v DC "2.5amp" but 50w suggests 4amp
Pardon our interruption...
Alas it is does not come apart... I have tried. The bearings appear to be glued w lock tight or some other concrete.
It has 4 wires:

  • brown +12v in
  • black grnd out
  • blue +5v out
  • yellow w green stripe +0 to 5v speed control in

Wired as per diagram above to speed controller.
If no speed controller then they supply w short blue to yellow.

The 12v power and 5v speed are 2 different voltage inputs / wires... so the 5v pwm does not drive the motor like as in a DC brushed example. I have previous experience with a DC motor shield which successfully drives 2 x 12v brushed DC motors. This motor appears to be induction / squirrel cage.

How did you arrive at the diagram on the left? Did you expose the cable leads and measure the input and output voltages of the potentiometer? Does the controller box contain ONLY a potentiometer?

It is conceivable that a PWM output could substitute for the variable voltage input, as you suggest on the right hand diagram, but most likely you would need to filter the PWM to DC with an RC low pass filter (say, 5K and 330 uF).

Yes I dismembered and measured voltage as per your Q
...and yes ONLY a POT in the speed controller box.

Try this, connecting all the grounds. Neither R nor C is critical, but C should be greater than 10 uF.


Is this correct as per your suggestion? Can you spec the R and C for me please?
When you say not critical... what are the risks of not using R and C?
Thank you for your assistance it is highly appreciated.

No, connect the Arduino ground to the capacitor and 12V minus.

DO NOT connect the blue 5V wire to anything! That is the voltage reference intended to power the potentiometer.

For R and C suggestions see replies #6 and #8.

How does this look? Pardon me I am still learning.

No, connect all the grounds. Remove the 5V_blue to GND connection in the drawing below:

The USB cable does connect Arduino GND to PC GND.

Ah ok. Thanks so much. I have just been reading and learning all about low pass filtering in the other forums and now understand the how and why. It makes sense now... although I do want quick reaction / real time changes to motor speed. So does less filtering equal a faster response from the motor?

Just to follow up I did not go with the RC filter option but did successfully prototype a solution to operate the motor speed via a MCP4151 digital pot... and will now try to implement a 4 channel digital pot to control 4 x motors from one Arduino. Does anyone have any recommendations or experience with implementing a 4 channel digital pot to use with Arduino? Thanks again.