mcp23017 and 4051 Interference? Between Led&Pot

I have one mcp23017 multiplexer to turn LED's on and off, working fine.

I have one 4051 multiplexer to read analog potentiometers - I see the values of the potentiometers in serial monitor reporting stable values, albeit with a jitter of + - 1. This seems acceptable.

The problem is when I send on and off commands to the Leds through the mcp mux, it makes the reading of the 4051 potentiometer values unstable, with a jitter of around 8. This jitter is too much.

Is this because it is causing noise in the power, which needs smoothing, would de coupling be a solution? I am just wondering why when it turns the Leds on and off it causes spikes in the 4051 reading. I'm not sure where to put the capacitors, tried reading many posts but when I put caps between power and ground it isn't making a difference, does the 4051 need decoupling too? I am using a breadboard to prototype on, is that going to be noisy anyway?

please pardon me for beginner question. I will try making my schematic on fritzing to show you.

Hand drawn schematic please, not fritzing. A large portion of us here absolutely despise fritzing.

Ok sure, I just tried that software and didn't like it, i'll draw something. The wiring i have done thus far is probably wrong somewhere also, i'll check some things and come back soon.
Does this sound like a decoupling issue, or wiring, or both? Seems like every time i access the Mcp, it spikes the analog reading on the 4051

I would say it's more likely that switching the load that the MCP23017 is driving is doing it. Try switching one of the LEDs with a GPIO line from the micro.

Also, all digital IC's should have at least a 0.1uf decoupling cap between Vcc and Gnd right next to the chip. Do you have that? The muxer needs one too - check the datasheet to see if they have any specific recommendations.

Also, I would check that AREF/AVcc/Vcc wiring is correct. AVcc should be tied to Vcc. ARef should not be. Put a 0.1uf cap from ARef to ground if you don't already have that.

Also be sure you have sufficient filtering on your power rails in general.

Finally, you can filter out the noise in software if you need to...

In addition to DrAzzy excellent suggestions, then make sure that your ground return path for the LEDs is not in the ground return path for the 4051.

A simple way to do this is to wire up the MCP23017 and LED to one ground on the Arduino and the 4051 and associated pots to the other ground.

Thanks for great advise. All of that was the solution (capacitor on power rails, 0.1uF for chips, ground wiring sorting) It's actually working steady now :slight_smile: