Arduino clock and temperature monitor using DS3231 and Nokia 5110 LCD

Опубликовано: 29 Октябрь 2024
на канале: Electronics Developer
325
like

-------------------------
📌Introduction
-------------------------
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.

-------------------------
📌Circuit Design
-------------------------
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.

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):
1. RST (reset) pin is connected to Arduino digital pin 3
2. CE (chip enable) pin is connected to Arduino digital pin 4
3. DC (data/command) pin is connected to Arduino digital pin 5
4. DIN (data in) pin is connected to Arduino digital pin 6
5. CLK (clock) pin is connected to Arduino digital pin 7

-------------------------
📌 Tags
-------------------------
#arduino #nokia510 #PCD8544

-------------------------
📌 The 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). 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.Source Code Given In Comment Section

📌 Tune With us so you never miss any update
----------------------------------------------------------------------------------------------------------------------------------------------------------
🏷️Telegram : https://t.me/electronicsdeveloper
🏷️Facebook :   / electronicsdeveloper  
🏷️Instagram :   / electronics_developer  
🏷️Tweeter : https://twitter.com/Electronics_Dev?s=09
🏷️LinkedIn :   / electronics-with-shreyash  
🏷️Pinterest :   / electronics_developer  

Copyright Disclaimer under Section 107 of the copyright act 1976
----------------------------------------------------------------------------------------------------------------------------------------------------------
Copyright Disclaimer under Section 107 of the copyright act 1976, allowance is made for fair use for purposes such as criticism, comment, news reporting, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favour of fair use.

----------------------------------------------------------------------------------------------------------------------------------------------------------
About Electronics Developer : YouTube certified creative essentials and asset monetization
----------------------------------------------------------------------------------------------------------------------------------------------------------