Devices & Components
Arduino Uno Rev3
Resistor 220 ohm
Alphanumeric LCD, 16 x 2
Rotary potentiometer (generic)
Jumper wires (generic)
Software & Tools
Arduino IDE
Project description
Code
Code
arduino
Paste in arduino IDE.
1#include <LiquidCrystal.h> 2 3LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 4 5int sensorPin = 0; 6 7 8void setup() 9{ 10 lcd.begin(16, 2); 11} 12 13void loop() 14{ 15 16lcd.clear(); 17int reading = analogRead(sensorPin); 18float voltage = reading * 5.0; 19voltage /= 1024.0; 20float temperatureC = (voltage - 0.5) * 100 ; 21float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0; 22lcd.print(temperatureF); 23lcd.println(" degrees F "); 24lcd.setCursor(0,1); 25lcd.print(temperatureC); 26lcd.println(" degrees C "); 27delay(1000); 28 29} 30
Downloadable files
Schematic
Schematic

Schematic
Schematic

Comments
Only logged in users can leave comments