Arduino clock and temperature monitor using DS3231 and Nokia 5110 LCD

In the last Arduino project I built a simple real time clock using DS1307 RTC and NOKIA 5110 LCD (link is below) and in this project I’m going to show how to build a real time clock with temperature monitor using Arduino, DS3231 RTC chip and the same LCD display (Nokia 5110).

The DS3231 is more accurate than the DS1307 due to its built-in temperature sensor. It also (the DS3231) keeps time running if the main power source is down. It also uses I2C interface to communicate with the master device which is in this case the Arduino.

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

And to see how to interface Arduino with DS3231 for the first time, take a look at this post:
Arduino and DS3231 real time clock

The link below shows how to interface Arduino with DS1307 RTC and Nokia 5110 LCD:
Arduino clock with NOKIA 5110 LCD and DS1307 RTC

Hardware Required:

  • Arduino board
  • Nokia 5110 LCD screen
  • DS3231 board    —->   DS3231 RTC datasheet
  • 5 x 3.3k ohm resistor
  • 5 x 2.2k ohm resistor
  • 2 x push button
  • 3V coin cell battery
  • Breadboard
  • Jumper wires

Arduino with DS3231 and NOKIA 5110 LCD

Arduino with DS3231 and Nokia 5110 LCD circuit:
The following image shows project circuit schematic diagram.

The two push buttons B1 and B2 are for setting time and date. The two buttons are connected to Arduino pin 9 and pin 8 respectively for B1 and B2.

Arduino Nokia 5110 DS3231 RTC circuit

The Nokia 5110 LCD 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).

This 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 3.3V 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 could damage its controller circuit.
To connect the Arduino to the LCD module and for the LCD safety, 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.

Nokia 5110 LCD pins are connected to Arduino UNO board as follows (each one through voltage divider):
RST (reset) pin is connected to Arduino digital pin 3
CE (chip enable) pin is connected to Arduino digital pin 4
DC (data/command) pin is connected to Arduino digital pin 5
DIN (data in)  pin is connected to Arduino digital pin 6
CLK (clock) pin is connected to Arduino digital pin 7

Arduino with DS3231 and Nokia 5110 LCD code:
The Arduino code below doesn’t use any library for the DS3231 RTC chip.

The following Arduino code requires 2 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 previous 2 libraries can also be installed manually, download links are below:
Adafruit Nokia 5110 LCD library   —->  direct link
Adafruit graphics 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 the other library file.

In the code there are total of 4 libraries, they’re included in the code as follows:

And the two push buttons are defined in the code as shown below:

Full Arduino code:

The following video shows a simple hardware circuit of this project:

and the one below shows Proteus simulation (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 DS3231 RTC

Leave a Comment

Your email address will not be published. Required fields are marked *

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

Scroll to Top