This method can be used for controlling AC power, especially across linear loads such as heaters used in an electric furnace. In this, the microcontroller delivers the output based on interrupt received as the reference for a generation of triggering pulses.
Using these triggering pulses we can drive the optoisolators for triggering the Triac to achieve integral cycle control as per switches which are interfaced with the microcontroller. In place of motor an electric lamp is provided for the observation of its functioning.
Pulse width modulation, better known as PWM, is a modulation technique that allows you to transfer power to the load based on a control signal: when the signal is high, the load will be powered at the maximum available power, when the signal is low, the load will not receive power. Based on the frequency of activation of this signal, and based on the time spent in the high rather than low state (duty cycle), the load will receive more or less power; in this way the energy transferred to the load (the effective value of the voltage) can vary from 0 (always low control) to 100% (always high control). This type of modulation is the most used for power regulation in DC devices (just think of the dimming of LEDs, the control of brushless motors or switching power supplies, so called precisely because the voltage on the load switches continuously).