How can I wire a 9-position switch so that each position turns on one more LED than the one before?
Using a regulated current source to light them, wire the LEDs in series and short out the segment which you want to be dark.







simulate this circuit &ndash; Schematic created using CircuitLab

You can possibly use a buck-boost converter to make the 30V if you don't already have a suitable voltage.

Here's a simple way to build one using a LM2596S module:


Remove the potentiometer and both large capacitors
Connect one of the salvaged capacitors between +in and +out (positive to +in), and fit a 1uF ceramic capacitor where the output capacitor was.
Connect a 100 ohm resistor from the -output to the centre potentiometer terminal.


Modified in this way, it will create a negative voltage on the -out terminals and act as a 12.5mA current sink at the centre potentiometer terminal (with source at +out) if power is applied between +in and +out.







simulate this circuit

or a XL6009 buck-boost module can be modified. this time just remove the potentiometer and add a 100 ohm resistor, connec 3-30V to the nirmal input terminals and connect the LED string to the output and resistor.







simulate this circuit