Unit 2 - Microprocessor
Unit 2 - Microprocessor
MICROCONTROLLER 8051
Measurement of DC Voltage
• The dc voltage is applied to the peak detector circuit to detect the peak value of dc voltage when the dc
voltage varies instantaneously. Usually, the average and rms values of input voltage are directly
proportional to peak of dc voltage.
• When input voltage is positive, output of the operational amplifier drives the diode D, and the capacitor C
will be charged to the positive peak value of dc input voltage. In this circuit, when the diode D is forward
bias, operational amplifier operates as a voltage follower.
• If input voltage becomes negative, the diode D is reverse biased and voltage across the capacitor C will be
retained as the capacitor discharges through resistance RL only.
• For satisfactory operation of peak detector circuit, the charging and discharging time constant must follow
the given condition.
CRD ≤ CRL
where,
CRD – charging time constant, CRL – discharging time constant, RD – resistance of forward bias diode,
RL – load resistance
• The output of the peak detector circuit is fed to the A/D converter. Subsequently, analog dc voltage is applied
to the analog input terminal of the A/D converter. The output of the A/D converter is digital equivalent to the
analog input voltage. The outputs of the A/D converter are connected to the I/O ports of 8255 and the
microprocessor can read this digital output of ADC through 8255 and transfer the digital data to the
accumulator. ADC interfacing with 8255 and the microprocessor is illustrated in below Fig.
• In this Measurement of Electrical Quantities section,
the program for dc voltage measurement in the range
of 0 to 5 V has been incorporated and displayed in the
mV range. Therefore, 0000 will be displayed for 0 V
and similarly 5000 will be displayed at 5 V dc input
voltage. While writing the program, the given steps are
followed for dc voltage measurement:
Convert analog input voltage into digital form and store
in memory location
Find the memory location of the look-up table where the
calibrated data of digital equivalent voltage is stored. The
address is calculated from the following expressions.
Actual address = Hex code of analog input
voltage x 2 + Initial address
Call data stored in the two consecutive memory locations
and display in the address field of the microprocessor kit
or in the seven-segment display.
• To measure 0 to 5 V dc, the A/D converter IC operates in unipolar mode and the digital equivalent value of 0-5 V
will be 00H to 80H.
• 00H is equivalent to 0 V and 80H is equivalent to 5 V.
• When an analog input voltage is converted to a digital equivalent by the A/D converter then the microprocessor
reads a digital equivalent voltage.
• The look-up table or multiplication factor will be used for calibration of digital equivalent voltage to display. The
resolution of 8-bit 0-5 V ADC is 20 mV.
• Then relationship between analog input voltage and hex output is
• Platinum wires are frequently used in resistance thermometers for industrial application because of their
greater resolution, and mechanical and electrical stability as compared to copper or nickel wires.
• A change in temperature causes a change in resistance.
• The resistance thermometer is placed in an arm of a Wheatstone bridge to get a voltage proportional to
temperature.
• A thermistor is a semiconductor device fabricated from a sintered mixture of metal alloys, having a large
negative temperature coefficient.
• The thermistor is a thermally sensitive variable resistor made of semiconductor material. The substance used
may be oxides of nickel, copper, manganese, iron, cobalt, etc., usually a high negative temperature coefficient. It
can be used in the range of -100 to +100° C for greater accuracy as compared to a platinum resistance
thermometer.
• Positive thermistors are also used but in the low range of 50°C to + 100°C.
• In Industry, the most widely used temperature transducer is
the thermocouple.
• This temperature transducer works on the principle that
contact potential between two dissimilar metals changes
with temperature. When two dissimilar metals are joined and
the junctions are placed at two different temperatures, an emf
is induced which will be used for temperature measurement.
• A thermocouple– is used as a sensor for temperature
measurement. The output of a thermocouple is directly
proportional to the furnace temperature, which is in millivolt
range.
• As output voltage is not in a measurable condition, it must be amplified using an instrumentation amplifier.
• The amplified voltage is applied to an A/D converter.
• The microprocessor sends a start of conversion signal to the A/D converter through the port of 8255 PPI. When
an A/D converter completes conversion, it sends an end-of-conversional signal to the microprocessor. Having
received an end-of-conversion signal from the A/D converter, the microprocessor reads the output of the A/D
converter, which is a digital quantity proportional to the temperature to be measured.
• Then the microprocessor displays the measured temperature.
Strain Measurement
• Strain is the change in shape of an object due to some force. Assume an object in two conditions: with and without a
force applied. When an external force is applied along a dimension, there will be some deformation in the object.
• Let L1 be the length of the object along the dimension when no force is applied and L2 be the length when the
force is applied. Then the object’s strain is