Basic Electronics, Chapter 7: Challenge 1 solution (quantisation and amplifier gain) Formulas: LSB = Vref / 2^N code = floor(Vin / LSB) rms noise = LSB / sqrt(12) SNR = 6.02 N + 1.76 dB non-inverting gain = 1 + Rf/Rg closed-loop gain = A / (1 + A/G) bandwidth = GBW / G summing amplifier: Vout = - Rf x ( V1/R1 + V2/R2 + V3/R3 ) (a) LSB values 10-bit, 5 V: LSB = 5 / 1024 = 4.883 mV 12-bit, 3.3 V: LSB = 3.3 / 4096 = 0.8057 mV 16-bit, 3.3 V: LSB = 3.3 / 65536 = 50.35 microvolts 12-bit converter, Vin = 1.000 V: 1.000 / 0.0008057 = 1241.2 -> code 1241 (the converter truncates) voltage that code stands for = 1241 x 0.8057 mV = 0.99985 V (the step covers 0.99985 V to 1.00066 V, so the reading is 0.15 mV low) rms quantisation noise = 0.8057 mV / sqrt(12) = 0.8057 / 3.464 = 0.233 mV ideal SNR = 6.02 x 12 + 1.76 = 74.0 dB (b) Bridge sensor 0 to 80 mV, Rg = 1 kohm Ideal gain limit: 3.3 V / 0.080 V = 41.25, so Rf / Rg must be 40.25 or less (1 + Rf/Rg <= 41.25). E12 values near Rf = 40.25 k: 39 k (gain 40, output 3.20 V) and 47 k (gain 48, output 3.84 V: too big, the ADC saturates). Choose Rf = 39 kohm: gain = 1 + 39 / 1 = 40 full-scale output = 40 x 0.080 = 3.20 V Sensor-side resolution = 0.8057 mV / 40 = 20.1 microvolts per count (3.2 V of output covers 3971 counts) Exact gain with A = 100,000: b = Rg/(Rf + Rg) = 1/40 gain = A / (1 + A x b) = 100000 / (1 + 100000/40) = 100000 / 2501 = 39.984 (0.04 % below 40: negligible) Bandwidth = GBW / G = 1 MHz / 40 = 25 kHz (the -3 dB frequency) Gain at 10 kHz (single-pole model): 40 / sqrt(1 + (10/25)^2) = 40 / 1.077 = 37.1 (down 7 %, -0.6 dB) Note: any signal faster than a few kilohertz needs less gain per stage or a faster amplifier. (c) Summing amplifier: Rf = 10 k, V1 = 1.0 V through 10 k, V2 = 0.5 V through 20 k, V3 = 2.0 V through 10 k currents into the virtual ground: 1.0 / 10 k = 0.100 mA, 0.5 / 20 k = 0.025 mA, 2.0 / 10 k = 0.200 mA total 0.325 mA Vout = - 10 k x 0.325 mA = - 3.25 V (needs a negative supply: on one supply the stage would saturate at 0 V) Minus the average of three inputs: Vout = - (Rf / R) x (V1 + V2 + V3), so Rf / R = 1/3 for the average. With Rf = 10 k: R = 30 k for all three inputs (30 k is 3 x 10 k in series if you have no 30 k). Check: V1 = 1.0, V2 = 0.5, V3 = 2.0 -> sum 3.5 V -> Vout = - 3.5 / 3 = - 1.17 V. Checklist - Convert the sensor's span to the ADC's span: gain = ADC full scale / sensor full scale, then round DOWN to a standard value. - Gain of the non-inverting stage is 1 + Rf/Rg (not Rf/Rg). - Bandwidth = GBW / gain: check it against the fastest signal. - Sum currents, not voltages, at the virtual ground of the inverting stage.