SENSOR INTERFACING AND SIGNAL CONDITIONING

SECTION 13.3: SENSOR INTERFACING AND SIGNAL CONDITIONING
This section will show how to interface sensors to the microcontroller. We examine some popular temperature sensors and then discuss the issue of signal conditioning. Although we concentrate on temperature sensors, the principles discussed in this section are the same for other types of sensors such as light and pressure sensors.


Temperature sensors
Transducers convert physical data such as temperature, light intensity, flow, and speed to electrical signals. Depending on the transducer, the output produced is in the form of voltage, current, resistance, or capacitance. For example, temperature is converted to electrical signals using a transducer called a thermistor. A thermistor responds to temperature change by changing resistance, but its response is not linear, as seen in Table 13-8.
The complexity associated with writing software for such nonlinear devices has led many manufacturers to market a linear temperature sensor. Simple and widely used linear temperature sensors include the LM34 and LM35 series from National Semiconductor Corp. They are discussed next.
LM34 and LM35 temperature sensors
The sensors of the LM34 series are precision integrated-circuit temperature sensors whose output voltage is linearly proportional to the Fahrenheit temperature. See Table 13-9. The LM34 requires no external calibration since it is internally calibrated. It outputs 10 mV for each degree of Fahrenheit temperature. Table 13-9 is a selection guide for the LM34.







The LM35 series sensors are precision integrated-circuit temperature sensors whose output voltage is linearly proportional to the Celsius (centigrade) temperature. The LM35 requires no external calibration since it is internally calibrated. It outputs 10 mV for each degree of centigrade temperature. Table 13-10 is the selection guide for the LM35. (For further information see www.national.com.)


Table 13-10: LM35 Temperature Sensor Series Selection Guide
Part Temperature Range Accuracy
Output Scale
LM35A -55 C to +150 C +1.0 C
lOmV/C
LM35 -55 C to +150 C +1.5 C
10 mV/C
LM35CA -40 C to +110 C +1.0 C
lOmV/C
LM35C -40 C to +1 IOC +1.5 C
lOmV/C
LM35D 0 C to +100 C +2.0 C
lOmV/C
Note: Temperature range is in degrees Celsius.
Signal conditioning and interfacing the LM35 to the 8051


Signal conditioning is widely used in the world of data acquisition. The most common transducers produce an output in the form of voltage, current, charge, capacitance, and resistance. However, we need to convert these signals to voltage in order to send input to an A-to-D converter. This conversion (modification) is commonly called signal conditioning. Signal conditioning can be a current-to-voltage conversion or a signal amplification. For example, the thermistor changes resistance with temperature. The change of resistance must be translated into voltages in order to be of any use to an ADC. Look at the case of connecting an LM35 to an ADC0848. Since the ADC0848 has 8-bit resolution with a maximum of 256 (28) steps and the LM35 (or LM34) produces 10 mV for every degree of temperature change, we can condition Vin of the ADC0848 to produce a Vout of 2560 mV (2.56 V) for full-scale output. Therefore, in order to produce the full-scale Vout of 2.56 V for the ADC0848, we need to set Vref = 2.56. This makes Vout of the ADC0848 correspond directly to the temperature as monitored by the LM35. See Table 13-11.
Figure 13-21 shows the connection of a temperature sensor to the ADC0848. Notice that we use the LM336-2.5 zener diode to fix the voltage across the 10K pot at 2.5 volts. The use of the LM336-2.5 should overcome any fluctuations in the power supply.








Table 13-11: Temperature vs. Vout for ADC0848


Figure 13-21. 8051 Connection to ADC0848 and Temperature Sensor
Reading and displaying temperature
The following two programs show code for displaying temperature in both Assembly and C. The programs correspond to Figure 13-21.



















SUMMARY

This chapter showed how to interface real-world devices such as DAC chips, ADC chips, and sensors to the 8051. First, we discussed both parallel and serial ADC chips, then described how to interface them to the 8051 and program it in both Assembly and C. Next we explored the DAC chip, and showed how to interface it to the 8051. In the last section we studied sensors. We also discussed the relation between the analog world and a digital device, and described signal conditioning, an essential feature of data acquisition systems.

Next post:

Previous post: