Creative Commons images are CC BY-NC-SA 3.0

1.50

added to your
shopping cart

quantity
In stock 351 in stock
1.50 1+ units
1.35 10+ units
1.20 100+ units

Description: Potentiometers are incredibly useful, whether you're controlling the volume on your stereo or the 'mood lighting' in your room. The problem with traditional potentiometers is the fact that your microcontroller doesn't have an easy way to interface with them. Digital Potentiometers solve that problem by allowing you to control a voltage splitter with digital signals.

Wire it up just like a potentiometer and use serial signals to 'turn the knob.' Another handy feature of digital potentiometers is that because they aren't controlled mechanically, they don't have a pre-determined sweep profile.In other words, depending on the way you write your code the potentiometer can 'sweep' in a linear fashion, a logarithmic fashion, or according to any other profile you like. Digital potentiometers can also be used in conjunction with rotary encoders to consolidate large banks of potentiometers into one 'smart' rotary control.

Documents:

Comments 31 comments

  • SparkFun should make a board that converts rotary encoder values into an analog signal using this chip.

  • Ah, nevermind, figured it out based on this: * P0A connected to +5V * P0B connected to ground * An LED and a 220-ohm resisor in series connected from P0W to ground * CS - to digital ardunio pin 10 (SS pin) * SDI - to digital ardunio pin 11 (MOSI pin) * CLK - to digital ardunio pin 13 (SCK pin)

    However, not really sure what the difference between Vdd and Vss is though, so I just connected Vdd to the +5V rail.

  • To simulate this (just less expensively) couldn’t you use a low pass filter to smooth out some PWM to an analog form, then use a BJT biased to its Q-point to vary the resistance? I’ve never tried it, but from what I’ve read on audio forums, sending square wave at 50% duty cycle to a low pass filter gives you a smooth analog signal. Vary the frequency, And you get different values. That digital pot does look nice though. Much more simple…

    • That’s fine if you want DAC for your chip, but this chip is great if you actually want a variable resistance: eg. Adjustable low-pass filter. Also, PWM introduces lots of noise.
      however, note that the pins in this chip cannot go below 0V or above VDD, which makes them a bit useless in audio when you need at least + and - VDD. This is very important, and it tripped me up when using a similar chip.

    • You could definitely do that if you wanted to, but you might run into a few different issues: 1) More components mean more points of failure. 2) The resistance of a BJT changes with its temperature. Run high current through your circuit or have something warm nearby and your resistance will change as the chip heats up. 3) You have manufacturing/process variation on all components. The size of your caps/inductors, resistors, and BJT parameters change from component to component. Once you wire up your design and tune it, your tuning parameters will work ONLY for that one circuit. The only way to reduce/eliminate individual tuning is to get space grade components with extremely high process tolerances…which will end up making your replacement for the $2 chip $30+.

  • While useful, a digital potentiometer is significantly different from a mechanical one. Mechanical potentiometer are continuously variable, but digital ones are limited to a fixed number of resistance steps. Mechanical potentiometer can also handle significantly more power and wider voltage ranges than digital ones; it’s pretty easy to overload a digital pot of this type. And digital pots do not automatically remember the setting. Some digital pots have memory a “non-volatile wiper”, but not this one. From the picture it looks like this is a MCP4131, which is a low end model from the Microchip line. This model has only 129 selectable resistance steps. There are models with 257 steps, which gives you twice the resolution, and models that have non-volatile memory (both for the wiper and a few spare bytes that can come in handy). Also, if you are looking to control a stereo signal you should consider a dual potentiometer model because the pots will be more closely matched than if you use two single pot chips.
    SFE editors: Ya might want to rebuild your search index - searching for “Digital Potentiometer” or “Potentiometer” doesn’t find this product.

  • MCP41HV51-103E/ST. Can withstand up to 36v on the resistor terminals

  • “…sweep profile.In other…”

    you’re missing the space between the period and “In”

  • I can’t get this chip to work at ALL. I’m pretty experienced with SPI as well, so I’m really not sure WTF is happening. It’s accepting my commands, because when I read back the status it’s not giving me the error bit. So it’s acknowledging that I’m giving it a valid address/command combination… but then it doesn’t do anything! I’ve tried the 8-bit increment/decrement commands, plus the 16-bit write commands to try and set the wiper value, but nothing changes… anyone else having this problem?!? I’m using a Bus Pirate to interface with it. Perhaps I’ll try using an ATmega or a PIC next

  • Looking for a tutorial on this part, all the links below seem to be dead.

  • I want to use d digital potentiometer MC4542 to increase and decrease the voltage of an appliance exactlly by 0.5 volts. also the voltage stage should remain same even after power cut. Can any one help me with the proceddure…I have to use this with pic12f675 to instruct the potentiometer.

  • btw, found this a lot simpler than what was in the comments. First line of the code got messed up…It should include the spi library header file.

    http://www.uduino.com/tutorials/1

  • I took the Mighty Drake’s library for Arduino (which is awesome) and modified it to work for LeafLab’s Maple IDE/Controller if anyone is interested:

    https://github.com/johnnyonthespot/MapleLibraries/tree/master/MCP4131

  • Has anyone tried or have an opinion on how well this pot would work replacing the mechanical pots on an xbox 360 controller? The resistance range of each axis on the thumbsticks seems to be about 10k-ish.

  • can these pot use in line following robot,.,. , any idea., to set the vref for white line

  • Can anyone post a circuit diagram for this? I’m a software guy and all these CS, SPI P0A stuff is confusing. Something similar to this one but specific to this chip: http://www.arduino.cc/en/Tutorial/SPIDigitalPot

    Thanks! – T

  • Does anybody have Eagle library for this chip?

    • it’s just an 8-pin dip… use any similar 8-pin dip chip (like a microchip 24LS640 or something) and you’ll have the exact same footprint.

      • Nevertheless, given that its SOT8 cousin is in the SFE libraries, can’t hurt to add the DIL one :)

  • Does anybody have Eagle library for this chip?

  • Does anybody have Eagle library for this chip?

  • I have a problem with the shared MISO/FMOSI port. I tried it out with a board (GHI Panda2) with 5V power supply and it works fine with the 4.7K resistor. Then I tried with the GHI ChipWorkX which requires 3V3 as it isn’t 5V tolerant and there I have some problems. Simply running the chip with 3V3 didn’t work at all (I didn’t get any reply). When I run the chip at 5V with Level converters (http://www.sparkfun.com/products/F8745) converting the SPI interface to 3V3 I don’t get absolute values for the wiper but only values of 0, 1, 3, 7, 15, 31, 63 etc. Has anyone else seen this as well? Any idea how to run the chip natively at 3V3? I guess I just have to use another resistor instead of 4.7K but I tried all the resistors from the Resistor Kit (http://www.sparkfun.com/products/F10969) and the full range from the POTI itself but none seem to work neither on the Panda2 nor the CWX. Any help will be greatly appreciated!

  • Someone please do a Bildr post on this!!

  • Quick question regarding the usage of a digital potentiometer: Can you use another resistor or potentiometer or digital potentiometer in series or parallel to change the values as you would with a mechanical one, or is the variability of the digital version accomplished in such a way as to make this impossible?

    • Yes you can think of it as a regular ole POT.
      Internally its just a bank of resistors in a ladder (http://en.wikipedia.org/wiki/Resistor_ladder) which are switched in and out to achieve the resistance requested over the SPI interface.

  • Here’s a library that to use with this POT.
    https://github.com/declanshanaghy/ArduinoLibraries/tree/master/MCP4161
    I wrote it when i used an MCP4161 in a project of mine. The chip featured on this page is a 4131 but the protocol is the same, so the library should work. If not, you could tweak it to work for both chips and submit a pull request.

    • I tried your library but couldn’t get it to work. You have MOSI and MISO set to different pins in the header, but the 4131 seems to have merged them to 1 pin.
      The 8-lead Single Potentiometer devices are pin limited so the SDO pin is multiplexed with the SDI pin
      (SDI/SDO pin). After the Address/Command (first 6-bits) are received, If a valid Read command has been
      requested, the SDO pin starts driving the requested read data onto the SDI/SDO pin.
      Can you provide an implementation of your library? Or can anyone else point me in the right direction? I know as much about SPI, well lets just say I know that i do not know.

      • http://www.drakescomputers.com/arduino/MCP4131.zip

        I ran into the same problem, Tinkered and got it to work. You will need a resister…

      • According to the datasheet, a simple resistor can be used to convert your existing MOSI/MISO lines into multiplexed 1 wire version. Which is good news as I wanted them to share the same SPI lines as everything else one that bus.

        • I used a 4.7k resistor on the SDO line, to multiplex them together (based on the datasheet)…seems to somewhat work. I got the wiper to wipe in both directions. Some how the read command isn’t working for me though…


Related Products