macsbug

HCMS-2921 LED DISPLAY + DS1302 RTC for Arduino UNO

with 8 comments

HCMS-2921 LED DISPLAY と DS1302 RTC で デジタル時計を作る。   2015.02.20 
  
HCMS-2921:LED駆動用CMOS ICを搭載した高性能ドットマトリクス表示器で連結使用も可能。
DS1302 RTC:リアルタイムクロック。Seconds, Minutes, Hours, Date of the Month, Month,
_ Day of the Week, and Year with Leap-Year の設定と値を取得できる。
Arduino UNO のスケッチは、記事の下に示します。

  


  
用意するもの:
1. HCMS−2921:サンプル。 

2. DS1302 RTC:ebay 1個224円(電池付)。(aitendo=1個395円,電池無し)

3. LED DISPLAY Library: 参考 LedDisplay Library
4. DS1302 RTC virtuabotixRTC Library
5. Arduino UNO。
  


  
配線:
 Arduino LedDisplay Libraryと、HCMS-2921を参照。
 電源と信号5本(data,rs,clock,enable.reset)。

 画像リンクが切れており、再度UPしました。
 少し疑問の配線ですが 過去の記憶をたどりました。
  


  
メモ:
消費電力:320mA。(Arduino UNO+LED+RTC,myDisplay.setBrightness=15)
輝度設定可能:myDisplay.setBrightness(0〜15); 消費電力を下げる事ができる。例:8 -> 220mA。
熱:ディスプレーの表面は暖かい。
DS1302 RTC : RST は、CE と同等の名称です。
Libraryのおかげで、スケッチは短くできました。
Energia MSP430G2 LaunchPad : スケッチは、Pin番号を設定するのみで動作する。
_ LED1列使用時、setBrightness=15 で、190mA, 8で、70mA。
  


  
HCMS-2913 を複数使用する方法:
 HCMS-2913 は 1列の Display です。
 2つ(複数)を結合して使用するには 以下の配線にします。
 最初の DATA OUT を 次の DATA IN に接続します。
 尚、HCMS-2913 は所有していませんので 動作確認はしていません。

 Library は LedDisplay Library を参照します。
 設定の例:LedDisplay myDisplay = LedDisplay(DATA IN, RS, CLOCK, CE, RESET, 16);
  


  
参考:
Arduino:LedDisplay Library。 Arduino:DS1302 Real Time Clock。 GitHub:DS1302 RTC library
fenrir’s memorandum:HCMS-2912を動かす。  Andreas Reinhardt:Teensy 2.0 + HCMS2975
Avago:LED ソリューション。  Digi-key:7413円(20個単位 148261円)
  


  
追記:5X5Matrix 部品情報:2019.01.06。
_ 番号:SCDV5542
_ 名称:SCDV5542 SIEMENS 98+ DIP11
_ 価格:US $ 11.00 。
_ 販売:ebay :chipsgate Store
_ 参照:TINLΞTHΛXSCDV5542 IS WORKING WITH LATEST CODE!
_ 参照:TINLΞTHΛX:NodeMCU X HCMS-2915
  


  
スケッチ:


// HCMS-2921 LED DISPLAY + DS1302 RTC for Arduino UNO       2015.02.20 macsbug
#include <LedDisplay.h>      // https://www.pjrc.com/teensy/td_libs_LedDisplay.html
#include <virtuabotixRTC.h>  // https://www.virtuabotix.com/virtuabotix-ds1302-real-time-clock-module-pin-out-coding-guide/
String year,month,day,hours,minutes,seconds;
LedDisplay myDisplay = LedDisplay(2,3,4,5,6,16);  // dat,reg,clk,ena,rst,dL
virtuabotixRTC myRTC(8,9,10);                     // SCLK,I/O,RST(CE)

void setup() {
 myDisplay.begin();
 myDisplay.setBrightness(8);                      // 0 to 15
 //seconds, minutes, hours, day of the week, day, month, year _ setup
 //myRTC.setDS1302Time(0, 26, 17, 2, 19, 2, 2015);
}

void loop() {
 myRTC.updateTime();
 year    = String(myRTC.year,DEC);  
 month   = st(myRTC.month);
 day     = st(myRTC.dayofmonth);
 hours   = st(myRTC.hours);
 minutes = st(myRTC.minutes);
 seconds = st(myRTC.seconds);
 String t = hours + ":" + minutes + ":" + seconds + year + month + day; 
 myDisplay.home();
 myDisplay.print(t);
}

String st(int data){
 String rt, sp = "";
 if ( data < 10 ){ sp = "0" ;}
 rt = sp + String(data,DEC);
 return rt;
}

Written by macsbug

2月 20, 2015 @ 5:04 am

カテゴリー: Arduino

8件のフィードバック

Subscribe to comments with RSS.

  1. Cool project,Where can you found this display ?

    TinLetHax

    10月 4, 2018 at 5:33 pm

  2. Also same price .

    TinLetHax

    1月 6, 2019 at 2:24 pm

  3. Hi. It’s really amazing project of clock. I want to repeat it but I don’t have two rows indicators. But i have two pieces of the HCMS-2913 (one row) tell me please how it is possible to connect two pieces. Thank you.

    orliansig

    4月 4, 2024 at 6:36 pm

    • An article on how to use multiple HCMS-2913 has been added to the BLOG.
      However, since I do not own HCMS-2913, I have not confirmed its operation.

      macsbug

      4月 5, 2024 at 6:17 pm


コメントを残す