DAR-ES-SALAAM INSTITUTE OF TECHNOLOGY
DEPARTMENT OF ELCTRONICS AND TELECOMMUNICATION ENGENEERING
NTA LEVEL 8
PROJECT TITLE: DESIGNING OF FREQUENCY COUNTER USING
MICROCONTROLLER FOR DIT STUDENT ELECTRONICS LABORATORY
PROJECT TYPE: DESIGNING / PROBLEM SOLVING
STUDENT NAMES
KIFARU J. MALALE-100602G8393
MICHAEL J. MJATA-100602G8419
CHAPTER ONE
1.0 INTRODUCTION:
A frequency counter is an electronic instrument, or device, that is used for measuring frequency.
Currently, Electronics laboratory for Students uses analogue oscilloscope as an instrument for
measuring frequency, duty cycle and phase angle. This is not an easy task especially to the
students, since the OSCILOSCOPE needs to be recalibrated before measuring. To get frequency
and duty cycle of the signal, there are some mathematical procedures to be done prior before
getting to the final results. These are the tedious tasks to the students or Technicians
1.1.0 Background Information
Frequency counter is a measurement system that is designed to measure frequency in audio
ranges (1Hz to 20 KHz, with a resolution of 0.1Hz). Besides, it can measure Duty cycle for pulse
waveform, phase angle for the sinusoidal waveform. There are four different types of waveform,
whose frequency is to be measured, sinusoidal, triangular, rectangular and saw-tooth waveform.
The basic idea behind measuring frequency, is to transform the incoming waveform to pulses,
then pulses will be counted by the processing block in predefined time interval, and the
frequency will be displayed on the output
Currently, Electronics laboratory for Students uses analogue oscilloscope as an instrument for
measuring frequency, duty cycle and phase angle. This is not an easy task especially to the
students, since the OSCILOSCOPE needs to be recalibrated before measuring. This calls upon
the need for the designing of the alternative instrument that could display the result directly on
the LCD
1.2.0 Problem Statement
Absence of electronic instrument that could measure audio frequency signal, duty cycle,
and be able to show the output directly on the LCD display , has led to the use of
OSCILOSCOPE when measuring . This is not an easy task especially to the students, since the
OSCILOSCOPE needs to be recalibrated before measuring. To get frequency and duty cycle of
the signal, there are some mathematical procedures to be done prior before getting to the final
results. These are the tedious tasks to the students or Technicians
1.3.0 Objectives of the project
The objectives of this project are divided into general objective and specific
objectives.
1.3.1 General objectives.
To design a measurement system that will save time for students and technicians
during their Laboratory demonstrations
1.3.2 Specific Objectives
i. To design a subsystem that will transform sinusoidal, square/ pulses, triangular, and saw-
tooth waveform to pulses before being sent to a processing block for pulse counting.
ii. To design a subsystem that will condition the incoming square waves before being sent to
processing block for duty cycle measurement
1.4.0 Significance of the Project
i. Once the system is ready, it will save time during measurement procedures. Since
procedures are few.
ii. It will completely eliminate mathematical procedures that are done prior before using
an OSCILOSCOPE
iii. No pre-calibrations that are needed before using the system
iv. Almost every students can use the instruments with just few instructions from
technicians
1.5.0 Hypothesis
If the measurement system is developed successfully, then institution will be encouraged to
adopt it, so that to eliminate completely the tedious procedures involved when using
OSCILOSCOPE as the measurement system
CHAPTER TWO
2.0 Existing System
Currently, DIT Students, teachers and Technicians, use Oscilloscopes to measure frequency of
the signal under consideration. Usually, the process involves mathematical manipulations. This
sometimes becomes very tedious.
2.1 Measuring frequency with an Oscilloscope
To measure frequency of a certain electronic signal, the oscilloscope is setup to display a graph
of voltage versus time. The signal to be measured is applied to either the CH1 or the CH2 inputs.
Triggering is set to show a trace on the screen. Then the vertical (VOLTS/DIV) and horizontal
(SEC/DIV) scaling controls are adjusted to show the signal to be measured appropriately on the
screen. With all the knobs in their calibrated position, the instantaneous voltage at any time can
be read directly from the y-axis and the period T (time for one cycle) can be read from the x-axis.
Measurements with the oscilloscope are made by reading the number of divisions on the screen
and multiplying by sweep-time per division over one complete circle.
Consider figure 1 below
Front screen of the Oscilloscope, to get Frequency, we have to calculate the period of the
Waveform displayed above
Sweep-time per division = 1ms / div .
Total number of complete square in one cycle = 4 div.
Period (T) = 4 div * 1ms / div = 4ms .
Therefore, Frequency = 1/ T = 1/ 4ms = 250Hz
Therefore, frequency measured by an oscilloscope is not directly displayed on the front screen of
the oscilloscope; instead, it is obtained by calculations that lead to some errors, especially, for
those who will not be paying attention
2.2 Advantages of the Existing system
It can measure amplitude of the signal
It has ability to identify the kind of waveform under demonstration
2.3 Disadvantages of the Existing system
Calibrations made prior to measurements
There are more than one calibrations, this causes difficulties for the beginners
Frequency of the signal to be measured is not directly shown on the front panel
It takes time for teachers or technicians to teach students on how to use the oscilloscope
It consumes a lot of power
2.4 Proposed System
The proposed system, will be able to measure frequency and duty cycle directly, and display the
output as digits on the LCD, without having mathematical procedures that are done personally
prior before reaching to the final results. When measuring frequency the system will be having a
good resolution of about 0.1 Hz
Block diagram of a proposed system
DC POWER SUPPLY
Amplifier
limiter
Amplitude
shaping
Wave
Clamper
b
Attenuator
Protection
Amplifier
Filter Block
Block
shaping
Wave-
Clamper
Processing block
Displaying Block
Block
Oscillator
DC POWER SUPPLY
Figure 2
2.5.0 Block Diagram Particulars
The device is being divided into three subsystems
Processing block that will act as a central processing system, all activity
such as pulse counting, duty cycle measurement are done in this part
according to the software (programs) instructions given to the processing
block
The upper part of the system from figure 2.
It consists of amplifier, amplitude limiter, wave shaping and clamping block.
This part is mainly responsible for conditioning the square waveform from
the input, so that their amplitude should be detected successfully by the
processing block
The lower part of the system from figure 2
This is mainly consists of amplifier, wave-shaping, filter and a clamper
circuits. This part is mainly responsible for processing the incoming signals
to pulses, where pulses will be counted by the processing block
2.5.1 Protecting subsystem
This part is mainly consisted of two blocks, attenuator block, and protection block
Attenuator block is responsible for reducing the strength (amplitude) of the
incoming signals to a reasonable level to be processed by the system without any
harm to the system
Protection block become effective once the attenuator block is accidentally
damaged due to high voltage or current source connected via the probes
2.5.2 Switching Subsystem
It provides alternative paths to a user, once the user has to choose between
measuring duty cycle, frequency of the signal and switching off the device
2.5.3 Amplifier Block
It sometimes occurs that, the incoming signal has been attenuated to very small
amplitude (in terms of mV), so this signal has to be again amplified to a required
level to be detected by the next blocks
2.5.4 Filtering Block
This block, will allow frequencies from 1Hz to 20 KHz to pass through to the next
blocks while attenuating higher frequencies using an active low pass filter with six
order
2.5.5 Wave Shaping Block
This is a key block whose function is to transform whatever kind of waveform
coming from the input side to the pulse type waveform to be counted by the
processing block
2.5.6 Clamping Block
This block will clamp/ compress the pulse amplitude produced from the wave-
shaping block to vary between 0V to 5V. Since the pulse coming from wave-
shaping block varies between positive amplitude and negative amplitude.
2.5.7 Display Block
This block is responsible for displaying or showing out the final results of what has
been intended to be measured (Whether, frequency, or duty cycle)
2.5.8 Oscillator Block
This part is responsible for producing oscillations, necessary for sustenance of a
processing block; the processing block has its own internal clock, which acts as a
pulse supplier to the central processing block for instruction executions. But
mostly that clock is not so efficiency; therefore it must be supported by an external
oscillator which is more efficiency than internal clock
2.5.9 DC Power Block
This block, is mainly a dual power supply block (+5V and -5V). It is an
independent block which supply DC power to the whole system, so that the system
is active for processing
2.6 Advantages of a proposed system
It is quick for a student to learn on how to use it
No pre-recalibration of an instrument is required prior to measurement
process
Low power is consumed compared to analogue oscilloscope
It is smaller in size
It is a digital instrument, so it is immune to noise compared to analogue
oscilloscope
No mathematical procedures that are done so as to get a result
2.6 Disadvantages of a proposed system
It has no ability to detect what type of waveform during measurement
It is limited to measurement of parameters, it can measure only frequency
and duty cycle of the signal
Z:\microcontrolle\Embedded System Design Using 8031 Microcontrollers.pdf