Lab Final
Lab Final
Instrumentation Lab
SUBJECT CODE : 205302
LAB NO : Final
Marks Obtained
Group Member Group Member Group Member Grup Member
1 2 3 4
NAME Ayesha Zulifqar M Asif Gulzar M Asim Naseem Aqeel Ahmad
REGISTRATION NO 200101059 200101099 200101100 200101057
LAB REPORT Final Final Final Final
PERFORMANCE
TOTAL MARKS
Table of Contents
TABLE OF FIGURES...................................................................................................................... 3
LIST OF TABLES............................................................................................................................ 3
Objectives: ........................................................................................................................................ 4
Theory ............................................................................................................................................... 4
complete circuit setup: .................................................................................................................. 4
Arduino: .................................................................................................................................... 4
LM35 sensor: ............................................................................................................................ 4
16x2 LCD display:.................................................................................................................... 5
Sensor Configuration: ................................................................................................................... 5
Equipment Required: ........................................................................................................................ 5
Procedure .......................................................................................................................................... 6
Observation ....................................................................................................................................... 7
Time versus temperature : ............................................................................................................ 7
Simuations ........................................................................................................................................ 8
CODE ........................................................................................................................................... 9
BONUS QUESTION ...................................................................................................................... 10
BUZZER CODE ......................................................................................................................... 10
TABLE OF FIGURES
Figure 1: Circuit diagram ................................................................................................................. 4
Figure 2: practical Setup ................................................................................................................... 6
Figure 3: Temperature Vs Time graph ............................................................................................. 7
LIST OF TABLES
Table 1: Readings of Experiment ..................................................................................................... 7
Objectives:
Design a temperature monitoring system using Arduino to acquire temperature data from a sensor
and display it on an LCD module.
Theory
COMPLETE CIRCUIT SETUP:
Arduino:
Arduino is an open-source electronics platform that has revolutionized the world of DIY projects
and prototyping. One theory surrounding Arduino is its potential to democratize technology by
empowering individuals to create and innovate without the need for extensive technical knowledge
or resources. With its simple programming language and wide array of compatible components,
Arduino provides a platform for anyone to turn their creative ideas into tangible, functional devices.
Furthermore, Arduino's versatility and affordability make it accessible to a broad range of users,
fostering a collaborative and inclusive community of makers. This theory highlights Arduino's role
in bridging the gap between technology and people, unleashing the potential for widespread
innovation and societal impact.
LM35 sensor:
The LM35 sensor is a popular and widely used temperature sensor in the field of electronics and
embedded systems. It is a precision analog device that provides accurate and reliable temperature
measurements with a linear output voltage proportional to the temperature in Celsius. The LM35
sensor offers several advantages, such as low self-heating, low voltage operation, and a wide
temperature range. Its simplicity and ease of use make it a favorite among hobbyists, students, and
professionals alike for a variety of applications, including temperature monitoring, climate control
systems, industrial automation, and more. In this introduction, we will explore the features, working
principle, and potential applications of the LM35 sensor, shedding light on its importance in
temperature sensing and control.
16x2 LCD display:
The 16x2 LCD display is a widely used alphanumeric display module that provides a simple and
convenient way to display information in various electronic projects. It consists of 16 columns and
2 rows, hence the name "16x2." Each character is made up of a 5x8 dot matrix, allowing for the
display of letters, numbers, symbols, and custom characters.The LCD display utilizes a liquid
crystal technology, which changes the orientation of liquid crystal molecules to control the passage
of light. It requires a backlight to illuminate the characters, making them visible to the user. The
display module also incorporates a controller chip, usually of the HD44780 or equivalent type,
which handles the interface between the microcontroller and the display.
SENSOR CONFIGURATION:
The temperature sensor used in this experiment is LM35. It is a precision IC temperature sensor
with an analog output voltage linearly proportional to the Celsius temperature. The configuration
process for the LM35 sensor involves the following steps:
• Connect the Vcc pin of the LM35 to the 5V pin on the Arduino board.
• Connect the GND pin of the LM35 to the GND pin on the Arduino board.
• Connect the output pin of the LM35 to an analog input pin on the Arduino board.
Equipment Required:
• Arduino Mega.
• Temperature sensor (LM35).
• LCD module (16x2)
• Potentiometer
• 2mm connecting wires
• Resistor
• Bread board
Procedure
Set up the experimental apparatus:
• First of all we define all pins in code. (This includes permenant voltages pins digital and
power pin)
• Next stage is to burn code to arduino.
• Connect the pins to arduino and LM35 sensor and Lcd.
• Ensure that the power supply is connected and set to the desired voltage range(in our
case laptop was power source).
• Note down values of temperature against time when heat source was brought closer to
LM35.
Observation
Sr.No Time(sec) Temperature(○C)
1 0 26.90
2 2 28.90
3 5 31.05
4 8 33.21
5 12 37.15
6 16 40.23
7 19 46.09
Table 1: Readings of Experiment
Simuations
Conclusion
In conclusion, we have designed and implemented a temperature monitoring system using Arduino,
which successfully acquires temperature data from the LM35 sensor and displays it on an LCD
module.
Throughout the experiment, we carefully selected the LM35 sensor due to its high accuracy and
ease of use. We connected the sensor to the Arduino board and utilized its analog input capabilities
to read the temperature values. The Arduino board served as the main control unit for data
acquisition and processing.
To provide a user-friendly interface, we incorporated an LCD module into the system. The LCD
module displayed the temperature readings in a clear and readable format, allowing users to monitor
the temperature in real-time.
During the testing phase, we observed that the system accurately acquired temperature data from
the LM35 sensor. The readings displayed on the LCD module were consistent and aligned with the
actual temperature changes in the environment.
CODE
BONUS QUESTION
In this code, we define the analog input pin sensorPin connected to the sensor and the digital output
pin buzzerPin connected to the buzzer. The threshold variable represents the value at which the
buzzer should be activated.
The setup() function initializes the pins, setting buzzerPin as an output pin and starting the serial
communication for debugging purposes.
In the loop() function, we read the sensor value using analogRead(sensorPin) and store it in the
sensorValue variable. We then print the sensor value to the serial monitor for debugging.
If the sensorValue exceeds the threshold, we activate the buzzer by setting buzzerPin to HIGH.
Otherwise, we deactivate the buzzer by setting buzzerPin to LOW.
Finally, we add a small delay between readings using delay(100) to avoid rapid changes and
stabilize the readings.
BUZZER CODE
const int sensorPin = A0; // Analog input pin for sensor
const int buzzerPin = 8; // Digital output pin for buzzer
void setup() {
pinMode(buzzerPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(sensorPin); // Read the sensor value
Note: due to unavailability of of Buzzer we did not perform practical part of this bonus question!