I chose to use a Microchip
MCP4251 for my circuit (the
datasheet is available at the article
link). The MCP4251 is a dual-channel
SPI-controllable digital potentiometer
which comes in 5, 10, 50, and 100
kΩ varieties. I chose to use the 10
Using my trusty protoboard, I
wired up this simple voltage divider,
and I wrote some quick-and-dirty
Arduino code to communicate with
the potentiometer via SPI and vary
the output voltage sinusoidally.
Then, I connected the output voltage to my oscilloscope,
turned on the power, and watched the screen. Nothing
At first, I assumed my problem was related to the SPI
commands I was sending. (Did I misread the datasheet?)
After double- and triple-checking, I decided that the
commands should work. To check this conclusion in another
way, I disconnected the voltage divider from the power
supply, set my DMM to resistance mode, and started
checking the resistive properties of the digital multimeter.
The resistance across the entire device was measured at
10 kΩ. So far, so good. Next, I checked the resistance
between the wiper and one of the ends of the pot. I saw a
large oscillating variation from 0 to 10 kΩ. At this point, I
was stumped. The potentiometer was behaving exactly as I
expected, and yet the output voltage from my circuit was
not varying when the power supply was connected.
It didn’t take too much digging into the datasheet for
the MCP4251 to discover my mistake. The voltage applied
to the wipers of these digital potentiometers must be
between Vss (0V in my circuit) and Vdd + 0.3V ( 5.3V in my
circuit). In contrast, I had attempted to apply 5V and 7V to
the ends of the potentiometer.
Rats! It was time to modify my initial circuit.
The Solution: Another Simple
Circuit to the Rescue
Since I was able to vary the wiper position of my digital
pot as desired, I knew that this device could still be useful
in my final design. I could easily create a voltage divider to
provide a variable 0-2V output voltage by applying 5V
across a 15 kΩ resistor connected in series with my 10 kΩ
pot, as shown schematically in Figure 5. Prototyping this
circuit was a breeze, and it produced the desired results.
Once this circuit was completed, I just needed to apply
a 5V DC offset to its output, which I knew I could do with
another simple circuit: a summing amplifier.
The schematic of a basic summing amplifier is shown
in Figure 6. The output voltage from this amplifier is a
weighted sum of the two input voltages, V1 and V2,
defined according to the relationship:
If all resistances in this circuit are equal, Vout = V1 + V2.
Putting the voltage divider from Figure 5 together with this
amplifier produced the circuit shown in Figure 7, where R1,
R2, Rf, and Rg from the circuit of Figure 6 have been
replaced by 10 kΩ resistors. This circuit ultimately produces
a range of 5-7.7V at the output of the op-amp.
We could increase the 10 kΩ resistances to bring the
upper limit of the output voltage range closer to 7V, but we
can easily circumvent this upper limit when we write
software to control the wiper position for the pot, thus
controlling the output voltage.
Given this solid design, we knew we just needed two
of these circuits to take control of the translation and
rotation of our power chair base.
SERVO 07.2017 43
Figure 5. Schematic of the variable
voltage divider used in this project.
The output voltage from this circuit
is in the range of 0-2V.
Figure 6. Schematic of a simple summing amplifier
circuit. The output voltage from this circuit is
proportional to the weighted sum of the input
Rf + Rg R2V1 + R1V2 Vout = x
Rg R1 +R2( ) )(
Figure 7. Schematic of the voltage divider from Figure 5
incorporated with a summing amplifier like that in Figure 6. This
is the circuit used to control a single degree of freedom for the
wheelchair robot. The digital potentiometer is boxed in gray.