# Digital Potentiometer controlling DC motor speed problem: voltage won't step properly

I'm building a rheometer to measure the viscosity of liquids. I'm using a 4.5-10v DC motor which needs to be accurately controlled by a Raspberry Pi (the speed and torque must scale, so PWM is out).

I have been trying to control the motor with a 10k digital pot (MCP4131) in a voltage divider with a transistor to control the voltage through the motor.

In theory, the voltage should (as the pot sweeps through its range, 129 steps) vary between ~2.6v and ~10.5v.

In practice, the voltage only varies between ~7v to ~5v, reaching its minimum after only ~25 steps and then staying constant for the remaining 100 or so steps.

What is going wrong? Is there a better way of doing this?

This has been the bane of my life the last few weeks, any help would be greatly appreciated. If anything is unclear I will clarify as best I can.

EDIT: MCP3141 -> MCP4131

• Voltage measured at what point? I suspect if you disconnect the transistor and measure the W pin in isolation you'll get what you want. The transistor side of the circuit is very badly designed for speed control, and I'm not convinced by your reasoning in ruling out PWM? Jan 25, 2017 at 17:06
• What are the voltages at pins 5 and 7? Is W stepping properly from one of end to the other? I would diagnose the software/micro/pot and the motor drive output completely separately.
– user1844
Jan 25, 2017 at 18:37
• How much current can an MCP4131 supply? How much current do you need through the base of the transistor? Can the 12 V source supply enough current for the motor? Jan 25, 2017 at 18:57
• A quick read of the digital pot data sheet suggests that +12v on "Pot A" pin is way outside acceptable range of zero-to-Vcc. In your case Vcc=3.3v. Jan 25, 2017 at 21:09
• Before even trying to fix the circuit, motor speed and torque definitely does not scale with applied voltage in a simple way and there are other variables involved (like the load). Jan 25, 2017 at 21:15