শিক্ষা শিয়ে গড়য় া দেি তথ্য-প্রযুক্তির াাংলায়েি
LAB REPORT: 02
COURSE NO.-IRE 212
IoT Architecture and Technologies
07-09-2023
SUBMITTED TO:
Suman Saha
Lecturer
Department of IRE, SUBMITTED BY:
BDU
Koushik Biswas
ID: 2101029
Department of IRE,
BDU
Session: 2021-2022
Page: 01
LAB INTRODUCTION
OBJECTIVE:
Temperature Monitoring and Display Using Arduino and LCD in
Tinkercad.
Software Tool:
Tinkercad
Arduino IDE
Hardware:
Arduino Uno
TMP36 Temperature Sensor
16x2 LCD Display
10kΩ Potentiometer (for contrast control)
Breadboard
Jumper Wires
Power Supply
List of Programs:
Temperature Monitoring and Display Using Arduino and LCD in
Tinkercad.
Page: 02
Problem NO: 01
Theory:
The TMP36 is a low-voltage temperature sensor that provides an output voltage
proportional to the ambient temperature. It gives an analog voltage output that
corresponds to temperature in Celsius, with a linear scale of 10 mV/°C.
The TMP36 sensor provides 750 mV at 25°C. The equation to convert the sensor's
analog output voltage into temperature in Celsius is:
T(°C)=(Vout−50010)T (°C) = \left(\frac{V_{out} - 500}{10}\right)T(°C)=(10Vout−500)
where VoutV_{out}Vout is the voltage measured from the sensor.
Arduino reads the sensor's output as an analog signal (between 0 and 1023,
corresponding to 0 to 5V). By using the analogRead() function, the temperature
can be calculated and displayed on the LCD.
Page: 03
Code in C++:
#include <Adafruit_LiquidCrystal.h>
int temp = 0;
Adafruit_LiquidCrystal lcd_1(0);
void setup()
{
pinMode(A0, INPUT);
Serial.begin(9600);
lcd_1.begin(16, 2);
}
void loop()
{
temp = map(((analogRead(A0) - 20) * 3.04), 0, 1023, -20, 120);
Serial.println(temp);
lcd_1.setCursor(0, 0);
lcd_1.print("Temp. Monitr. system");
lcd_1.setCursor(0, 1);
lcd_1.print("Temp Value=");
lcd_1.setCursor(12, 1);
lcd_1.print(temp);
delay(10); // Delay a little bit to improve simulation performance
}
Procedure:
1. Circuit Setup:
o Connect the TMP36 temperature sensor to the Arduino as per the
circuit diagram.
o Connect the 16x2 LCD to the Arduino using appropriate pins for RS,
E, and data lines (D4-D7).
Page: 04
o Use a 10kΩ potentiometer to adjust the contrast of the LCD.
o Ensure proper connections of power and ground.
2. Programming:
o Open the Arduino IDE, and write the provided code.
o Upload the code to the Arduino board.
3. Simulation:
o Start the simulation in Tinkercad.
o The temperature reading from the TMP36 sensor will be displayed on
the LCD and printed to the Serial Monitor.
4. Observation:
o The TMP36 sensor will detect the surrounding temperature, and the
Arduino will calculate the temperature in Celsius based on the
sensor’s voltage output.
o The temperature will be displayed in real-time on the LCD.
Simulation:
Page: 05
Conclusion:
In this experiment, we successfully built a temperature monitoring system using an
Arduino, TMP36 sensor, and LCD. The TMP36 provided accurate analog
temperature readings, which were converted to Celsius and displayed on the LCD.
The system demonstrated the basics of using analog sensors with Arduino and how
to present sensor data on an LCD.