Arduino Noise Filtering and Smoothing



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.

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)



You want to connect the capacitor between the read pin and ground.

The middle pot pin will be connected directly to the input pin, although you could increase the filtering effect by connecting via a resistor.



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];


Tutorial: Potentiometers with Arduino and Filtering


Potentiometer Reading


Leave a Reply

Your email address will not be published.