Arduino Temperature Monitor and Real Time Clock With 3.2" Display

About: I am Nick Koumaris from Sparta, Greece. I'm extremely passionate about electronics, making things and design. I love teaching what I know and sharing my experiences with you. I put out new YouTube videos eve...
More About educ8s »

Dear friends welcome to another tutorial! This is Nick from educ8s.tv and today we are going to see how to develop this real-time clock and temperature monitor! Let’s get started!

A few weeks ago, I tested this 3.2” color TFT display for Arduino with both Arduino Mega and Due. The display works fine, and I built a simple project with it. It is a temperature monitor and a real-time clock. As you can see at the top, we can see the current date and time, we can see the temperature right now, and at the bottom, the Arduino records the minimum and the maximum temperature that it has measured. I also tried to design a basic user interface just with simple shapes. As you can see everything works fine, and it is a very easy and useful project to build. Let’s see how to do it!

The cost of the project is around 24$. You need around 14$ for the Arduino Due, 8$ for the display and about 2$ for the RTC module.

Step 2: The DS3231 Real Time Clock Module

The DS3231 real time clock module is as its name suggest a Real Time Clock. Using its battery it can keep time for years since it has minimal power consumption.

The DS3231 is a low-cost, extremely accurate I2C real-time clock (RTC) with an integrated temperature compensated crystal oscillator (TCXO) and crystal. The device incorporates a battery input, and maintains accurate timekeeping when main power to the device is interrupted. The integration of the crystal resonator enhances the long-term accuracy of the device as well as reduces the piece-part count in a manufacturing line.

The RTC maintains seconds, minutes, hours, day, date, month, and year information. The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with an AM/PM indicator. Two programmable time-of-day alarms and a programmable square-wave output are provided. Address and data are transferred serially through an I2C bidirectional bus.

The cost of the module is extremely low, it costs around 2$ including the battery!

We are going to use it in order to keep time and get temperature readings from it!

Step 3: The 3.2" Color TFT Display (HX8357C or HX8357B)

I always wanted to have a big display for my Arduino projects. So, a few weeks ago I decided to buy this 3.2 Inch color TFT display for Arduino Mega and Arduino Due because the price is so tempting! Less than 10$ for a 3.2’ color TFT display. With that price, you can’t go wrong.

The display has a resolution of 480x320 pixels and has an SD card adapter on the back. I haven’t used SD card functionality so far. I will try to use it in the future. If you look carefully you can see that the display also uses a 3.3V regulator so it works fine with 5V and 3.3V logic levels.

The display comes in two variations. One of them uses the HX8357C controller and the other one the HX8357B controller. Luckily we can use the same library for both of them.

After downloading the library you have to open the User_Setup.h file comment line 13 and uncomment line 14 if the display you have is using the HX8357C driver, like mine.

Step 4: Connecting the Parts

I am going to use the Arduino Due to build this project, although I could use the slightly cheaper but slower Arduino Mega. Arduino Due is much faster than the Arduino Mega and it has a lot of memory, that’s why I prefer it for this project.

At first, we have to connect all the parts together. I am going to use these male headers in order to connect the RTC module to the Arduino DUE.

We need four header pins. Two for power and two for the I2C interface. We bend them like this and we connect one to 3.3V pin of the Arduino Due board, the other to GND, and the other two to SDA and SCL pin of the board. With some female wires, we connect the module to the board. That’s it.

Now we can attach the display to the board. You don’t have to connect these two pins to the Arduino board so I will leave them floating.

Now we are ready to power up the project. As you can see, it works fine! It is that easy! Let’s now go to the computer to see the software side of the project.

Attachments

Step 6: Final Thoughts

As you can see with a few lines of code and with very low cost we can build a very useful project. I am going to work more on this project since it will become an advanced weather station, with more sensors, graphs and wifi capabilities.

Since the Arduino Due is very fast and has a ton of memory I think it is the ideal Arduino board to use. What do you think about this project? How do you want to see it evolve?

Water Contest

Creative Misuse Contest

Metalworking Contest

3 Discussions

I've put the project together again and now I'm having problems with the data displayed.

All I get is a date of: "Monday 165/165 45:165" and the temperature of: "-1.75C, -1.75C, -1.75C. I've tried other DS3231 modules, switched batteries, I've even unplugged the DS module completely and I always get the same readings.