Arduino board
USB Cable
LM 34, temperature sensor
Wires
Procedure:
a. Temperature Sensor
LM34 is a 3-pin device with 5V and GND inputs and temperature output. The LM34 is designed
to output 10 mV per degree Fahrenheit, so a reading of 0.73 V on the output pin means the
temperature is 73F. In order to use this on your Arduino you will have to connect the 5V and
GND pins to the corresponding buses on your Arduino, and wire the output pin to an analog
input pin.
Page 1 of 4
b. Display temperature
In order to display the measured temperature values you will have to wire the 16x2 LCD display
(Figure 4) to 6 Digital Output pins of the Arduino board.
Wire the pins according to the following assignments:
LCD
7 8 9 10 11 12 13 14 15
Arduino
GND +5V GND 12 GND 11 Board
16
+5V GND
Page 2 of 4
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Temp (deg. F)");
// initialize serial communication:
Serial.begin(9600);
}
void loop() {
lcd.clear();
// get temperature
sensorVal = (analogRead(sensorPin)/1023.0)*5.0;
tempVal = sensorVal*100.0;
Page 3 of 4
delay(100);
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.print("Temp (deg. F):");
lcd.setCursor(0, 1);
lcd.print(tempVal);
delay(1000); //0.5sec
}
d. Questions:
i.
ii.
iii.
Explain how is temperature data acquired from the sensor using the Arduino board?
What are the maximum and minimum values of temperature you can measure using
the Arduino board?
Can you display the temperature in oC and K?
Page 4 of 4