Hi all!
The MCP41100 is a programmable digital potentiometer with SPI interface and comes in a breadboard friendly DIP-8 package. You can set it to any value between 0 (zero) and 100 kOhm in 256 steps. You can of course tweak it into doing other ranges by wiring in series or in parallel with other (fixed) resistors.
For another project, I needed to produce a variable voltage between 0 (zero) and 5V so I made a simple driver class for it and thought I'll share it with you. Attached you'll find the driver and demo app. It is written for my beloved mini but works with others too requiring only small modifications.
miniMCP41100.zip 4.51KB 7 downloads
You simply use it like this:
var r = new MCP41100(new SPI.Configuration(Pins.GPIO_PIN_17, false, 0, 0, false, true, 10000, SPI.SPI_module.SPI1));// set half resistance (i.e. ~50k)r.Level = 128;// set zero resistancer.Level = 0;// ...or you can use the Resistance property to set ~50k like sor.Resistance = 50000;// set ~100kr.Resistance = 100000;
The demo app assumes the IC has been wired as a voltage divider like in this schematic (Pw = output):
mcp41100.PNG 20.48KB 25 downloads
When connected that way, you can use it as an a very slow "arbitrary signal generator" meaning you can pretty much draw any signal over time like I did in this post or a nice sine wave if you prefer that:
MCP41100_sine.JPG 36.09KB 24 downloads
I guess you could think of the MCP41100 like a "poor man's DAC" but since the mini does not have a DAC, it can actually very useful at times as it's also much simpler than to use PWM.
Enjoy!
EDIT: Note that the MCP41100 is not suited for signal generation in general.