Arduino with NOKIA 5110 LCD and DHT22 sensor

This post shows how to interface Arduino with NOKIA 5110 LCD and DHT22 (AM2302) digital humidity and temperature sensor. Values of the relative humidity and the temperature are displayed on the Nokia 5110 (Nokia 3310) LCD screen which has a resolution of 84 x 48 pixel.

To see how to interface Arduino with Nokia 5110 LCD, visit the following post:
Interfacing Arduino with Nokia 5110 LCD

And for interfacing Arduino with DHT22 sensor, see the post below:
Arduino with DHT22 sensor and LCD

Arduino with Nokia 5110 LCD and DHT22 sensor

Hardware Required:

  • Arduino board
  • Nokia 5110 (3310) LCD module
  • DHT22 (AM2302, RHT03) sensor   —   datasheet
  • 5 x 3.3k ohm resistor
  • 5 x 2.2k ohm resistor
  • 4.7k ohm resistor
  • Breadboard
  • Jumper wires

Arduino with Nokia 5110 LCD and DHT22 sensor circuit:
Project circuit diagram is shown below.

Arduino Nokia 5110 LCD DHT22 AM2302 sensor circuit

The Nokia 5110 which is shown in the circuit diagram has 8 pins (from left to right): RST (reset), CE (chip enable), DC (or D/C: data/command), Din (data in), Clk (clock), VCC (3.3V), BL (back light) and Gnd (ground).

The Nokia 5110 LCD works with 3.3V only (power supply and control lines). The LCD module is supplied with 3.3V which comes from the Arduino board (VCC pin of the LCD is connected to Arduino 3V3 pin), BL pin is also connected to 3.3V.

All Arduino UNO board output pins are 5V, connecting a 5V pin to the Nokia 5110 LCD may damage its controller circuit.
To connect the Arduino to the LCD module, I used voltage divider for each line which means there are 5 voltage dividers. Each voltage divider consists of 2.2k and 3.3k resistors, this drops the 5V into 3V which is sufficient.

The DHT22 sensor has 4 pins (from left to right):
VCC: connected to Arduino 5V pin
Data pin: connected to Arduino analog pin 0 (A0)
Not connected pin
GND: connected to Arduino GND pin.

Arduino with Nokia 5110 LCD and DHT22 sensor code:
The following Arduino code requires 3 libraries from Adafruit Industries:
The first library is a driver for the Nokia 5110 LCD (PCD8544 controller) which can be installed from Arduino IDE library manager (Sketch —> Include Library —> Manage Libraries …, in the search box write “nokia” and install the one from Adafruit).

The second library is Adafruit graphics library which can be installed also from Arduino IDE library manager.

The third library is for the DHT22 sensor, also it can be installed from the library manager.

The previous 3 libraries can also be installed manually, download links are below:
Adafruit Nokia 5110 LCD library   —->  direct link
Adafruit graphics library             —->  direct link
Adafruit DHT library                  —->   direct link

After the download, go to Arduino IDE —> Sketch —> Include Library —> Add .ZIP Library … and browse for the .zip file (previously downloaded).
The same thing for all library files.

So, the code uses 4 libraries, they are included as shown below:

Rest of code is described through comments!

Full Arduino code:

The following video shows Proteus simulation of the project (note that simulation circuit is not the same as real hardware circuit, hardware circuit diagram is shown above):

Proteus simulation file download link is below, use version 8.6 or later to open it:
Arduino with Nokia 5110 LCD and DHT22 sensor

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.