|

# Frequency and Pulse Width Measurement using microcontroller

## Description

1. Frequency and Pulse Width Measurement using microcontroller
2. Hardware Section
3. Software Section
Contributor:
A. M. Bhatt

The circuit designers and developers needs different measuring equipments like digital multimeter, CRO, DSO, frequency counter, logic analyser etc for testing their circuits. When they are designing any oscillator or PWM generator or they have generated any waveform, there is a need to measure either frequency or time period. Especially in case of PWM generator there is a need to measure frequency, ON & OFF time and the most required thing is duty cycle. And during testing and troubleshooting they have to measure all these parameters again and again.

Now if they are measuring these parameters using CRO then
·         1st they have to calculate no of horizontal divisions for ON period and for OFF period
·         Then multiply it with time/division factor. They will get Ton and Toff
·         Then after making some calculations they will find out frequency and duty cycle
·         And this they have to repeat every time as they change design

So this is tedious and time consuming process. Wrathers then using CRO if they use DSO (digital storage oscilloscope) then all the readouts are available directly. But they have to pay a lot more cost (at lest twice then CRO) for this. Also CRO and DSO are available only in well equipped laboratories because these are not much low cost tools such as digital multimeters. So the hobbyists may not have these tools in their personal home laboratories.

So here I have designed one such circuit that will give you direct readouts of four parameters (1) frequency (2) ON time (3) Off time & (4) duty cycle in a second with almost 99% accuracy. The circuit is very simple, easy to build with fewer components one micro-controller (AT89C51), one LCD and additional components like crystal, capacitors, resistors, transistors etc. some of the features of the circuits are
1.      Measures frequency from 50 Hz to 65 KHz (display it in Hz)
2.      Measures ON and OFF time periods from 25 µs to 65 ms (display it in µs)
3.      Measures and displays duty cycle in percentage
4.      Displays all four parameters on 20×4 LCD panel
5.      Repeat mode of operation to continuously measure all four parameters

So let us see how to build this circuit

## Source Code

.

superb bhatt sir

### Thanks For the nice Code and

Thanks For the nice Code and Hardware

### sir please provide me pcb

sir please provide me pcb payout by tommorrow morning.

### Thanks for this code

Thanks for this code Sir...how can i measure the input frequency upto 1MHz pls send me the code to my mail johnjanece@gmail.com..Thanks in advance

### sir please send me run

sir please send me run circuit video because it's my college sub mission project

### sir please send me code for

sir please send me code for the project

### that was so great!!!! thanks

that was so great!!!! thanks sir.

You are here