Pulse Width Modulators, also called PWMs, are relatively new in the world of electronics. Before PWMs, usually a variable resistance (a rheostat) was used to control the voltage applied to a motor, bulb, etc. But this was inefficient because energy was wasted.
A PWM solves this problem. With it, you can apply analog voltages using only digital means. Have a look at the signal on the right.
This is the kind of output generated by a PWM. There are two key properties associatedwith a PWM:
The PWM has several uses today. I'll go over two briefly.
A pulse width modulator can be used to control the amount of power that is supplied. And it's as simple as changing the duty cycle.
Say a motor is connected to a PWM. The PWM can be made to generate the following two signal. When will the motor run faster?
Of course, the signal below. It has a greater duty cycle. More power is delivered to the motor. So it will rotate faster. When a PWM's signal is applied to an analog component, it behaves as if an equivalent constant voltage is applied on it. That is, analog components cannot distinguish voltage from a rheostat and a PWM.
No, I'm not talking about talking. I'm talking about sending certain bytes of data from one chip to another. You know how important this is, right? You want faster RAMs, faster processors, lesser "lag" when you click a button. This is where you're trying to increase the speed of communication.
I won't go into extreme details, but here's the idea. You want to send things as "bits". And you also want the other chip to know when you go on to the next bit.
To do this, you need two PWMs. One to indicate when you're going to send the next bit, and one to indicate the actual bits:
The clock maintains the timing. On every rising edge, the next bit is sent out. This way, two chips can talk to each other over 3 wires (one clock, one from chip A to B, and one from chip B to A).
There are two major ways.
Use a microcontroller
Microcontrollers come with physical PWMs. They have actual silicon dedicated to PWMs. So they're quite efficient and easy to use.
Create a circuit You can create your own circuit. Some chips like the 555 timer IC can help you make these pulses easily!
Pulse Width Modulators (PWMs) are extremely useful things. They can control power, help in communication, etc. To create one, you either need a microcontroller or a custom built circuit.