MAKING YOUR OWN VARIABLE RESISTORS
Anything conductive, accessible, doesn't oxidise, able to be "wiped" with a wiper (resistor pickup) with adequate dying "too quickly".
As this is as much for fun as anything else "too quickly" may be able to be of lower duration in time or cycles than usually.
Resistance values that you generate may be lower than not, depending on material used.
Properly "potentiometer" mans a 3 terminal device with voltage across it and a sliding voltage tap but I'll take it to also just mean 'variable resistor.
Connection to start may be with "crocodile clips or pushed in "drawing pins" / "thumbtacks/other.
Pencil lead.
Select an old (or new) pencil.
Sharpen both ends.
Measure resistance to see what sort of pot resistance you are going to get.
CAREFULLY break open and remove the lead intact.
May need a few pencils to get it right.
Connect clips at either end.
Connect ohmmeter to one end.
Run other ohm-meter along length and note variation in resistance.
If you connect a voltage across length then you can use a slider to puck off variable voltage with position.
Resistance wire
In place of the pencil lead above you can us a length of new or used resistance wire.
Wire can be strethed tight between eg thumbtacks or nail in a piece of wood.
Note that wood becones part of the resistor.
New Nichome or Chomel wire canbe bought for modest cost.
Ohms per metre varies with thickness - thinnest possible is liable to be best.
Around 10 ohms/meter is common but higher R is possible.
Nichrome from old heater or toaster element works.
This may be somewhat oxidised with age and may be brittle.
You can sand surface carefully once stretched in place.
Butyl Rubber and friends
Black rubber used for roofing has carbon black in it.
Take meter and wander round sticking probes in rubber on sale and other material.
When you find a sheet of substance that has some resistance acquire a small sample by best permissible means and cut strips to make a pot.
Paper and salt water.
Lay out a strip of newspaper
Wet well but not until soggy with salt in water solution.
Test pot.
Note how result varies with salt concentration, degree of saturation of paper, passage of time, ...
Try copper-sulphate in place of salt.
Try "Epsom Salts"
Try ... ?
Copper wire
!!!
(1) Get thinnest possible bare copper wire.
Measure resistance.
Low but usable.
(2) Now for a very good trick.
Get thinnest (within reason) enamel or varnish or polyurethane insulated copper wire. Sortthat insulation can be "sanded" off with care.
Find a "former" that is an insulator and that you can wind your copper wire on.
Round or oval cross section is good.
Once you have built one you will get a better feel for shape that is needed.
Wind copper carefully and neatly in a long ish coil along formr. Many turns.
Not too too many the first time.
Wind neatly so turns stack against each other neatly.
Fasten carefully at both ends.
Now CAREFULLY use fine sand paper to sand along top surcae of coil so you expose copper on each turn BUT DO NOT TAKE OFF SO MUCH THAT COIL TURNS ALL GET SHORTED TOGETHER.
Run a wiper along the bared copper.
You have a wire-wound variable resistor.
"Plastic"
Use epoxy resin and silicone rubber.
Fill with various amounts of carbon black, or pencil graphite or powdered metal etc.
Make a track.
Let set.
Test.
Also silver filled compound used for PCB track repair.
Also ??? - look around you ... .
By now you should have a few other ideas.
Report back :-) !!!!
Are you digitizing a variable voltage produced by an analog potentiometer?
I have used gear like that and seen the jitter and flakiness in the values being read from the pots. In my experience it could be improved substantially by cleaning the potentiometers with compressed air and alcohol.
I suspect what the problem is that DC is naively being sent across the potentiometer, and then the divided voltage is sampled.
Audio designers know that significant DC currents flowing across potentiometers (which also carry audio) will add lots of scratchy, crackling noises when those potentiometers are moved (and maybe even when they aren't).
If I were designing a circuit which digitizes the position of an analog potentiometer (rather than the obvious approach of using a rotary or linear encoder), I would drop strictly an AC signal (from an oscillator) across the pot, with no DC component. This would then be rectified, peak-detected and digitized.
Another consideration is that cheap carbon pots are more noisy than ceramic, conductive plastic or wire wound units.
A very simple software technique to smooth values is exponentially-weighted smoothing. This is a beautiful trick which allows the smoothed value to depend on all prior values, without retaining a history of prior samples. (Familiar analogy: the charging of a capacitor is similarly exponential, and the current value depends on all the past currents. However, the capacitor has no memory, per se.) Looks like there is a Wikipedia page about it.
To implement exponential smoothing, simply keep track of the estimated value \$s\$ of the potentiometer (or whatever parameter \$x\$ you're sampling).
The estimator is initialized with the first sample:
$$s_0 = x_0$$
Therafter, when a new sample is obtained, we replace the estimator with a linear blend of the existing and new value, where \$\alpha\$ is the blending factor (called "smoothing factor" in this situation).
$$s_t = \alpha x_{t-1} + (1 - \alpha) s_{t-1}$$
This can be conveniently rewritten like this:
$$s_t = (s_{t-1} - s_{t-1})^{\rightarrow 0} + \alpha x_{t-1} + (1 - \alpha) s_{t-1}$$
$$s_t = s_{t-1} - s_{t-1} + s_{t-1} + \alpha x_{t-1} - \alpha s_{t-1}$$
$$s_t = s_{t-1} + \alpha x_{t-1} - \alpha s_{t-1}$$
$$s_t = s_{t-1} + \alpha (x_{t-1} - s_{t-1})$$
In other words, the new estimate is the old estimate, plus a fraction of the difference between the new sample value and the old estimate.
If all the quantities are integers and \$\alpha\$ is some power of two constant, this is very easy to implement in code. For instance, suppose we take \$\alpha\$ to be \$1/4\$, so that we blend 25% new value, 75% estimator:
/* C pseudo-code */
s += (sample - s)/4; /* optimizes to s += (sample - s) >> 2; */
/* s returned to caller as the value */
Exponentially-weighted smoothing implemented as one line: subtract, shift right, accumulate.
Best Answer
To search for the described part, use the keywords potentiometer with detents.
The specifics mentioned would suggest a potentiometer with 10 detents, such as this one on Amazon, or another on Jameco.
The detents can be low torque (a gentle click at each transition) or high torque (a firm click). The common / inexpensive ones are low-torque, but they seem to survive longer than a few high-torque pots with detents I have used.
More expensive such potentiometers allow individual mechanically adjustable detent torque, even to the extent of mixing high and low torque detents within a single pot (example).
At the high end of the spectrum, some manufacturers offer programmable detent torque: Internally these are essentially like stepper motors integrated with the potentiometer shaft, with the externally controlled coil current determining the holding torque at each detent position. I haven't seen this type available in retail, only through OEM sales by quotation.