15-03-2011, 03:45 PM
P10- Analogue(modified).ppt (Size: 776.5 KB / Downloads: 145)
Interface 8051 with the following Input/Output Devices
Transducer/Sensors
Analogue-to-Digital Conversion (ADC)
Digital-to-Analogue Conversion (DAC)
Digital computer/microcontrollers use binary values, but in the physical world most things is in analog nature (continuous).
Data (such as temperature, pressure, humidity, velocity, voltage) are analog data.
A device called transducer is used to convert the physical quantity to electrical signals (i.e. voltage, current).
Transducer are also referred to as sensors.
Sensors for temperature, velocity, pressure, light, and many other natural quantities can produce an output voltage (or current) which the value is proportional to the quantity being measured.
Then an analog-to-digital converter is used to translate the analog voltage to digital numbers so that microcontroller can read and process them.
Temperature can be converted to electrical signals by thermistor.
Thermistor is a kind of resistor responds to temperature change by changing its resistance.
But its response is not linear, as seen in the Table 10.1 below.
LM34 series are precision integrated-circuit temperature sensors whose output voltage is linearly proportional to Fahrenheit temperature.華氏
LM35 series are precision integrated-circuit temperature sensors whose output voltage is linearly proportional to Celsius temperature.攝氏
They require no external calibration since it is internally calibrated.
Their output voltage changes 10mV for each degree of temperature change.
Need to have some means to convert them into digital signal so that computers can handle
Analog-to-digital converter (ADC) is a device which can convert analogue voltage to digital numbers so that microcontrollers can handle and process the data.
ADC are the most widely used devices for data acquisition
ADC has n-bit resolution, where n can be 8, 12, 16 or even 24 bits.
The higher-resolution ADC provides a smaller step size.
Step size is the smallest change that can be recognized by ADC.
An ADC has a resolution of 8 bits, the range is divided into 2^8=256 steps (from 0 – 255). But there are 255 quantization levels.
1. Make CS = 0 and send a L-to-H pulse to pin WR to start the conversion.
2. Keep monitoring the INTR pin. If INTR is low, the conversion is finished and we can go to the next step. If INTR is high, keep polling until it goes low.
3. After the INTR has become low, we make CS = 0 and send a H-to-L pulse to the RD pin to get the data out of the ADC0804 IC chip.
Example of ADC Application
Temperature detection
A temperature sensor (LM34 or LM35) is interfaced to the 8051 via an ADC (ADC0804)
The output voltage from the LM34/LM35 is linearly proportional to the measuring temperature
The ADC0804 converts the output voltages from the LM34/LM35 into digital signals, which correspond to the measured temperature.
They are then handled by the 8051
The ADC0804 converts the output voltages from the LM35 into digital signals, which correspond to the measured temperature.
Step size of the ADC0804 = (1.28)x(2)/255 = 0.01004V
Clock input to the ADC0804 = clock frequency ¸ 4
If the following data of LM35 are given
the temperature range of the temperature sensor LM35 is -55°C to 150°C and its output scale is 10mV/°C, and
the output value of the ADC0804 is 00H when the LM35 senses -55°C
then the value output from the ADC0804 for a measuring temperature 100 °C is:
Digital-to-Analog (DAC) Conversion
The digital-to-analog converter (DAC) is a device widely used to convert digital values to analog signals.
It does the reverse operation of an ADC
The resolution of DAC depends on the no. of binary bits input to it.
The common ones are 8, 10 and 12 bits.
An 8-input DAC provides 256 discrete voltages (or current) levels of output. (The 12-bit DAC gives 4096 discrete levels).