Both sides previous revisionPrevious revisionNext revision | Previous revision |
en:iot-open:embeddedcommunicationprotocols2:pwm [2023/08/23 13:41] – pczekalski | en:iot-open:embeddedcommunicationprotocols2:pwm [2023/11/23 16:10] (current) – pczekalski |
---|
==== PWM ==== | ====== PWM ====== |
| {{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\ |
The PWM signal controls the energy delivered to the device, usually a DC motor, LED light, bulb, etc. | The PWM signal controls the energy delivered to the device, usually a DC motor, LED light, bulb, etc. |
To control voltage, instead of using inefficient resistance-based voltage dividers (where the remaining part of the voltage is distracted as heat), PWM is based on approximating the energy delivered to the device with periodical switching on and off (HIGH and LOW). Only two voltages are delivered to the device: low (0V) and HIGH (Vcc, e.g. +5V). One can easily observe how PWM works, e.g. when dimming the LED, if recorded with a high fps camera: the LED light flashes with the PWM signal frequency.\\ | To control voltage, instead of using inefficient resistance-based voltage dividers (where the remaining part of the voltage is distracted as heat), PWM is based on approximating the energy delivered to the device with periodical switching on and off (HIGH and LOW). Only two voltages are delivered to the device: low (0V) and HIGH (Vcc, e.g. +5V). One can easily observe how PWM works, e.g. when dimming the LED, if recorded with a high fps camera: the LED light flashes with the PWM signal frequency.\\ |
* 150/256->~117us (58.6%) in image {{ref>pwm3}}, | * 150/256->~117us (58.6%) in image {{ref>pwm3}}, |
* 200/256->~156us (78.1%) in image {{ref>pwm4}}, | * 200/256->~156us (78.1%) in image {{ref>pwm4}}, |
* 250/255->~195us (98%) in image {{ref>pwm5}},. | * 250/255->~195us (98%) in image {{ref>pwm5}}. |
| |
<figure pwm1> | <figure pwm1> |
{{:en:iot-open:embeddedcommunicationprotocols2:pwm_1.png?400|}} | {{ :en:iot-open:embeddedcommunicationprotocols2:pwm_1.png?400 | Visualisation of the 5kHz PWM signal with a duty cycle of 19.5%}} |
<caption>Visualisation of the 5kHz PWM signal with a duty cycle of 19.5%</caption> | <caption>Visualisation of the 5kHz PWM signal with a duty cycle of 19.5%</caption> |
</figure> | </figure> |
| |
<figure pwm2> | <figure pwm2> |
{{:en:iot-open:embeddedcommunicationprotocols2:pwm_2.png?400|}} | {{ :en:iot-open:embeddedcommunicationprotocols2:pwm_2.png?400 | Visualisation of the 5kHz PWM signal with a duty cycle of 28%}} |
<caption>Visualisation of the 5kHz PWM signal with a duty cycle of 28%</caption> | <caption>Visualisation of the 5kHz PWM signal with a duty cycle of 28%</caption> |
</figure> | </figure> |
| |
<figure pwm3> | <figure pwm3> |
{{:en:iot-open:embeddedcommunicationprotocols2:pwm_3.png?400|}} | {{ :en:iot-open:embeddedcommunicationprotocols2:pwm_3.png?400 | Visualisation of the 5kHz PWM signal with a duty cycle of 58.6%}} |
<caption>Visualisation of the 5kHz PWM signal with a duty cycle of 58.6%</caption> | <caption>Visualisation of the 5kHz PWM signal with a duty cycle of 58.6%</caption> |
</figure> | </figure> |
| |
<figure pwm4> | <figure pwm4> |
{{:en:iot-open:embeddedcommunicationprotocols2:pwm_4.png?400|}} | {{ :en:iot-open:embeddedcommunicationprotocols2:pwm_4.png?400 | Visualisation of the 5kHz PWM signal with a duty cycle of 78.1%}} |
<caption>Visualisation of the 5kHz PWM signal with a duty cycle of 78.1%</caption> | <caption>Visualisation of the 5kHz PWM signal with a duty cycle of 78.1%</caption> |
</figure> | </figure> |
| |
<figure pwm5> | <figure pwm5> |
{{:en:iot-open:embeddedcommunicationprotocols2:pwm_5.png?400|}} | {{ :en:iot-open:embeddedcommunicationprotocols2:pwm_5.png?400 | Visualisation of the 5kHz PWM signal with a duty cycle of 98%}} |
<caption>Visualisation of the 5kHz PWM signal with a duty cycle of 98%</caption> | <caption>Visualisation of the 5kHz PWM signal with a duty cycle of 98%</caption> |
</figure> | </figure> |