{"id":33,"date":"2026-02-09T13:06:26","date_gmt":"2026-02-09T06:06:26","guid":{"rendered":"https:\/\/blog.webie.my.id\/?p=33"},"modified":"2026-02-10T09:01:21","modified_gmt":"2026-02-10T02:01:21","slug":"proyek-robotik-6-jam-digital","status":"publish","type":"post","link":"https:\/\/blog.webie.my.id\/?p=33","title":{"rendered":"Proyek Robotik #6: Jam Digital"},"content":{"rendered":"\n<p>Proyek ini adalah jam digital berbasis ESP32 yang menggunakan modul RTC DS1307 untuk melacak waktu secara akurat, serta modul display 4 digit TM1637 untuk menampilkan waktu dalam format HH:MM. Terdapat dua tombol untuk mengatur jam dan menit secara manual.<\/p>\n\n\n\n<p><strong>Cara Kerja:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Saat ESP32 dinyalakan, ia akan membaca waktu dari modul RTC (DS1307).<\/li>\n\n\n\n<li>Waktu (jam dan menit) akan ditampilkan di layar 4 digit TM1637, misalnya 1325 untuk pukul 13:25.<\/li>\n\n\n\n<li>Tombol yang terhubung ke pin GPIO 14 digunakan untuk menambahkan jam, dan tombol di GPIO 27 untuk menambahkan menit.<\/li>\n\n\n\n<li>Setiap penekanan tombol akan mengatur waktu secara real-time ke modul RTC.<\/li>\n\n\n\n<li>RTC menjaga waktu tetap berjalan meski ESP32 dimatikan, selama baterai kancing pada RTC masih aktif.<\/li>\n\n\n\n<li>Tampilan waktu akan diperbarui setiap 1 detik.<\/li>\n<\/ol>\n\n\n\n<p><strong>Komponen yang Digunakan:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1 \u00d7 ESP32<\/li>\n\n\n\n<li>1 x Modul RTC DS1307 (Real Time Clock)<\/li>\n\n\n\n<li>1 x Modul TM1637 4 Digit Display<\/li>\n\n\n\n<li>2 x Push Button<\/li>\n\n\n\n<li>Kabel jumper<\/li>\n\n\n\n<li>1 x Breadboard<\/li>\n\n\n\n<li>1 x Kabel USB (untuk upload dan power)<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"382\" src=\"https:\/\/blog.webie.my.id\/wp-content\/uploads\/2026\/02\/image-5.png\" alt=\"\" class=\"wp-image-34\" srcset=\"https:\/\/blog.webie.my.id\/wp-content\/uploads\/2026\/02\/image-5.png 859w, https:\/\/blog.webie.my.id\/wp-content\/uploads\/2026\/02\/image-5-300x133.png 300w, https:\/\/blog.webie.my.id\/wp-content\/uploads\/2026\/02\/image-5-768x342.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><\/figure>\n\n\n\n<p><strong>Kode:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;Wire.h>\n#include &lt;TM1637Display.h>\n#include &lt;RTClib.h>\n\nRTC_DS1307 rtc;\nTM1637Display display(18, 19);\n\n\/\/ Pin tombol\nconst int buttonHourPin = 14;\nconst int buttonMinutePin = 27;\n\nint hour, minute, second;\nbool setMode = false;\n\nvoid setup() {\n  Serial.begin(115200);\n  Wire.begin();\n  \n  if (!rtc.begin()) {\n    Serial.println(\"RTC tidak terdeteksi!\");\n    while (1);\n  }\n  if (!rtc.isrunning()) {\n    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n  }\n\n  display.setBrightness(0x0f);  \/\/ Set kecerahan display maksimal\n\n  pinMode(buttonHourPin, INPUT_PULLUP);\n  pinMode(buttonMinutePin, INPUT_PULLUP);\n}\n\nvoid loop() {\n  DateTime now = rtc.now();\n\n  hour = now.hour();\n  minute = now.minute();\n  second = now.second();\n  \n  display.showNumberDecEx(hour * 100 + minute, 0b01000000, true);\n\n  \/\/ Pengaturan jam\n  if (digitalRead(buttonHourPin) == LOW) {\n    delay(200);\n    hour = (hour + 1) % 24;\n    rtc.adjust(DateTime(now.year(), now.month(), now.day(), hour, minute, 0));\n  }\n\n  \/\/ Pengaturan menit\n  if (digitalRead(buttonMinutePin) == LOW) {\n    delay(200);\n    minute = (minute + 1) % 60;\n    rtc.adjust(DateTime(now.year(), now.month(), now.day(), hour, minute, 0));\n  }\n\n  delay(1000); \/\/ Update setiap detik\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Proyek ini adalah jam digital berbasis ESP32 yang menggunakan modul RTC DS1307 untuk melacak waktu secara akurat, serta modul display 4 digit TM1637 untuk menampilkan waktu dalam format HH:MM. Terdapat dua tombol untuk mengatur jam dan menit secara manual. Cara Kerja: Komponen yang Digunakan: Kode:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[5,3],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-esp32","category-robotik"],"_links":{"self":[{"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":1,"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":35,"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions\/35"}],"wp:attachment":[{"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.webie.my.id\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}