redflash85
Published

Super Accurate Thermometer

A really accurate temperature display using the BME280 sensor and LCD screen.

IntermediateFull instructions provided245
Super Accurate Thermometer

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×20
Gravity: I2C BME280 Environmental Sensor
DFRobot Gravity: I2C BME280 Environmental Sensor
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematics

Code

Temperature Display Code

C/C++
/*
SG
4/19/22
This is a temperature sensor using the BME_280 and an LCD
connected to the arduino uno. When exposed to different
temperatures, it can figure out the temperature with great
precision. It then diplays that temperature (in celsius)
on the LCD
*/
#include<LiquidCrystal.h>
#include<Adafruit_BME280.h> //gets the necessary libraries
LiquidCrystal lcd(12,11,5,4,3,2);
Adafruit_BME280 bme; //temperature sensor

byte degree_symbol[8] =
{
0b00111,
0b00101,
0b00111,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
//making the degree symbol
};

void setup() {
lcd.begin(16,2);
lcd.createChar(1, degree_symbol);
lcd.setCursor(0,0);
//Writes Digital Thermometer to being with
lcd.print(" Digital ");
lcd.setCursor(0,1);
lcd.print(" Thermometer ");
delay(4000); //writes it for 4 seconds
lcd.clear();
if (!bme.begin(0x76)) { /*if statement used to make sure wires 
  are connected properly, by giving an error*/ 
  lcd.print("Could not find a valid BME280 sensor, check wiring!");
  while (1); 
}
}
void loop() {
lcd.setCursor(0,0);
lcd.print("Temperature in Celsius"); /*prints the quotes
on the first line*/
float temperature = bme.readTemperature();/*gets a celsius
temperature reading*/
lcd.setCursor (5,1);
lcd.print(temperature);//writes the temperature in the center
lcd.write(1);//prints the degree symbol after the temperature
  
}

Credits

redflash85

redflash85

0 projects • 0 followers

Comments