I was clearing out some stuff recently, and came across a box of assorted thumbwheel
switches. These are the sort of things that I'm sure many people hang on to in the 'might
come in useful' pile, and are highly attractive to compulsive button-pushers and
knob-twiddlers like me....!
Many years ago, I'd built a resistance box using these, which has proved to be one of the most useful bits of kit I've ever owned, and still gets used several times a week. This was built using 1-of-10 switches, with a series string of ten equal-value resistors for each decade. However building a capacitance box using 1-of-10 switches is a bit of a non-starter, as you'd need capactiors in values of 1,2,3,4 etc., which are not readily obtainable.
However I noticed that some of these switches were BCD versions, which output a 4-bit binary code corresponding to the switch position. These are much more amenable to building a capacitance box, as you only need cap values of 1,2,4 and 8 for each decade. Although these are also not readily available, you only need 15 equal value caps to make up all four values, and using surface-mount caps, it would be small, quick and cheap to build.
Accuracy won't be brilliant using standard caps, but you rarely need it in practice - you normally just want to dial up a value to select which standard cap value to use in a circuit, and also vary it to check effects of component tolerance. If you do need more accuracy and have an accurate capacitance meter, you can always trim the values, as you only have 4 values per decade to trim. Don't use caps with '5' in the dielectric name (e.g. Y5V), as these have terrible tolerance and temperature characteristics. Use NPO types for the low values and X7R for the higher ones.
Stray capacitance will limit the useful low-end of the range - I used decades of 1uf down to 10pf, hower the capacitance when set to "0.00000" uF is about 80pf, and this must be remembered when using at the low end of the range .
A small PCB with fifteen 1206-size ceramic caps fitted neatly on the back of the switches I used.
The four switch contacts are pinned through and soldered