{"id":25393733,"url":"https://github.com/octaprog7/librtc","last_synced_at":"2026-04-30T06:40:29.364Z","repository":{"id":277692461,"uuid":"896792845","full_name":"octaprog7/libRTC","owner":"octaprog7","description":"A library for MicroPython that allows you to control a real-time clock (RTC). DS3231, PCF8563.","archived":false,"fork":false,"pushed_at":"2025-02-15T13:02:54.000Z","size":3937,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T13:35:24.595Z","etag":null,"topics":["i2c","micropython","rtc","time"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octaprog7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-01T10:22:01.000Z","updated_at":"2025-02-15T13:02:58.000Z","dependencies_parsed_at":"2025-02-15T13:35:27.055Z","dependency_job_id":"603c24db-0b49-4d25-9288-41a60ef9c596","html_url":"https://github.com/octaprog7/libRTC","commit_stats":null,"previous_names":["octaprog7/librtc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octaprog7%2FlibRTC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octaprog7%2FlibRTC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octaprog7%2FlibRTC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octaprog7%2FlibRTC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octaprog7","download_url":"https://codeload.github.com/octaprog7/libRTC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144583,"owners_count":21054952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i2c","micropython","rtc","time"],"created_at":"2025-02-15T18:34:33.771Z","updated_at":"2026-04-30T06:40:29.331Z","avatar_url":"https://github.com/octaprog7.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libRTC\nA library for MicroPython that allows you to control a real-time clock (RTC).\nCurrently contains ds3231mod, PCF8563mod modules for controlling the DS3231 and PCF8563 RTCs respectively.\n\n## Preparation\nSimply connect the board with the RTC to an Arduino, ESP or any other board with MicroPython firmware.\nConnection pins:\n\n1. VCC\n2. GND\n3. SDA\n4. SCL\n\nAttention! The DS3231 supply voltage is 3.3V or 5V! If you are using a CR2032 Li-Ion backup battery, \npower the DS3231 board only from 3.3V! If the supply voltage is greater than 3.3 V, \nthe CR2032 Li-Ion battery will eventually become unusable due to the charging circuit located on the board.\n\nLoad the MicroPython firmware into the NANO board (ESP, etc.), and then the files: main.py, ds3231mod.py, PCF8563mod.py and\nthe entire sensor_pack_2 folder. Then open main.py in your IDE and run it.\n\n## Selecting RTC in the program code\nSet clock_ds3231 to 0 if you have a board with DS3231.\nSet clock_ds3231 to 1 if you have a board with PCF8563.\n\n# Control interface\nDescribed by methods of the IRTC, IRTCwAlarms classes. Naturally, there are also unique methods.\n\n# Accuracy of the clock 'running'\nDepends on:\n* the quality of the quartz resonator.\n* fluctuations in ambient temperature.\n* the age of the quartz crystal - over time, the resonant frequency decreases slightly.\n\nP.S. Don't forget about the 'quality' of the voltage supplying the RTC!\n\n## For soldering enthusiasts\n* in the folder hardware/rtc_bq32000, there is a project of the RTC board based on BQ32000, created in KiCad 8.0.8.\n* in the folder hardware/rtc_mcp7940, there is a project of the RTC board based on MCP7940, created in KiCad 8.0.8.\n\n# Photos\n## Breadboard\n![alt text](https://github.com/octaprog7/libRTC/blob/master/pics/dual_rtc.jpg)\n## RTC interrupt handled\n![alt text](https://github.com/octaprog7/libRTC/blob/master/pics/8563_irq_handled.png)\n\n# Tests: Real Time Clock – DS3231 / PCF8563 / MCP79400 / DS1307\nhttps://www.switchdoc.com/2014/12/benchmarks-realtime-clocks-ds3231-pcf8563-mcp79400-ds1307/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctaprog7%2Flibrtc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctaprog7%2Flibrtc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctaprog7%2Flibrtc/lists"}