Basic Electrical & Electronics Engineering — Signal Generator, NEC licence examination syllabus (Nepal Engineering Council).
Waveform Generators: square, triangular and sawtooth
Not everything needs to be a sine. Charging a capacitor with a constant current gives you a ramp.
Sinusoidal oscillators rely on resonance. Non-sinusoidal ones work completely differently — they switch abruptly between two states, charging and discharging a capacitor, which is why they're called relaxation oscillators. The waveform you get depends entirely on how the capacitor charges: exponentially through a resistor, or linearly from a constant-current source.
The astable multivibrator — square waves
T_high = 0.693(R_A + R_B)C, T_low = 0.693 R_B C With RA = 10 kΩ, RB = 10 kΩ, C = 1 µF, f = 48.1 Hz, duty = 66.67 %, Th = 13.86 ms.
Try to get the duty cycle below 50%. You cannot — R_A is always in the charging path and never in the discharging one, so the high time always exceeds the low time. Making R_A tiny approaches 50% and never passes it, which is why a symmetric square wave needs a different arrangement.
Two transistors (or an op-amp with hysteresis) with no stable
state — it flips continuously between HIGH and LOW.
Transistor astable, timing from RC:
T₁ = 0.693 R₁C₁ (time output stays HIGH)
T₂ = 0.693 R₂C₂ (time output stays LOW)
T = T₁ + T₂ f = 1/T
If R₁C₁ = R₂C₂ = RC (symmetric):
T = 1.386 RC f = 0.72/(RC)
Duty cycle = T₁/(T₁ + T₂) × 100%
555 timer in astable mode — the practical version
The industry-standard building block:
T_high = 0.693 (R_A + R_B) C
T_low = 0.693 R_B C
T = 0.693 (R_A + 2R_B) C
f = 1.44 / ((R_A + 2R_B) C)
Duty cycle = (R_A + R_B)/(R_A + 2R_B) × 100%
Note the duty cycle can never be below 50% in this
configuration, because R_A + R_B > R_B always. Getting under
50% needs a diode across R_B.
How each waveform is produced
🔧 Three waveforms, three mechanisms
SquareAbrupt switching between two saturated states. An astable multivibrator, a 555, or an op-amp Schmitt trigger. The RC time constants set how long it dwells in each state.
TriangularIntegrate a square wave. A constant voltage into an integrator gives a constant-slope ramp; when the square flips sign, the ramp reverses. Equal up and down slopes give a symmetric triangle.
SawtoothCharge a capacitor with a constant current (giving a straight ramp, since dV/dt = I/C is constant), then discharge it almost instantly through a switch. The asymmetry between slow rise and fast fall makes the sawtooth shape — which is exactly what sweeps an oscilloscope's beam across the screen.
Why does a constant current give a straight line, while a resistor gives a curve? Through a resistor, the charging current falls as the capacitor voltage rises, since I = (V−v_c)/R. Falling current means a decreasing slope — and that is an exponential, not a ramp. With a constant-current source the current never changes, so dV/dt = I/C stays fixed and the ramp is perfectly linear. That distinction is the whole difference between an RC exponential and a proper sawtooth.
Worked numerical 1 — 555 astable design
Design a 555 astable for 1 kHz with a 60% duty cycle, using C = 100 nF. Find R_A and R_B.
T = 1/f = 1/1000 = 1 ms
From T = 0.693(R_A + 2R_B)C:
1 × 10⁻³ = 0.693 × (R_A + 2R_B) × 100 × 10⁻⁹
R_A + 2R_B = 10⁻³/(0.693 × 10⁻⁷) = 14 430 Ω …(i)
From duty cycle = (R_A + R_B)/(R_A + 2R_B) = 0.60:
R_A + R_B = 0.60 × 14 430 = 8658 Ω …(ii)
Subtract (ii) from (i):
R_B = 14 430 − 8658 = 5772 Ω → use 5.6 kΩ
R_A = 8658 − 5772 = 2886 Ω → use 2.7 kΩ
Verify with standard values (2.7 kΩ, 5.6 kΩ):
R_A + 2R_B = 2700 + 11 200 = 13 900
T = 0.693 × 13 900 × 100n = 0.963 ms → f = 1038 Hz
Duty = (2700+5600)/13 900 = 59.7% ✔
T_high = 0.693 × 8300 × 100n = 0.575 ms
T_low = 0.693 × 5600 × 100n = 0.388 ms
Worked numerical 2 — transistor astable
A symmetric transistor astable has R = 47 kΩ and C = 10 nF in both halves. Find the frequency and the pulse widths.
T₁ = T₂ = 0.693 RC
= 0.693 × 47 000 × 10 × 10⁻⁹
= 0.693 × 4.7 × 10⁻⁴
= 3.257 × 10⁻⁴ s = 0.326 ms
T = T₁ + T₂ = 0.652 ms
f = 1/T = 1534 Hz ≈ 1.53 kHz
Duty cycle = 50% (symmetric by design)
To make it asymmetric — say 25% duty:
need T₁ = 0.25T and T₂ = 0.75T
→ R₁C₁ must be one-third of R₂C₂
e.g. keep C equal and use R₁ = 15 kΩ, R₂ = 47 kΩ:
T₁ = 0.693 × 15k × 10n = 0.104 ms
T₂ = 0.326 ms
Duty = 0.104/0.430 = 24.2% ✔
Worked numerical 3 — sawtooth ramp rate
A sawtooth generator charges a 220 nF capacitor with a constant 2 mA, discharging when it reaches 8 V. Find the ramp time, the frequency (assuming instant discharge), and the slope.
For constant-current charging:
I = C dV/dt → dV/dt = I/C
Slope:
dV/dt = 2 × 10⁻³/(220 × 10⁻⁹)
= 9091 V/s = 9.09 V/ms
Time to ramp from 0 to 8 V:
t = V/(dV/dt) = 8/9091 = 8.8 × 10⁻⁴ s = 0.88 ms
Frequency (ignoring the fast discharge):
f = 1/0.88 ms = 1136 Hz
Alternative route using Q = It = CV:
t = CV/I = (220n × 8)/2m = 1.76µ/2m = 0.88 ms ✔
If instead we charged through a 4 kΩ resistor from 8 V,
the waveform would be a curved exponential with
τ = RC = 4000 × 220n = 0.88 ms — same time constant, but
the shape would be exponential rather than a straight ramp.
That is why oscilloscope timebases use current sources.
💡 Exam angle: the 555 astable formula f = 1.44/((R_A + 2R_B)C) is worth memorising exactly — note the 2R_B, which students routinely write as R_B. For descriptive marks, explain the generation chain (square → integrate → triangle) and why constant-current charging gives a linear ramp while resistive charging gives an exponential. That last point is the conceptual mark examiners look for.
Syllabus points
Square/triangular/sawtooth generators
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.