Fork me on GitHub

Project Notes

#261 DigitalPots/MCP4017

Control the MCP4017 single 7-Bit I²C digital potentiometer with an Arduino.

Build

Notes

I’m trying out some digital potentiometers for an application. This is a test of the MCP4017T-104E/LT (100kΩ rheostat version).

The MCP4017 acts as a rheostat - it sets the resistance between the Wiper and B pins, independent of VDD/VSS (i.e. the potentioneter is not grounded or tied to power).

Conclusion? Probably not the chip I’d choose for the job in mind. Key observations:

  • does not support hardware I²C address bits (and so far I think there’s no way set the address over I²C)
  • the 2.5mA current rating means it can probably only be used connected to a high impedance load, else it requires some form of buffer circuit.
  • SC70 - dang that’s a small package! Managed to hand solder to a 2.54mm DIP adapter without too much trouble (with the aid of a magnifying glass)

I²C Protocol Support

The MCP4017/18/19 come with a fixed bus address 0b0101111. So only one can be controlled on the same bus at the same time.

It has a very basic read/write I²C implementation, with no commands defined. Just read and write the wiper value.

Wiper Setting Properties
07Fh Full Scale (W = A)
07Eh - 040h W = N
03Fh W = N (Mid Scale)
03Eh - 001h W = N
000h Zero Scale (W = B)

Test Script and Performance

Measuring the actual resistance I see a full scale of 0Ω - 81.3kΩ (for the ‘100kΩ’’ chip). That is within spec - note the resistance rating of the chip is ±20%.

The MCP4017.ino sketch is a simple exercise of the chip. It steps from 0Ω to full scale with a 2µs delay between steps.

Note the trace looks logarithmic, but this is expected for a linear change in resistance, as I am measuring the resistance in a voltage divider - x/(x+10kΩ). The voltage divider is in the test circuit to avoid pumping more than the rated ±2.5 mA through the chip.

scope_full_scale_2us_per

Construction

Breadboard

Schematic

MCP4017_test

Credits and References

About LEAP#261 ArduinoDigital PotMCP4017

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader