Usually the best approach to driving strings of LEDs is to use a constant current boost converter.
They make ICs just for that but you can also just use a 555 timer chip.
The attached circuit is driving a string of twenty 3.3V LEDs from a 12V source. It will work for a 9V source as well. It will boost the voltage up to the point necessary to get the current that is 'programmed' by R3.
I'd really like to understand that circuit but I don't know where to start. Would you mind explaining the broad strokes for me?
C1, R1 and R2 setup the 555 for a ~30 kHz square wave.
Each time the 555's output goes high it turns T2 on. This basically brings T2's drain down to 0V. The left-hand side of the inductor is held permanently at 12V, so you have roughly 12V across the inductor, L1. This causes current to flow through the inductor and a magnetic field to build up.
When the 555's output goes low it turns T2 off. This causes the magnetic field built-up in the inductor to collapse. The collapsing magnetic field will cause the current in the inductor to want to keep flowing. If there isn't anywhere that the current can easily flow to then the voltage across the inductor will quickly rise. Since the left-hand side of the inductor is held at 12V, the right-hand side is the node that sees all of the rising voltage. (This also implies the the voltage spike starts at 12V and not 0V. Which is why this circuit can only
boost the voltage.)
Since the current can no longer flow through T2 the voltage rises to the point that the current flows through the diode (SD1). This will cause a charge to be stored on capacitor C2. The more charge that is stored on C2, the higher the voltage across it.
After a dozen cycles or so the voltage stored on C2 is high enough that current will flow through the LEDs. Once this happens the current sense resistor, R3, along with T1, will turn off the 555's output each time that the current exceeds a certain threshold.
The maximum current allowed is determined by how much voltage it takes to turn T1 on. For this particular simulation, the 2N3904 will turn on when there is about 635 mV across its base-emitter junction. Ohm's law says that current flowing through a resistor will cause a voltage drop across the resistor. When enough current flows through the sense resistor (R3) a large enough voltage develops across it that T1 turns on, bringing the 555's
Control pin low.
I'll refer you to the 555 datasheet for an explanation of how the
Control pin works but, basically, like Simon mentioned, you can affect the 555's output with it. In this case it will cause the 555 to keep its output low until the current drops back below the threshold.