0% found this document useful (0 votes)
17 views3 pages

Lab 8

Uploaded by

Tipu Rehman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Lab 8

Uploaded by

Tipu Rehman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

SHAHEED ZULFIQAR ALI BHUTTO

INSTITUTE OF SCIENCE AND TECHNOLOGY


ISLAMABAD

BSAI-3A
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGES

LAB TASK # 08

BY

TIPU REHMAN
BSAI-3-21108168

PRESENTED TO

MR. RAHEEL AHMED


Analog sensors are used to measure physical quantities such as temperature, pressure, light,
sound, and many others. These sensors produce a continuous voltage output that varies with the
quantity being measured. The interface between an analog sensor and a microcontroller involves
the conversion of the analog signal to a digital signal that can be processed by the
microcontroller. In this lab report, we will discuss the analog sensor interface and its
implementation using a microcontroller.

Analog Sensor Interface:

The analog sensor interface involves the conversion of the continuous voltage output of the
sensor into a digital signal that can be processed by a microcontroller. This conversion is
accomplished using an analog-to-digital converter (ADC) that is built into the microcontroller or
is an external component. The ADC converts the continuous voltage signal to a discrete digital
value by sampling the voltage at regular intervals and quantizing it into a digital value. The
digital value is then processed by the microcontroller to determine the physical quantity being
measured.

Example:
Consider the following circuit diagram:

Analog Sensor Interface Circuit Diagram

In this example, a thermistor is used to measure the temperature. The thermistor is connected to a
voltage divider circuit consisting of a 10kΩ resistor and a 10kΩ thermistor. The voltage across
the thermistor changes with temperature, and the voltage across the 10kΩ resistor is constant.
The voltage at the junction of the thermistor and the resistor is measured by an analog pin of the
microcontroller.

The microcontroller used in this example is an Arduino Uno. The ADC in the Arduino Uno has a
resolution of 10 bits, which means that it can convert the voltage input into 1024 discrete values.
The analogRead() function in the Arduino IDE is used to read the analog input from the
thermistor. The analog value is then converted to a temperature value using a conversion
formula.

The conversion formula used in this example is:


code example
temperature = (analogValue * 5.0 / 1024.0 - 0.5) * 100.0;

The analogValue is the value read from the thermistor using the analogRead() function. The
voltage at the analog pin is converted to a temperature value using the formula. The temperature
value is then displayed on the serial monitor in the Arduino IDE.
Conclusion:
In conclusion, the analog sensor interface is an important aspect of microcontroller-based
systems. Analog sensors provide a continuous voltage output that must be converted to a digital
signal using an ADC. The ADC converts the voltage signal into a digital value that can be
processed by the microcontroller. This conversion process allows microcontrollers to interface
with a wide range of analog sensors and measure physical quantities accurately.

You might also like