<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>https://arduwiki.com/html/index.php?action=history&amp;feed=atom&amp;title=RTC_Module%28DS1302%29</id>
	<title>RTC Module(DS1302) - 편집 역사</title>
	<link rel="self" type="application/atom+xml" href="https://arduwiki.com/html/index.php?action=history&amp;feed=atom&amp;title=RTC_Module%28DS1302%29"/>
	<link rel="alternate" type="text/html" href="https://arduwiki.com/html/index.php?title=RTC_Module(DS1302)&amp;action=history"/>
	<updated>2026-04-28T21:24:17Z</updated>
	<subtitle>이 문서의 편집 역사</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://arduwiki.com/html/index.php?title=RTC_Module(DS1302)&amp;diff=2304&amp;oldid=prev</id>
		<title>2025년 3월 20일 (목) 11:44에 ArduWiki님의 편집</title>
		<link rel="alternate" type="text/html" href="https://arduwiki.com/html/index.php?title=RTC_Module(DS1302)&amp;diff=2304&amp;oldid=prev"/>
		<updated>2025-03-20T11:44:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ko&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 이전 판&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2025년 3월 20일 (목) 20:44 판&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;1번째 줄:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;1번째 줄:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{#seo:|title=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;아두위키 &lt;/del&gt;: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;아두이노 &lt;/del&gt;RTC &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;모듈&lt;/del&gt;(DS1302) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;가이드&lt;/del&gt;|title_mode=append|keywords=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;아두이노&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;정보과학&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;메이커학습&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;수행평가&lt;/del&gt;, RTC &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;모듈&lt;/del&gt;(DS1302), &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;아두이노 작품&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;캡스톤작품&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;아두이노 예제코드&lt;/del&gt;|description=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;아두이노로 &lt;/del&gt;RTC &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;모듈&lt;/del&gt;(DS1302)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;을 제어하는 방법&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;기본정보&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;회로&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;예제 코드&lt;/del&gt;)&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;을 소개합니다&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;정보과학과 메이커수업에 활용가능합니다&lt;/del&gt;.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{#seo:|title=&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ArduWiki&lt;/ins&gt;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Arduino &lt;/ins&gt;RTC &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Module &lt;/ins&gt;(DS1302) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Guide&lt;/ins&gt;|title_mode=append|keywords=&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Arduino&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Information Science&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Maker Learning&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Performance Evaluation&lt;/ins&gt;, RTC &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Module &lt;/ins&gt;(DS1302), &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Arduino Projects&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Capstone Projects&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Arduino Example Code&lt;/ins&gt;|description=&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Introduces how to control the &lt;/ins&gt;RTC &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Module &lt;/ins&gt;(DS1302) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;with Arduino &lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;basic information&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;circuit&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;example code&lt;/ins&gt;). &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Can be used in Information Science and Maker classes&lt;/ins&gt;.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;File&lt;/del&gt;:Rtc모듈대표이미지.jpg|&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;center&lt;/del&gt;|class=coders100]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;파일&lt;/ins&gt;:Rtc모듈대표이미지.jpg|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;가운데&lt;/ins&gt;|class=coders100]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a module that can remember the time even when it is not connected to a board.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a module that can remember the time even when it is not connected to a board.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key arduwiki:diff::1.12:old-845:rev-2304 --&gt;
&lt;/table&gt;</summary>
		<author><name>ArduWiki</name></author>
	</entry>
	<entry>
		<id>https://arduwiki.com/html/index.php?title=RTC_Module(DS1302)&amp;diff=845&amp;oldid=prev</id>
		<title>ArduWiki: Created page with &quot;{{#seo:|title=아두위키 : 아두이노 RTC 모듈(DS1302) 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, RTC 모듈(DS1302), 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 RTC 모듈(DS1302)을 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}} File:Rtc모듈대표이미지.jpg|center|clas...&quot;</title>
		<link rel="alternate" type="text/html" href="https://arduwiki.com/html/index.php?title=RTC_Module(DS1302)&amp;diff=845&amp;oldid=prev"/>
		<updated>2024-03-24T02:28:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{#seo:|title=아두위키 : 아두이노 RTC 모듈(DS1302) 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, RTC 모듈(DS1302), 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 RTC 모듈(DS1302)을 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}} File:Rtc모듈대표이미지.jpg|center|clas...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;새 문서&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{#seo:|title=아두위키 : 아두이노 RTC 모듈(DS1302) 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, RTC 모듈(DS1302), 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 RTC 모듈(DS1302)을 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}}&lt;br /&gt;
[[File:Rtc모듈대표이미지.jpg|center|class=coders100]]&lt;br /&gt;
This is a module that can remember the time even when it is not connected to a board.&lt;br /&gt;
&lt;br /&gt;
It uses a battery (CR2032).&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Specifications&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
* Operating Voltage: 3.3V ~ 5V&lt;br /&gt;
* Operating Current: 300nA at 2V&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Required Hardware&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
* RTC Module&lt;br /&gt;
* Arduino&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Connections&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |RTC module&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |Arduino&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |VCC&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |5V&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |GND&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |GND&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |CLK&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |D5&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |DAT&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |D4&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |RST&lt;br /&gt;
| colspan=&amp;quot;1&amp;quot; rowspan=&amp;quot;1&amp;quot; |D3&lt;br /&gt;
|}&lt;br /&gt;
[[File:Rtc 회로.png|center|class=coders70]]&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Library&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
This document uses the Rtc by Makuna library for Arduino. [[Arduino Libraries]]&lt;br /&gt;
[[File:Rtc 라이브러리.png|center|class=coders70]]&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Example Code&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
The code stores the time at the moment of compilation. There will be a slight difference when uploaded to the board due to the time taken for the upload (since the board is uploaded after compiling, there is a time discrepancy).&lt;br /&gt;
&lt;br /&gt;
[[File:Rtc 예제1.png|center|class=coders50]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;ThreeWire.h&amp;gt;  &lt;br /&gt;
#include &amp;lt;RtcDS1302.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//--------------------Modified Section-------------------------------&lt;br /&gt;
#define CLK 5     //Specify CLK pin number&lt;br /&gt;
#define DAT 4     //Specify DAT pin number&lt;br /&gt;
#define RST 3     //Specify RST pin number&lt;br /&gt;
&lt;br /&gt;
ThreeWire myWire(DAT,CLK,RST);&lt;br /&gt;
//--------------------------------------------------------------&lt;br /&gt;
RtcDS1302&amp;lt;ThreeWire&amp;gt; Rtc(myWire);&lt;br /&gt;
&lt;br /&gt;
void setup () &lt;br /&gt;
{&lt;br /&gt;
    Serial.begin(57600);&lt;br /&gt;
&lt;br /&gt;
    Serial.print(&amp;quot;compiled: &amp;quot;);&lt;br /&gt;
    Serial.print(__DATE__);&lt;br /&gt;
    Serial.println(__TIME__);&lt;br /&gt;
&lt;br /&gt;
    Rtc.Begin();&lt;br /&gt;
&lt;br /&gt;
    RtcDateTime compiled = RtcDateTime(__DATE__, __TIME__);&lt;br /&gt;
    printDateTime(compiled);&lt;br /&gt;
    Serial.println();&lt;br /&gt;
&lt;br /&gt;
    if (!Rtc.IsDateTimeValid()) &lt;br /&gt;
    {&lt;br /&gt;
        // Common Causes:&lt;br /&gt;
        //    1) first time you ran and the device wasn&amp;#039;t running yet&lt;br /&gt;
        //    2) the battery on the device is low or even missing&lt;br /&gt;
&lt;br /&gt;
        Serial.println(&amp;quot;RTC lost confidence in the DateTime!&amp;quot;);&lt;br /&gt;
        Rtc.SetDateTime(compiled);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (Rtc.GetIsWriteProtected())&lt;br /&gt;
    {&lt;br /&gt;
        Serial.println(&amp;quot;RTC was write protected, enabling writing now&amp;quot;);&lt;br /&gt;
        Rtc.SetIsWriteProtected(false);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!Rtc.GetIsRunning())&lt;br /&gt;
    {&lt;br /&gt;
        Serial.println(&amp;quot;RTC was not actively running, starting now&amp;quot;);&lt;br /&gt;
        Rtc.SetIsRunning(true);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    RtcDateTime now = Rtc.GetDateTime();&lt;br /&gt;
    if (now &amp;lt; compiled) &lt;br /&gt;
    {&lt;br /&gt;
        Serial.println(&amp;quot;RTC is older than compile time!  (Updating DateTime)&amp;quot;);&lt;br /&gt;
        Rtc.SetDateTime(compiled);&lt;br /&gt;
    }&lt;br /&gt;
    else if (now &amp;gt; compiled) &lt;br /&gt;
    {&lt;br /&gt;
        Serial.println(&amp;quot;RTC is newer than compile time. (this is expected)&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    else if (now == compiled) &lt;br /&gt;
    {&lt;br /&gt;
        Serial.println(&amp;quot;RTC is the same as compile time! (not expected but all is fine)&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop () &lt;br /&gt;
{&lt;br /&gt;
    RtcDateTime now = Rtc.GetDateTime();&lt;br /&gt;
&lt;br /&gt;
    printDateTime(now);&lt;br /&gt;
    Serial.println();&lt;br /&gt;
&lt;br /&gt;
    if (!now.IsValid())&lt;br /&gt;
    {&lt;br /&gt;
        // Common Causes:&lt;br /&gt;
        //    1) the battery on the device is low or even missing and the power line was disconnected&lt;br /&gt;
        Serial.println(&amp;quot;RTC lost confidence in the DateTime!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    delay(10000); // ten seconds&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#define countof(a) (sizeof(a) / sizeof(a[0]))&lt;br /&gt;
&lt;br /&gt;
void printDateTime(const RtcDateTime&amp;amp; dt)&lt;br /&gt;
{&lt;br /&gt;
    char datestring[20];&lt;br /&gt;
&lt;br /&gt;
    snprintf_P(datestring, &lt;br /&gt;
            countof(datestring),&lt;br /&gt;
            PSTR(&amp;quot;%02u/%02u/%04u %02u:%02u:%02u&amp;quot;),&lt;br /&gt;
            dt.Month(),&lt;br /&gt;
            dt.Day(),&lt;br /&gt;
            dt.Year(),&lt;br /&gt;
            dt.Hour(),&lt;br /&gt;
            dt.Minute(),&lt;br /&gt;
            dt.Second() );&lt;br /&gt;
    Serial.print(datestring);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Execution Result ===&lt;br /&gt;
[[File:Rtc 실행결과.png|center|class=coders70]]&lt;/div&gt;</summary>
		<author><name>ArduWiki</name></author>
	</entry>
</feed>