Sie sind auf Seite 1von 6

Function Generator with

Sine, Triangular and Square Wave

Joshua Koppin
BS-ECE Jamalicah Nagamora
Iligan City, Philippines BS-ECE
jchristiankoppin@gmail.com Iligan City, Philippines
njamalicah@gmail.com

Abstract – this document discusses the various


components used in the circuit design of a function
II. FUNCTION GENERATOR OPERATION
generator, the simulation results of the 3 signal
outputs needed. This document was taken from
sources from various sources from the internet. One of the most important attributes of a
periodic waveform is the period — the time required
for the signal to repeat. In electronics, typical periods
I. INTRODUCTION may range from a few milliseconds to less than a
nanosecond. The repetition of the periodic signal can
Function generators (aka FG’s) are widely useful also be described in terms of the frequency — the
in many audio and analog circuits. FG’s are capable number of periods that occur each second. The
of generating Sine, Square and Triangle waveforms. frequency is the inverse of the period, f = T–1. The
But not many electronic hobbyists can afford to buy units of frequency are s–1 or hertz (Hz). Typical
FG for their experimentation purpose. This function frequencies range from a few tens of Hz, as might be
generator circuit will come in handy for those who the case for the low end of the audio range to several
want to build a simple cost effective function billion Hz (GHz), as might be used in communication
generator by their own. systems. Either period or frequency can be used to
A function generator is usually a piece specify the repetition of the waveform. In the power
of electronic test equipment or software used to industry, there is one frequency that is more
generate different types of electrical waveforms over important than any other – 60 Hz, which corresponds
a wide range of frequencies. Some of the most to a period of 16.67 ms.
common waveforms produced by the function The second important attribute is the amplitude
generator are the sine, square and triangular shapes. — the maximum voltage (or current) of the
These waveforms can be either repetitive or single- waveform. Note that amplitude can be specified
shot (which requires an internal or external trigger either in terms of the peak — from 0 to the maximum
source). Integrated circuits used to generate or by peak-to-peak— from the minimum to the
waveforms may also be described as function maximum. Obviously, the peak-topeak amplitude
generator ICs. will be twice the peak amplitude. Sinusoids can also
Although function generators cover both audio be expressed in terms of RMS (root-mean-square)
and RF frequencies, they are usually not suitable for voltage.
applications that need low distortion or stable The function generator can produce any of
frequency signals. When those traits are required, these waveforms. The sinusoid requires that the
other signal generators would be more appropriate. amplitude and frequency (or period) be specified.
Some function generators can be phase-locked to The square wave and ramp wave have more
an external signal source (which may be a frequency parameters that can be used to fine-tune the shape of
reference) or another function generator. the waveforms.
Function generators are used in the development,
test and repair of electronic equipment. For example,
they may be used as a signal source to test amplifiers
or to introduce an error signal into a control loop. BLOCK DIAGRAM
The block diagram shown in figure 1 contains
different types of operational amplifier; integrator,
differentiator and amplifier in producing different
waveforms. The circuit of the function generator also
contains switch choosing a waveform before it is
being amplified.

A. INTEGRATOR

The op-amp integrator is an operational amplifier


circuit that performs the mathematical operation
of integration that is we can cause the output to
respond to changes in the input voltage over time as Figure 2. Operational Amplifier Integrator
the op-amp integrator produces an output voltage
which is proportional to the integral of the input B. COMPARATOR
voltage.
Figure 2 shows the form of integrator. Based on Voltage comparators either use positive
the figure, we can derive the ideal voltage output of feedback or no feedback at all (open-loop mode) to
an integrator. By doing the math, we can obtain the switch its output between two saturated states,
following equation: because in the open-loop mode the amplifiers voltage
gain is basically equal to AVO. Then due to this high
open loop gain, the output from the comparator
swings either fully to its positive supply rail, +Vcc or
fully to its negative supply rail, -Vcc on the
Where ω = 2πƒ and the output voltage Vout is a application of varying input signal which passes
constant 1/RC times the integral of the input some preset threshold value.
voltage Vin with respect to time. The minus sign ( – ) Figure 3 shows the non-inverting configuration
indicates a 180o phase shift because the input signal of a comparator, the reference voltage is connected to
is connected directly to the inverting input terminal the inverting input of the operational amplifier with
of the op-amp. the input signal connected to the non-inverting input.
If we apply a constantly changing input signal To keep things simple, we have assumed that the two
such as a square wave to the input of an integrator resistors forming the potential divider network are
amplifier then the capacitor will charge and discharge equal and: R1 = R2 = R. This will produce a fixed
in response to changes in the input signal. This reference voltage which is one half that of the supply
results in the output signal being that of a triangular voltage, that is Vcc/2, while the input voltage is
waveform whose output is affected by the RC time variable from zero to the supply voltage.
constant of the resistor/capacitor combination
because at higher frequencies, the capacitor has less When VIN is greater than VREF, the op-amp
time to fully charge. comparators output will saturate towards the positive
supply rail, Vcc. When VIN is less than VREF the op-
amp comparators output will change state and
saturate at the negative supply rail, 0v as shown.

Figure 1. Function Generator Block Diagram


