You are on page 1of 4

labs project

Simple
Function Generator

With reverse-order signal creation


By Michael A. Shustov (Russia) and Andrey M. Shustov (Germany)

PROJECT DECODER In a single instrument, sine, triangular, and rectangular


waveforms are usually generated using R-C charge/discharge
Tags 
function generator, sine, square, triangle, lab,
networks followed by appropriate filters. Alternatively and
analogue, opamp, 741 certainly more fashionably these days, such signals can be
Level
entry level – intermediate level – expert level
synthesized by a microprocessor. The function generator
Time described here follows a conceptually different approach
2 hours approx. and matching circuitry.
Tools
older iron
Cost
€35 approx. A function generator is an instrument that processes, which is especially noticeable
generates more than one waveform of variable when the generator frequency is tuned. In
FEATURES frequency and, optionally, amplitude. This is particular, the distortion of the sinusoidal
a useful device necessary in labs for testing, signal increases accordingly owing to sub
> sine, triangle, tweaking, faultfinding, repairing and tuning optimal filtering of the higher harmonics of
rectangular waveforms electronic devices. a complex signal.
> Reverse-order waveform generation In most function generators of classic design,
> Sinewave ranges 50-500 Hz, a rectangular-pulse generator is used as The other way around
500–5,000 Hz the starting point. Next comes a rectangu- The function generator described below is off
lar-to-triangular voltage converter usually the beaten track in that the converting of signals
> Triangle & squarewave ranges
based on the charge/discharge process. Next, occurs in the reverse order. First, a sinusoidal
100–1000 Hz, 1000–10,000 Hz
the triangular waveform is transformed into waveform is created, which is then converted
> Frequency ranges easily adaptable
a kind of sinewave, usually including good into a triangular waveform. Next, a bipolar
> Low-budget project suppression of the first harmonic. signal of rectangular shape is obtained from
> Through-hole parts only The main disadvantage of this three-step the triangle.
> 100% microcontroller-free process and the associated circuitry is the There are two frequency bands which can be
inherent nonlinearity of the charge-discharge selected by a selector switch. The sinewave

20 July & August 2020 www.elektormagazine.com


signal is generated by an opamp-based
oscillator. The triangular wave is generated
THE CIRCUIT IN MATHS
by converting the sinewave to a triangular The various waveforms that exist in the circuit may be described by the formulae
shape by rectifying and inverting the sinewave given below. Note: UA-G (t) corresponds to node marked by circled letter in circuit
signal. Finally, the squarewave signal is gener- diagram.
ated by a differential comparator.

Circuit description U A (t ) = U0 sin (ωt )


Proceeding from theory to practice, the
schematic of the Simple Function Generator UB (t ) = U0 sin (ωt + 90 )
is shown in Figure 1. The circuit works on a
±5 V (symmetrical) power supply. Opamps UC (t ) = U0 sin ( 2ωt )
IC1.A, IC1.B, and IC1.C form the sinewave oscil-
lator. It actually outputs two sinewaves with UD (t ) = U0 abs ⎡⎣sin (ωt ) ⎤⎦
a 90-degree phase difference. The coverage
of the two frequency bands depends on the UE (t ) = −U0 abs ⎡⎣sin (ωt + 90 ) ⎤⎦
capacitor values C4 and C6 (33 nF) and their
respective counterparts C5 and C7 (3.3 nF). {
UF (t ) = U0 abs ⎡⎣sin (ωt ) ⎤⎦ − abs ⎡⎣sin (ωt + 90 ) ⎤⎦ }
Oscillator feedback is provided by resistor
R24. Preset P1 is used to set the feedback to ⎧⎪−U0 if UF (t ) > 0
a level where a proper sinewave is obtained UG (t ) = ⎨
without clipping the signals. The output ⎪⎩U0 if UF (t ) < 0
frequency of the generator is continuously
adjustable on dual-potentiometer P2 with its
sections P2A and P2B. S1 switches between
the two frequency ranges, assuming equal
capacitance for C4 and C6 on the ‘low’ range, oscillator are fed to two practically identi- but ‘flip’ the clipped part of the waveform to
and C5 and C7 on the ‘high’ range. cal rectifier circuits IC2.A/IC2.B and IC2.D/ the positive and negative side. That is, the
The AOUT and BOUT signals from the sinewave IC2.C which not only rectify the sinewave sinewave is fully rectified above and below

lektor July & August 2020 21


R11
R24 22k
22k D1
R7
P1 2 6
22k D
IC2.A
1 1N4148 IC2.B
7
100k 3 D2 5 R13
C1 R1 R2 R3 R4

22k
22k 22k 22k 22k B OUT
100p 1N4148
R15 F
2 6 9 R8
22k
1 7 8 22k R14
IC1.A IC1.B IC1.C
3 5 10

22k
R5 R6
R12
10k

10k
22k
S1A S1B
A RANGE B RANGE D3 E
R9
13 9
22k
P2B P2A 14 1N4148 8
C6 C7 C4 C5 IC2.D IC2.C
12 D4 10

33n 3n3 33n 3n3


100k 100k 1N4148
R10
C
B 22k
A B OUT
A OUT A OUT
C OUT C OUT

+5V
R20 R22
3k3 P3A
2k2

