This circuit is widespread on the internet. Here is an example. The PWM signal is generated by a 555 chip. The chip drives a MOS-FET transistor that will switch the motor on and off. The 555 is powered from a 7805 regulator. Therefore, the motor DC voltage can be between 8 and 35 V (the circuit can be powered by AC 7...26 V). The maximum current is limited by MOS-FET.
The circuit shown here is designed to be AC powered by a mains transformer. But you can power it from a DC adapter, battery or even a computer power supply if you remove the diode bridge and connect the power lines straight to ground and positive pads, where the output pins of the bridge would otherwise fit.
This is the schematic. Remember that you need to use a power source capable of supplying enough amps for the motor. If you will be using a transformer and a high current motor, change the diode bridge with a suitable one. Also use a MOS-FET with higher current rating.
|DC Motor controller with 555 schematic|
The 7805 regulator doesn't need a heatsink. C4 should have at least 1000 uF and a correct voltage rating depending on the supply voltage. C1 value is not critical. Anything greater than 47 uF will be just fine.
|Output PWM signal at different potentiometer values|
|Motor controller PCB|
Downloads: PCB as PDF.