output of U1B connects through R2 and R1
Figure 3. Operational Amplifier Comparator (Frequency Adjust pot) to the input U1Ain-. C1
connects from the output of U1A to U1Ain-. This
configuration causes U1A to work as an integrator.
C. SWITCH When the input feeding U1Ain- is less than the
reference voltage, the output of U1A ramps up. The
The 3 waveforms is connected to a switch. It is output of U1A is connected through R5 to input
where a desired waveform is being chosen before it is U1Bin+. When the voltage at U1Bin+ is greater than
being amplified. The switch used in this function the reference voltage at U1Bin-, the output of U1B
generator contains two terminals, the first terminal is goes high. This raises the voltage at U1Bin+ causing
connected to each different operational amplifier that U1B to switch states. Since the output of U1B is
produces specific waveform and the other terminal is higher than the reference voltage at U1Ain+, the
connected to the amplifier. output of U1A begins to ramp down. When the
output of U1A through R5 pulls the input U1Bin+
D. AMPLIFIER lower than U1Bin- reference, U1B output switches
low. This causes U1A to again begin ramping up
After the waveform is chosen, it is then until the output of U1A causes the input U1Bin+ to
amplified. The amplifier for this function generator is go higher than U1Bin-, and the process repeats in an
made of operational amplifier. By changing the oscillating manner.
feedback resistor of the op amp used in this section to The output of U1A is a triangle wave. The
potentiometer, the signal output could be changed output of U1B is a square wave. To produce a
from zero to its maximum voltage. pseudo-sine wave, the output of U1A is connected by
R7 to input U1Cin-. The network of resistors R8 –
R12 and diodes D1 – D8 clip or reduce the gain of
SCHEMATIC DIAGRAM U1C, progressively, as the triangle amplitude
increases. This reduces and rounds off the tip of the
The circuit in figure 4 was built around a Quad triangle wave to produce the pseudo-sine wave.
op amp IC MAX494 which takes less supply for The outputs of U1A, U1B and U1C are
operation. U1A and U1B form a triangle wave, connected through R15, R14, and R13 to the input
square wave oscillator, respectively. U1B has U1Din-. R18 provides the appropriate feedback for
hysteresis provided by R6 to input U1Bin+. The

Figure 4. Function Generator Schematic Diagram


Thus, decreasing the value of either the resistor or
the capacitor would increase the frequency. Figure 5
shows the output of the function generator in
triangular form.

B. Square Wave

The op amp UIB produces square wave. Note that


the op amp in this stage is a comparator and the non-
inverting input is in series with a resistor and the
output of the op amp U1A which produces a
triangular wave which makes the output of U1B a
square wave. A square wave is a non-sinusoidal
periodic waveform , in which the amplitude
alternates at a steady frequency between fixed
minimum and maximum values, with the same
duration at minimum and maximum. The transition
Figure 5. Triangular Wave Output

controlling the output level of U1D. By substituting a


10K pot for R16, the output signal level of U1D
could be adjusted from 0 to Vmax. A selector switch
for S1, S2, and S3 could be used to select the desired
output type of waveform. A selector switch, to select
different values of capacitance for C1 (.1uF, .01uF,
or .001uF), could be added to increase the frequency
range of the function generator.

III. WAVEFORMS
A. Triangular Wave

The op amp U1A is an integrator having a


feedback capacitor of 0.01uF. The output of this op
amp is a triangular wave. The square wave signal is between minimum to maximum is instantaneous for
applied to the inverting input of the opamp. Observe an ideal square wave; this is not realizable in physical
that the inverting input is connected to the output of systems. Square waves are often encountered
the U1B opamp and we know that this produces a in electronics and signal processing. Its stochastic
square wave. Observe also that the frequency adjust counterpart is a two-state trajectory. Figure 6 shows
represented by a potentiometer is found at the the square wave of the function generator.
inverting input of the op amp U1A. Note that
changing the value of capacitor would change the
frequency range of the function generator. This can
be explained by the formula,
1
𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 = 2𝜋𝑅𝐶
CONCLUSION

Different types of operational amplifier could


produce different types of waveform for function
generator. In simulating the circuit in figure 4, we
produced different waveforms – triangular, square
and sinusoidal wave. Observe that the peak to peak
voltage of each waveform is very close with the other
waveforms. Note also that in order to change the
frequency of the function generator, we should
change the value of either the capacitor or the resistor
or both. To have a higher frequency, we should
decrease the value of capacitor and/or resistor and to
have a lower value of frequency, we should increase
the value of capacitor and/or resistor. Thus, the
frequency is inversely proportional with the capacitor
and the resistor. Changing the resistor to
potentiometer would change the amplitude of the
waveforms. Refer to the simulation results for the
average values of V(p-p) and the frequency for the
different waveforms.

REFERENCES
C. Sinusoidal Wave [1] http://www.gadgetronicx.com/function-
generator-circuit-diagram/
A sine wave is a repetitive change or motion
which, when plotted as a graph, has the same shape [2] cnx.org - Using a Basic Function Generator,
as the sine function. The figure shown in figure 7 is 2005-08-21
the sinusoidal wave obtained from the circuit. [3] Bakshi, U. A.; Bakshi, A. V.; Bakshi, K. A.
The output of U1C connected with 4 pairs of (2008).Electronic Measurements and
diodes connected in parallel facing in opposite Instrumentation. Pune, India: Technical
direction with resistor between them would produce a Publications. pp. 3–26,3–27. ISBN 978-81-
sinusoidal wave. The term for the diodes arranged 8431-435-9.
this way is diode wave shaper.
As observed, the diodes come in pair. The diodes
facing downwards are responsible for the positive
cycle of the sinusoidal wave while the diodes in
upward direction is responsible for its negative cycle.
The more pairs of diodes are used, the more precise
the sine wave is.

SIMULATION RESULTS
Figure 7. Sinusoidal Wave Output

Waveform V(p-p) Frequency

Sinusoidal 95.5mV-3.51V 9.17Hz-2.64kHz


Square 198mV-4.11V 13.4Hz-2.61kHz
Triangular 200mV-3.86V 12.2 Hz-2.58kHz

Das könnte Ihnen auch gefallen