Addis Ababa University
Addis Ababa Institute of Technology
School of Electrical & Computer Engineering
ECEG- 4501 Microcomputers & Interfacing
Lab4: ARM Based MCU Programming: ADC
Introduction
ADC (Analog to Digital Converter) is a hardware that converts analog signals into digital. It can be
used to acquire signals from analog devices (e.g. from sensors). LPC2148 has two 10-bit ADCs with
8 channels at each ADC. The ADCs have the following features:
Input analog voltage: 0V 3.3V
Output digital value: 0 1023 (10 bits)
The pins associated with ADC in LPC2148 are shown below.
LPC2148
V3A ADC Power Supply (3.3V)
AD0.0 - AD0.7 VSSA ADC Ground
ADC Inputs
AD1.0 - AD1.7 VREF ADC Reference Voltage
The ADC reference voltage determines the range of input analog voltage values. It can be from 0V
to 3.3V. For our purpose VREF = 3.3V.
The digital value read from the ADC is in the range of 0 to 1023 (10-bit ADC). The digital value is
given as:
In this lab you will learn how to read analog value from a temperature sensor and convert the
voltage reading into temperature reading.
For the lab exercise we will use an IC temperature sensor, LM60. The sensor has the following
characteristics:
Linear voltage output of +6.25mV/0C
Offset voltage output of +424mV (It outputs +424mV at 00C, 6.25mV+424mV at 10C, and so
on )
1
Can be supplied with a single +2.7V - +10V power supply
For our exercise the sensor output is connected to AD0.6 input of LPC2148.
The relationship between sensor voltage output and temperature value is given as
( ) ( )
Example sensor output values and corresponding temperature values are given in the following
table.
Sensor Output (Vo) Temperature
(mV) (T) (0C)
424 0
486.5 10
549 20
611.5 30
Task: Digital Thermometer
Using the provided template, write a program that reads the analog output from the
temperature sensor, converts this value into a temperature value in degree centigrade, and
displays the temperature value on an LCD.