Transducers and signal conditioning Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff Transducers • Convert physical quantity to electrical signal, or vice versa • May need to amplify or offset signal (signal conditioning) • Once it is in the range we want (e.g., 0..5V), we can do analog to digital conversion Microcomputer Architecture and Interfacing Potentiometer – angle measurement Colorado School of Mines Professor William Hoff 2 Transducer Examples • Linear position sensor • VS is the difference between the top secondary voltage and the bottom secondary voltage • When the core is displaced, the sign (phase) of the output voltage determines the direction of the displacement and the amplitude indicates the amount of displacement • Advantages: • Absolute position • Non contact • Linear output over a wide range Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 3 Transducer Examples • Strain gauge – Resistance varies with strain – Can measure force (e.g., bathroom scale) • Wheatstone bridge – Can be used with strain gauge – Measures small changes in resistance – Doesn’t depend on constant voltage source Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 4 Transducer Examples • Thermistor Thermistor – Resistance varies with temperature – Slow response time • Thermocouple – Voltage is generated when temperature different from a reference – Need to know reference temperature • Non-linear relationship to temperature – need calibration or look-up table Thermocouple Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 5 Non-linear Output • Calibrate sensor and use a look-up table • Should interpolate between entries in the table Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 6 Examples • Phototransistor – Light falling on base allows conduction – Acts like a variable current source • Photocell or photoresistor – Cadmium sulfide (CdS) – Light changes resistance – Response can be slow Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 7 Signal Conditioning • May need to offset and scale transducer output to range 0..5V, to match full range of A/D converter • Op-amp circuits can do this • Example VIN + OP AMP R1 VOUT R2 Figure 12.6 A voltage scaler Voltage gain: AV = VOUT VIN = (R1 + R2) R1 = 1 + R2/R1 Microcomputer Architecture and Interfacing Colorado School of Mines • Ideal op amp has infinite input impedance • So current flowing through R2 is the same as the current flowing through R1 • Also, voltage at the two inputs is the same VIN = VOUT R1/ (R1 + R2) Professor William Hoff 8 Example - scaling • Choose appropriate values of R1 and R2 to scale a voltage in the range of 0..200mV to 0..5V VIN + OP AMP R1 VOUT Voltage gain: AV = VOUT VIN = (R1 + R2) R1 = 1 + R2/R1 R2 Figure 12.6 A voltage scaler • We want a gain of (5V)/(200 mV) = 25 • So R2/R1 = 25-1 = 24 • We can use say, R1 = 10 KW and R2 = 240 KW Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 9 Other op-amp circuits • Summing circuit • Inverting voltage follower Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 10 Level shifting and scaling • Example: shift the input voltage from -1.2V..+3.0V to 0V .. 5V • Solution: 0 = – 1.2 (Rf/R1) – (Rf/R2) V1 5 = 3.0 (Rf/R1) – (Rf/R2) V1 We can pick R0 = R1 = 10 KW, R2 = 50 KW, Rf = 12 KW, and V1 = -5V Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 11 Summary / Questions • Sometimes we have to perform signal conditioning to transform the output voltage of a sensor to get it into the range 0..5V. – Why do we want to do that? • Signal conditioning includes amplifying, offsetting, and filtering the signal. • Op amps can be used to do this. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff 12