| × | 1 |

## Components and supplies

## About this project

Hi all,

In this project, I want to calculate the duty cycle of the PWM signal with frequency.

For this demo, I chose Arduino pin 5 which generates 980Hz of frequency to self test. So the wiring is very simple. Simply short pin 7 and 5 together.

This is the formula I used:

**Duty Cycle = (Ton/(Ton+Toff))*100;**

I put PulseIn function to get the number of microseconds needed to complete ON and OFF period separately.

Then add ON and OFF and take F = 1/T formula to get the frequency.

That's all!

## Code

## Schematics

## Comments

#### Author

#### Additional contributors

- Nissi Embedded Lab

#### Published on

July 30, 2018#### Members who respect this project

you might like