Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Aqib
Published

Interfacing Nokia 5110 LCD with Arduino

First, we will simply show some data on the screen. In the second example, we will show DHT22 sensor data on the LCD.

BeginnerProtip1 hour77,700
Interfacing Nokia 5110 LCD with Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Nokia 5110 LCD
×1
Multi-Turn Precision Potentiometer- 1k ohms (25 Turn)
Multi-Turn Precision Potentiometer- 1k ohms (25 Turn)
×1
Resistor 10k ohm
Resistor 10k ohm
×4
Resistor 1k ohm
Resistor 1k ohm
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

First Circuit Diagram

Second Circuit Diagram

Code

Second Code

Arduino
#include <PCD8544.h>
#include "DHT.h"
#define DHTPIN 8
#define DHTTYPE DHT22
PCD8544 lcd;
DHT dht(DHTPIN, DHTTYPE);
void setup() {
   lcd.begin(84, 48);
   dht.begin();
}
void loop() {
    lcd.clear();
    float hum = dht.readHumidity();
    float temp = dht.readTemperature();         //Reading the temperature in degrees
    float fah = dht.readTemperature(true);      //Reading the temperature in fahrenheit
    if (isnan(hum) || isnan(temp) || isnan(fah)) {      //Checking if the arduino have recieved the values or not
     lcd.println("Failed to read from DHT sensor!");
     return;
}
  float heat_index = dht.computeHeatIndex(fah, hum);    //Reading the heat index in fahrenheit
  float heat_indexC = dht.convertFtoC(heat_index);      //Reading the heat index in degrees
  lcd.setCursor(0, 0);
  lcd.print("Humi: ");
  lcd.print(hum);
  lcd.print(" %\t");
  lcd.setCursor(0, 1);
  lcd.print("Temp: ");
  lcd.print(temp);
  lcd.print(" *C ");
  lcd.setCursor(0,2);
  lcd.print("Temp: ");
  lcd.print(fah);
  lcd.print(" *F\t");
  lcd.setCursor(0,3);
  lcd.print("Hi: ");
  lcd.print(heat_indexC);
  lcd.print(" *C ");
  lcd.setCursor(0,4);
  lcd.print("Hi: ");
  lcd.print(heat_index);
  lcd.println(" *F ");
  delay(2000);
 }

First Code

Arduino
#include <PCD8544.h>
 PCD8544 lcd;
void setup() {
   lcd.begin(84, 48);
}
void loop() {
  lcd.setCursor(0, 0);
  lcd.print("   WELCOME  ");
  lcd.setCursor(0, 1);
  lcd.print("     To");
  lcd.setCursor(0,2);
  lcd.print("ElectronicsHobbyists.com");
  delay(200);
 }

Github

Credits

Aqib
21 projects • 277 followers

Comments