2
R17 R19 1 K3
P3
1M 1M A OUT 2
R16
13 IC3 47k C OUT 1
22k R18 5
14 3 8 IC4
IC1.D 22k 6 R21 1 7
12 7 2
LM311 22k 5 G
2 6 D OUT 2
741
4 P4 3
1 1
4 C
+5V P4A 4k7 8
3 BIAS
K2
C2 4 4 C3 2
K1 IC1 = LM324
IC1 IC2 1
1 IC2 = LM324
+V 100n 11 11 100n R23
2
0V
3k3

C8
3
–V
100n
–5V
160548 - 11
–5V

Figure 1. Circuit diagram of the Simple Function Generator with labels shown for the main internal signals (refer to maths inset). Unusually the signal
generation order is: sine " triangle " rectangle.

‘zero’. These two rectified waveforms are 90 K3 and K2. The effective range is 1,000 to 8,000 Hz;
degrees out of phase and have double the With S1 set to the Low range (i.e. with C4 and it can be extended upwards slightly by
frequency of the original sinewave signal. The C6 in circuit) the generator covers 50–500 changing C5 and C7 to 2.2 nF.
rectified outputs are added to give signal COUT. Hz for sinewave output, and 100-1,000 Hz for > 500-5,000 Hz for the sinusoidal
This (mathematic) addition conveniently forms triangular and rectangular wave output due waveform; again the effective range is
the triangular wave, albeit of lower amplitude to the doubling of the original frequency. By 500 to 3,500 Hz roughly; upwards of that
than the originating sinewave. modifying the frequency-determining capac- may be achieved by changing C5 and C7
The triangular wave is next converted to itors or adding additional ranges on S1, to 2.2 nF.
squarewave shape by IC1.D (another LM324 frequencies down to sub-Hz can be provided.
opamp) in combination with IC3 (an LM311). When S1 is operated to switch capacitors C5 Building
Preset P4 is used to adjust the bias voltage and C7 into circuit the frequency will rise by a Elektor Labs designed a printed circuit board
on IC4 (a 741) which in turn adjusts the offset factor of 10. With C5 = C7 = 3.3 nF as shown, for the Simple Function Generator. The board
voltage of the squarewave. Finally, preset P3 the range of generated frequencies is: design is pictured in Figure 2 along with the
is used to adjust the amplitude of the square- parts list. Construction should be plain sailing
wave on DOUT. All three output signals are > 1,000–10,000 Hz for the triangular even for relative beginners as all parts are
available on 2-way PCB screw terminal blocks waveform and rectangular waveforms. through-hole, the board is spaciously laid out,

22 July & August 2020 www.elektormagazine.com


COMPONENT LIST
Resistors D1-D4 = 1N4148
R1-R4,R7-R16,R18,R21,R24 = 22kΩ IC1,IC2 = LM324
R5,R6 = 10kΩ IC3 = LM311
and there are no microcontrollers to program. R17,R19 = 1MΩ IC4 = 741 (uA741)
The pinheaders marked P3A and P4A allow R20 = 2.2kΩ
external potentiometers to be connected R22,R23 = 3.3kΩ Miscellaneous
through connecting wires. In that case, omit P1 = 100kΩ trimpot K1 = 3-way PCB screw terminal block,
presets P3 and P4 from the board. P2 = 100kΩ ganged (stereo) potentiometer 3.5mm pitch
P3 = 47kΩ trimpot K2,K3 = 2-way PCB screw terminal block,
Testing P4 = 4.7kΩ trimpot 3.5mm pitch
Assuming you have successfully built the P3A = 2-pin pinheader, 0.1” pitch, vertical
board, the recommended test procedure for Capacitors P4A = 3-pin pinheader, 0.1” pitch, vertical
the project is as follows. C1 = 100pF, 50V, C0G, 5% S1 = DPDT toggle switch, non-illuminated
> Connect the ±5 V (symmetrical) supply C2,C3,C8 = 100nF, ceramic, 50 V, MCFY Series 8-way DIP IC Socket
to connector K1. C4,C6 = 33nF, 100V, SkyCap SR Series, ±10% 14-way DIP IC Socket
> Select the required frequency range Low C5, C7 = 3.3nF, 50V, C0G, 5%
or High on switch S1.
> Connect an oscilloscope to line AOUT on Semiconductors
K3 (sine), and C (GND).
> Adjust P1 to get a sinewave signal that’s
as clean as possible.
> Move the ‘scope input to COUT on K3 and
check the presence of the triangle signal.
> Move the ‘scope input to DOUT on K3 and
check the presence of the rectangular
signal.
> Operate P2 (dual pot) to confirm it
controls the generator output frequency.
> Adjust P3 to set the amplitude of the
signal.
> Adjust P4 to set the rectangular wave
offset voltage.

You’re all set now to apply a sinusoidal, trian-


gular or rectangular, frequency and amplitude
adjustable signal to your equipment and see
on the ‘scope how it responds!
(160548)

Figure 2. Printed circuit board designed for the Simple Function Generator. Note no
SMDs in sight.

4 sale @ elektor.com
> Simple Function Generator PCB,
bare
www.elektor.com/function-generator
> Book: Electronics for All
www.elektor.com/electronic-circuits-for-all
> Book: Analog Circuit Design,
Volume 1
www.elektor.com/analog-circuit-design-1
> Book: Analog Circuit Design,
Volume 2
www.elektor.com/analog-circuit-design-2
> Book: Analog Circuit Design,
Volume 3
www.elektor.com/analog-circuit-design-3

lektor July & August 2020 23

You might also like