The tutorial that I used to build the dimmer can be found at:
Pulse Width Modulation is pretty neat. You can use it to vary the brightness of LEDs, change the speed of a DC motor, or even run a Disco Ball at whatever level of partying-hard is required.
Please watch the video for an explanation of using PWM for a few practical uses.
For more DIY fun related to renewable energy and electric vehicles, please visit http://300mpg.org