In general, there are two ways to control DC motor speed: by varying supply voltage and pulse width modulation (PWM). The first control method is not convenient, especially in digital systems. It requires analog circuitry, and so on. The second motor speed control method is very convenient for digital systems because all control is made using only digital signals.
In the above diagram, you see two signals. The first duty cycle is about t1/T=1/3, and another’s duty cycle would be about t2/T=2/3. And notice the period of signals are the same.
If we apply these signals to the switching transistor, we would get control over effective voltage across the motor:
Where tON-signal on time over one period T.
In this way, you can control motor speed using microcontrollers PWM output, or if you need, you may use a simple control motor PWM schematic constructed using IC555 timer circuit:
Without going too deep into 555 timer’s performance analysis, I can mention that the duty cycle can be changed using potentiometer RV1. The signal period won’t change as the overall resistance between Vcc and 555 pins 6 does not change.