potentiometer, where to put noise filtering capacitor, on multiplexer sheild

hi all, I'm looking for some guidance, i have 16 potentiometers (10k linear) connected to each of the inputs on a 4067 multiplexer.

i also have a 0.1uF polarized capacitor on each one, connected between the ground and the signal pin.

I'm getting some interference between pots, some of them have a limited range unless i turn another pot, then it seems to go normal again. this seems to happen when a few of the pots are at 0.

should i put 1 capacitor across the analog pin, or keep them 1 on each pot?
im asking before i go an cut the capapcitors off my pots and have to resolder them all.

My thinking is that because signal pin to each pot is connected and disconnected rapidly by the multiplexer, that this is causing the capacitors to discharge issues?

How have you wired them exactly?

BTW 0.1uF polarized capacitors are unusual items, sure they are polarised?

wired them , +5v parrallel, Gnd parralel each potentiometer output is wired directly to the 4067 channels (16 of them). the caps are soldered to the pot pins, ground pins to output pins. i am sure they are 0.1nF polarized, they say 0.1nF on the side and they have a negative side indicator printed on them. i ordered specifically for this as they were reccomended on a site i found (cant remember the site)

hopefully that is clearer

the caps essentially bridge the output pins to the ground, on each pot.
this worked great for reducing noise on the pots connected directly to analog pins, but im not sure if its thr right thing to do on the 4067 pins, since they switch rapidly. the 4067 uses a shared analog pin, so im wondering if the pots would be better off sharing 1 capacitor on that shared analog pin instead?

had any luck with reducing the noise?

i am sure they are 0.1nF polarized, they say 0.1nF on the side and they have a negative side indicator printed on them. i ordered specifically for this as they were reccomended on a site i found

Well if you did you have wasted your money. Polarized caps are totally useless for high frequency noise suppression you need ceramic ones.

the caps are soldered to the pot pins, ground pins to output pins.

No idea what that means you should not be connecting capacitors to output pins.

the caps essentially bridge the output pins to the ground, on each pot.

When you say output pin do you actually mean pot wiper?

You need a 0.1uF ceramic capacitor across the power supply of the multiplexer. You need to check your wiring.

thanks for the replies, ive not been on here in a while,

ahh, thanks for the tip grumpymike, the caps are definitly electrolytics, but they seemd to work ok, not perfect, but a little modifications to my code seemed to do the trick, the pots are sensitive though, they output midi at the slightest touch, but at least they dont do it by themselves or eratically, ill use ceramic next time round :slight_smile:

yes sorry i actually meant the output pins from the pot, aka the wiper, that was my bad use of terminology, the caps were soldered directly to the pots ground pin and wiper pin, seemed to do the trick.

i also would like to add, that i ended up just putting caps on all of the pots, since the sheild has leds conected to it on the other 2 4067's, i just went and ploughed ahead with what i thought would work since i didnt get a reply quick enough, and it was ok. next time round i will certainly do things differently.

yes earx, it seemed to be ok, the way i did it was to store the pot value, and then devide it by 8 as it went out to midi, i had been trying to devide by 8 then store it, then send it out to midi. which didnt work as well, it made it difficult to tweak the threshold value since i could only tweak it by multiples of 1

the pots are sensitive though, they output midi at the slightest touch,

That is down to your code.
Remember the previous state of the pot and only send MIDI when the new reading is different by four or eight. The abs function is good for that:-

val = analogRead(pin);
if( abs(val-oldVal) > 4) { // send MIDI

thanks for the tip mike, I pretty much had something like that going on already,

example;

 potVal[17] = analogRead (Pot17);                             // Read the analogue pin
    if (abs(potVal[17] - oldVal[17]) > (Threshold)) {             // Compare the reading to the last reading, if its changed by enough, then it will send a midi message.
      Serial.write(MIDI_CHANNEL+176);                             // Midi channel, (leave this alone as its already defined)
      Serial.write(16+page);                                            // change this for each pot, to send different cc numbers, values between 0-127 please!
      Serial.write(potVal[17]/8);                                  // print the pot value (the division is done here rather than earlier, this allows more noise to be filtered by the threshold without affecting the output)
      oldVal[17] = potVal[17];

and the threshold is int Threshold = 8

i'm not 100% sure what abs does, it converts to the nearest whole positive number, am i right?

i'm not 100% sure what abs does, it converts to the nearest whole positive number, am i right?

No.

BTW the best place for the caps is on each input to the multiplexer, then they will
kill any interference on the cables as well as scratchiness from the pots. Try 2u2
electrolytics for more filtering (time constant about 10ms rather than 0.5ms which
the 0.1uF caps give).

Electrolytics can be backed up by 0.1uF ceramic if you are worried about RFI.

cheers for the info markT, that makes sense, next time round...

em grumpymike, care to elaborate on that at all? i dont really understand the reference, whats the difference between a value and an absolute value?

The absolute value of a number is its distance from zero. This cannot be negative
as distances are never negative. This definition works for complex numbers as
well as reals and integers.

ahh! so in the case of storing pot values, using abs would theoretically stop me from getting problems with the pot acting in a relative position mode

Sorry to open this again, but I think it is decent information for posterity's sake.

I'm glad that you were able to fix this in code, but I'd like to offer another solution, in case somebody else runs into this issue. If you did not receive as much noise before going through the multiplexer, I would venture a guess to say that the multiplexer is to blame for introducing the new noise.

I think what you may be in search of is a decoupling capacitor for your multiplexer IC. From "Practical Electronics for Inventors" by Paul Scherz and Simon Monk:

"As a general rule of thumb, use one 0.1-uF ceramic per digital chip, two 0.1-uF ceramics per analog chip, (one on each supply where positive and negative supplies are used) and one 1-uF tantalum per every eight ICs or per IC row, though you can often do with less. Also, a good place for bypass capacitors is on power connectors. Anytime power lines are leading off to another board or a long wire [like the leads to a pot might use], it's a good idea to throw in a bypass capacitor; long wires act like inductive antennas, picking up electrical noise from any magnetic field."

I'm assuming your chip doesn't require a negative supply. So, you can see they suggest adding one 0.1uF ceramic cap between the Vcc and GND next to your multiplexer chip. The reason for this is because the load of your chip my suddenly switch when you change which analog value you are reading. This will cause a ripple in your supply voltage, which may also damage your Arduino if the ripple is large enough. The capacitor next to the chip acts to decouple it (hence the name decoupling capacitor) from the power supply.

Also, make sure the leads on your capacitor are as short as possible. Long leads on a cap increase its internal inductance, which reduce its effectiveness.