LED Current Regulator Schematic

Schematic

The circuit is based on a LM317 variable regulator which maintains a 1.25V reference. The output is not used, but a resistor is placed between the output and the adjust terminal, which is connected to common negative. Thus the input current is controlled by the resistor value, since the adjustment current is low. The resistor has a fixed value in parallel with a potetiometer. This latter is in series with a transistor, allowing the Picaxe microtroller to turn the main current On or Off.
The Picaxe monitors the 1.25 regulator voltage to determine if there is a load connected. This is used to establish timing.