Basic Electronics, Chapter 8: Challenge 3 solution (the 555 and PWM) Formulas: astable: t_high = 0.693 (R1 + R2) C t_low = 0.693 R2 C f = 1.44 / ((R1 + 2 R2) C) duty = (R1 + R2) / (R1 + 2 R2) monostable: t = 1.1 R C (exactly R C ln 3 = 1.0986 R C) steered PWM (Build 3): Ra = 1 k + p x 100 k, Rb = 1 k + (1 - p) x 100 k, Ra + Rb = 102 k ideal: t_high = 0.693 Ra C, t_low = 0.693 Rb C with 0.5 V diode drops: t_high = 0.887 Ra C, t_low = 0.571 Rb C, D = 0.887 Ra / (0.887 Ra + 0.571 Rb) (a) 1 kHz at 60 % duty, C = 10 nF duty = (R1 + R2) / (R1 + 2 R2) = 0.6 -> R1 + R2 = 0.6 R1 + 1.2 R2 -> 0.4 R1 = 0.2 R2 -> R2 = 2 R1 (so the start is right) f = 1.44 / ((R1 + 4 R1) C) = 1.44 / (5 R1 x 10e-9) = 1000 -> R1 = 1.44 / (5 x 10e-9 x 1000) = 28.8 k E12 values: R1 = 27 k, R2 = 56 k (2 x 27 = 54; 56 is the nearest E12 value) f = 1.44 / ((27 k + 112 k) x 10 nF) = 1.44 / 1.39e-3 = 1036 Hz (using 0.693 exactly: T = 0.693 x 139 k x 10 nF = 963 us, f = 1038 Hz) duty = (27 + 56) / (27 + 112) = 83 / 139 = 59.7 % t_high = 0.693 x 83 k x 10 nF = 575 us t_low = 0.693 x 56 k x 10 nF = 388 us T = 963 us If C is 20 % too large (12 nF): t_high = 0.693 x 83 k x 12 nF = 690 us t_low = 0.693 x 56 k x 12 nF = 466 us T = 1156 us f = 865 Hz The duty is unchanged (59.7 %): the capacitor scales both times equally. Frequency is 14 % low. (b) Monostable, 2 s with C = 10 uF R = t / (1.1 C) = 2 / (1.1 x 10e-6) = 181.8 k. E12 value: 180 k. t = 1.1 x 180 k x 10 uF = 1.98 s (exact ln 3 version: 1.0986 x 180 k x 10 uF = 1.977 s) With a -20 % / +20 % capacitor (8 uF to 12 uF): t = 1.58 s to 2.38 s. Use a film capacitor, or a trimmer in series with R, if the pulse length must be accurate. Remember: the trigger pulse on pin 2 must be shorter than 1.98 s, and pin 2 needs a pull-up so it idles HIGH. (c) PWM motor controller, C = 4.7 nF p = 0.2: Ra = 1 k + 20 k = 21 k, Rb = 1 k + 80 k = 81 k Ideal: T = 0.693 x 102 k x 4.7 nF = 0.332 ms, f = 3.01 kHz, duty = 21 / 102 = 20.6 % average motor voltage = 6 x 0.206 = 1.24 V Corrected: t_high = 0.887 x 21 k x 4.7 nF = 87.5 us t_low = 0.571 x 81 k x 4.7 nF = 217.4 us T = 304.9 us f = 3.28 kHz duty = 87.5 / 304.9 = 28.7 % average motor voltage = 6 x 0.287 = 1.72 V The motor needs 2.0 V average to start: at p = 0.2 it gets only 1.72 V (corrected) and does not turn. p = 0.3: Ra = 31 k, Rb = 71 k Ideal: duty = 31 / 102 = 30.4 % average = 6 x 0.304 = 1.82 V <-- the ideal formula says the motor would still NOT start Corrected: t_high = 0.887 x 31 k x 4.7 nF = 129.2 us t_low = 0.571 x 71 k x 4.7 nF = 190.5 us T = 319.8 us f = 3.13 kHz duty = 129.2 / 319.8 = 40.4 % average = 6 x 0.404 = 2.42 V -> the motor starts (2.42 V is above 2.0 V) So the diode drops move the starting point (2.0 V needs a duty of 33 %) from about p = 0.33 (ideal formula) to about p = 0.24 (real). Finding the starting position by trying the knob is the reliable way; the formulas explain the trend, not the last 5 points. Note the frequency change: 3.28 kHz at p = 0.2 and 3.13 kHz at p = 0.3, against a constant 3.01 kHz ideal: with the diodes the frequency drifts by about 10 % across the knob's travel, but it stays close to 3 kHz and the duty is what changes. Checklist - Duty of the plain 555 astable is always above 50 %: use diodes to go lower. - Both astable times scale with C, so the duty does not change when C is off-tolerance; the frequency does. - Monostable pulse = 1.1 R C: choose R from the target time and the C you have, then check the standard value. - Average motor voltage = duty x supply: compute the duty with the diode correction (0.887 / 0.571 at 5 V), not just the ideal formula.