2015/04/06

Weekend Project – Arduino Temperature Meter V2

In the last tutorial, I have shown how to make a Temperature Meter which records highest, current, and lowest temperature with Arduino Mini Pro and a DS18B20 temperature probe.

One of the readers suggested me if I could record the highest and lowest temperatures measured into EEEPROM, then I won't lost the highest/lowest temperature once power is down. It's a good idea, but  I thought, it would be a greater idea if I kept both time stamp and high/low temperatures!
(Writing data to EEEPROM tutorial would be in V3....unfortunately...)

 So, I searched Arduino.cc website and found abundant information about DS1302/DS1307 RTC clock modules. Many people mentioned in forums that DS1302/DS1307 are not very precise and tend to draft of few seconds per week/month. However, DS1302 is quite affordable, so I bought 2 pieces from an auction sites and to give it a try. Reference DS1302RTC data at Arduino.cc

Functions added in Temperature V2:
  • Display date/time clock and date of week on top of LCD
  • Realtime display both Celsius and Fahrenheit 
All steps, material, and wiring here are only related DS1302 RTC module. If you want to learn how to build up the entire project, please check previous tutorial for how to wire up LCD, Arduino, and DS18B20 temperature probe from here:  Arduino-Temperature-Tutorial

During the experiment of adding RTC module, I have encountered few issues and got few advises and suggestions from Google+ communities: Google+ discussion

Few notices to share with you:
  • Arduino has internal Time library (Really, I don't know before I started this!)
  • Use the internal clock to count time elapsed 
  • Only update time from RTC module once a day
  • Remove unnecessary delay() commands to ensure every second is displayed




Material Needed: 
  • DS1302 RTC module 
  • Few jumper wires 



DS1302 RTC Module Wiring: 
  • VCC to Arduino VCC
  • GND to Arduino GND
  • CLK to Arduino pin 5
  • DAT to Arduino pin 6
  • RST to Arduino pin 7

Arduino Temperature Meter Schematic V2


Video Demonstration


Code: (TBD)

Copyright Notice:
You are welcome to share this tutorial with others, but you must retain author's name and URL link to this tutorial blog page. It would be a copyright infringement if anyone who just grab the text, photo, and images I made from here and pretend to be the creator!

---------------------------------------------------------------------------------------------

自製 Arduino 溫度測量機 V2


在上一次的教學中, 我已示範過如何用 Arduino + 溫度測量棒 + LCD 來 自製溫度測量機 。
有讀者看到上一個教學後建議我把最高溫及最低溫的資訊記錄到EEEPROM裡,這樣高低溫資訊才不會遺失。 聽起來很不錯,但如果能把時間+高低溫也一起記錄下來, 應會更好。
所以我上網找了Arduino 與時間相關的資訊,也很快的找到了 DS1302/DS1307 RTC 時鐘模組可以記錄時間,而且即使系統斷電時,時鐘模組可以依靠著內建的 2302 水銀電池來維持時間運作。

搜尋資訊的同時,很多人都提到 DS1302/DS1307不是很準確,用一段時間就會慢個幾秒鐘, 但是它相對便宜,所以我就買了兩片DS1302回來試試囉!  請參考 DS1302 RTC 詳細介紹

溫度測量機 V2 新增功能

  • 顯示日期  時間  星期 
  • 顯示攝氏 及 華氏 
這次的的教學主要是以如何加入 DS1302 RTC 模組. 如果你要做一個完整的測量機,請先參考上一篇:  自製溫度測量機

把 DS1302 RTC 模組加入到電路中不難,但是我遇到了一些很奇怪的問題,如只能顯示單數秒之類的。還好 Google+ 社群裡有許多朋友給了我建議及方向,讓我能及時把程式寫好並測試完成 。相關討論 Google+ discussion

使用 DS1302 RTC 主要的注意事項如下:
  • Arduino 有內建 Time 程式庫 (說真的,開始寫程式時,我還真的不知道哩! Orz...)
  • 使用Arduino內建的時鐘來當計時器即可! 
  • 每天只要向 RTC 模組要一次時間來更新 Arduino內建時鐘即可
  • 檢視一下程式中如果用到 delay() 次數及時間長短,它會顯嚮秒數的顯示




所需材料: 
  • DS1302 RTC 時鐘模組 
  • 跳線數根 



DS1302 RTC 模組接線: 
  • VCC to Arduino VCC
  • GND to Arduino GND
  • CLK to Arduino pin 5
  • DAT to Arduino pin 6
  • RST to Arduino pin 7

Arduino 溫度測量機線路圖 V2


影片展示


程式碼: (TBD)

Copyright Notice:
You are welcome to share this tutorial with others, but you must retain author's name and URL link to this tutorial blog page. It would be a copyright infringement if anyone who just grab the text, photo, and images I made from here and pretend to be the creator.

2 comments:

  1. Hello its awesoem project can you share your code if its possible pls.

    ReplyDelete
    Replies
    1. Sure! I just realize that I didn't post the source code here. Will do to soon over the weekend.

      Delete