Fluctuating resistance in digital pot

I've wired a digital pot to my arduino and am having trouble with the resistance fluctuating. I have no trouble programming it to go to the correct resistance, but when there it can float +-50 ohms. This is a 10K pot with 256 steps so my noise at 100 ohms total is greater than each 39 ohm step. I thought it might be noise in the power supply, but I've used several different ones, the last was a battery.

One other thing that is odd is that at some settings the resistance floated by as little as 10 ohms, this is fine for my needs, but 100 is too much.

The pot is a 10K ohm analog device AD5241BRZ10 digital potentiometer programmed by I2C.

Here's a link to the datasheet: http://www.analog.com/static/imported-files/data_sheets/AD5241_5242.pdf

Can anyone see anything wrong with my wiring diagram? Is there any advice anyone can give? I may be outside the envelope that contains my knowledge.

You might want to use a an RC integrator (could do it with an op=amp but that is more complex)

An RC circuit with 1K resistors going from the Arduino to the load and 1 microfarad from each resistor to ground.

The Analog outputs are eally PWM and for some applications they need some smoothing so they are a more constant voltage for whatever you have connected as load.

There are some posts on what values to use, but this should give you a start. If it is too sluggish you might try smaller resistors.

The Analog outputs are eally PWM and for some applications they need some smoothing so they are a more constant voltage for whatever you have connected as load.

I think you are totally missunderstanding the circuit, it is an I2C interfaced digital pot, there is no PWM and no place to put an RC circuit.

I would double check if the Vdd and Vss are the right way round then I would add a decoupling capacitor across the supply of the chip.

Vss and Vdd are correctly wired.

I've read up on decoupling capacitors and my (probably over simplified) understanding is that the cap will act to smooth out voltage changes in the arduino's 5v regulated power caused by the changing power demands of the arduino itself.

The caps need to be placed as close to the digital pots power/gnd pins as possible.

The recommended sizes seem to be 0.1uf and 10nf. smaller caps can react quicker, thus the 10nf, larger caps can act longer, thus the 0.1uf.

I only have on hand 1uf and 10nf. I don't believe the large cap will harm anything (correct?), but will it be too large?

I have to echo Mike here. I'm confused by how you are using analog in to drive serial clock and serial data lines to the device.

Shouldn't you be measuring the voltage drop across the pot via analog in, while clocking data to the pot?

I only have on hand 1uf and 10nf. I don't believe the large cap will harm anything (correct?), but will it be too large?

As long as that 10nF is a ceramic one then it should be fine. If it is any other type it will not. This is because ceramic ones have a low inductance and so handle higher frequencies.

I'm confused by how you are using analog in to drive serial clock and serial data lines to the device.

Because those are the pins used for the I2C bus.