As you may know best way to control DC motor speed is to power it with PWM (Pulse Width Modulated) signal. Microcontroller is good at generating PWM signals so Andrian build one using Attiny13 microcontroller. His need was to control 7A 20Volt motor. For this he used n-mosfet IRF540N.
To change PWM duty cycle he used Rotary encoder. As there were couple microcontroller pins left, he used them for LEDs to indicate MAX and MIN speed of motor. Important part of schematic is motor switching transistor. Using diode is necessary part as it takes care of inductive currents. Also there is a capacitor used in parallel of motor to reduce generated noise. So great small circuit to run small DC motors or use a general purpose dimmer for LED stripes.