SHT21 sensor data displayed on an LCD

In a previous example we connected a SHT21 temperature and humidity sensor to an Arduino – This was a bit basic as the data was sent via the serial port, so lets add an LCD to display the temperature and humidity readings, there are plenty to choose from but we picked the LCD and keypad shield. Its cheap and cheerful and since there were only 2 readings to worry about and this has 2 lines that should do nicely.

Here is a picture of what you will make, I soldered headers on the LCD keypad shield for connecting to the sensor breakout using dupont type cables, just to make it a bit easier.

SHT21 and LCD Keypad shield

SHT21 and LCD Keypad shield


Needs the SHT21 library installed –

Again most of the work is done in a couple of libraries, the LCD and SHt21 ones so not a great deal of code required for this example

#include <Wire.h>
#include <SHT2x.h>
#include <LiquidCrystal.h>
//setup for the LCD keypad shield
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() 
  // put your setup code here, to run once:
  //line 1 - temperature
  lcd.print("Temp: ");
  //line 2 - humidity
  lcd.print("Humidity: ");
void loop() 
  // put your main code here, to run repeatedly:



Some links to the bits required, you can pick up the sensor for about $7 and the shield for $5 easily. So not too expensive, there are cheaper sensors we’ll cover them later.

Humidity Sensor – SHT21 Breakout Board

1602 LCD Keypad Shield for Arduino Duemilanove UNO MEGA2560 MEGA1280


Another project - this time were building another lux meter, we will use a TSL2561 sensor and display the...