Some attribution is appreciated.
click image to enlarge
Those of you modders, tinkerers, makers at one point or another would have encounter the need to have a finer control of DC motor speed, be it for robotic projects, RC, case mods etc. The simplest, no-brainer approach to that is by adjusting the voltage supply to the motor using a potentiometer. The higher the voltage, the higher the speed and vice versa.
Might be a good option for some cases, but the potentiometer approach doesn't perform too well when a much more stable and refined control is needed.
Pulse Width Modulation (PWM)
Put simply PWM is the process of switching power ON and OFF to a device in pulses at a specific frequency. Same approach used in commercial light dimmers, DC motor speed controller, CPU fan speed controllers and etc.
The fundamentals. Imagine your everyday incandescent light bulb. When you turn the power ON, it doesn't lights up to it's full brightness instantly, instead it will take (approximately) a couple of seconds to do so. Similarly when you turn the power OFF, it will take a couple of seconds for the bulb to die off.
Now, imagine you're able to flick the power switch ON/OFF fast enough. If you can time your ON/OFF flicking just right (of course it's difficult), the light bulb will actually dim instead of flickers.
The ON/OFF cycle is known as the duty cycle. Below are the visual representation of 50%, 80% and 20% duty cycle.
The 555 Timer IC
The 555 timer is arguably one of the most popular IC ever made. There are thousands of resources online if you're interested to delve deeper into the subject. I'm just going to give the simple description directly relevant to the build.
You can get the 555 at any electronics supply store, just ask for 555 IC (or IC tiga lima in Malay) from the auntie and you're set. If you can't seems to find it, check out the Amazon link for 555 timer below.
PIN 1 - Ground
PIN 2 - Trigger
When LOW, it causes the Output pin to go HIGH. Activated when voltage fall
below 1/3 of +V.
PIN 3 - Output
Output is HIGH when Trigger pin is LOW. Output is LOW when Threshold pin is
HIGH. Output is LOW when reset pin is LOW.Output pin is able to source or sink
PIN 4 - Reset
Short to +V when not in use.
PIN 5 - Control Voltage
Grounded through a 0.01uF capacitor when not in use.
PIN 6 - Threshold
When voltage reaches 2/3 of +V, this pin will cause Output to be driven LOW.
PIN 7 - Discharge
Grounded when Output pin goes HIGH.
PIN 8 - +V
How the circuit works
When the circuit is powered up, the C1 capacitor will initially be in a discharged state. Thus, the Trigger (pin 2) will be LOW, driving the Output (pin 3) to go HIGH. Discharge (pin 7) goes HIGH and shorts to ground. The cycle begins.
The HIGH Output will cause C1 capacitor to be charged through the R1 and D1 path. Upon C1 voltage reaching 2/3 of +V, the Threshold (pin 6) will be activated and drive the Output (pin 3) LOW. Discharge (pin 7) goes LOW. The time it takes for C1 to charge depends on the position of R1.
Since Output (pin 3) is now LOW, capacitor C1 will start to discharge through the D2 and R1 path. When the voltage of C1 drops below 1/3 of +V, Trigger (pin 2) will be LOW, driving Output (pin 3) to go HIGH, and Discharge (pin 7) to go HIGH and shorts to ground. The cycle repeats itself.
You've probably noticed by now that the circuit is using Discharge (pin 7) to drive the motor, simply by shorting to ground in each cycle. You can add some amount of protection if you're concerned about back EMF from the motor.
Pin 4 and 5 are not used, and pin 1 is simply tied to ground. The circuit can take between +3v to +18v. The Frequency is around 144Hz. Do note that, doubling the value of C1 will reduce frequency to half, tripling will will reduce frequency to 1/3, and so on.
NOTE: The circuit, as is, can safely pass current of up to 200mA (max) .
1) 555 timer IC - 1
2) 100K variable resistor - 1
3) 1N4148 Diode - 2
4) 100nF capacitor - 2
If all the above seems too much to take in and you feel the need to brush up on you basics in electronics, then I highly recommend the book by Forrest M. Mims below. Regarded by many as the quintessential easy read for electronics beginners. I started my foray in electronics (many year ago) guided by this book and it still proves useful till this very day.
And of course, other electronics read to get your hands dirty in electronics. Enjoy!
So that's it
Any input, comments, suggestions are welcomed.