Keterangan mengenai RTC (Real-Time Clock) sudah pernah disampaikan melalui kutipan di post terdahulu. Di halaman itu yang dibahas adalah komponen RTC DS1307, yang lazim diperdagangkan dalam bentuk papan yang ditandai sebagai Tiny RTC. Kali ini saya coba rangkumkan mengenai DS3231 dari berbagai sumber sebagai awalan untuk memperlajarinya. RTC ini dilaporkan memiliki akurasi yang lebih baik dari RTC DS1307.
With a backup button cell (e.g. CR2032) on the underside of the module, these DS1307 modules will keep time even when disconnected from the main power source for months and even years on end. However, in our experimental projects (using this RTC with an Arduino for dataloggers amongst other things), we have found these DS1307 modules to vary hugely in their time-keeping accuracy – some gaining/losing a few seconds per day, and others gaining/losing as much as 3-5 minutes per day. While they have proved to be very consistent – i.e. a unit which gains 3 minutes per day will gain 3 minutes per day every day – having to test each unit individually over a few days and then modifying the Arduino project code to cancel out errors is not practical.
Some of the error is caused by ambient temperature changes affecting the accuracy of the timing of the crystal resonator. Some more of the error is also caused by the quality of the crystal itself and its attachment to the PCB in these economical modules.
In extensive testing we have found the time-keeping of these modules to be excellent. The DS3231 chip on the module is marketed as being accurate to 2ppm (parts per million), which means less than one second lost or gained every 5 to 6 days. The units we have tested thus far have all come in at under 1ppm accuracy, so a couple of seconds at most lost or gained per month.
This accuracy is achieved in part by the incorporation of a temperature sensor in the DS3231 which can compensate for changes in ambient temperature. The measurements from this temperature sensor are also accessible to the user (accurate to +/- 3 Celcius) which makes for a handy extra feature. These DS3231 modules also have 32kb of available EEPROM memory which can be utilised by your projects, and many other useful features.
Gambar 2. [randomnerdtutorials.com]
[/su_panel] [su_panel border=”3px solid #30C0F0″ radius=”10″]
Terdapat beberapa pustaka/library untuk tiap RTC. Dua yang disampaikan dalam “mashup“ ini adalah pustaka dari Adafruit dan pustaka dari Makuna.
[/su_panel] [su_panel border=”3px solid #FF6666″ radius=”10″]
Contoh-contoh kode program sistem Arduino untuk RTC DS3231.
[/su_panel] [su_panel border=”3px solid #288AC7″ radius=”10″]Sistem ini dirancang untuk bekerja dengan menggunakan baterai “khusus”, yaitu baterai yang bisa diisi ulang (rechargeable) seperti LIR2032. Di papan sudah disediakan sistem pengisian ulang untuk baterai tersebut. Karena itu jika kita mempergunakan baterai tipe yang tidak bisa diisi ulang (non-rechargeable) seperti CR2032 maka ada perubahan yang perlu dilakukan. Hal ini untuk mencegah agar baterai primer yang tidak bisa diisi ulang itu tidak berusaha diisi oleh sistem. Caranya adalah dengan melepas/membuang diode seperti pada Gambar 3 berikut.
Gambar 3. [sumber: tronixlabs.com]
[/su_panel] [su_panel border=”3px solid #00C700″ radius=”10″] [intense_tabs direction=”right” active_tab_background_color=”#000000″ active_tab_font_color=”#ffff00″ trigger=”click”] [intense_tab title=”Video01″ border=”3px solid #e8e8e8″ link_target=”_self” content_background_color=”#000000″ content_font_color=”#ffffff” icon_size=”1″ icon_position=”left”] [/intense_tab] [intense_tab title=”Video02″ border=”3px solid #e8e8e8″ link_target=”_self” icon_size=”1″ content_background_color=”#000000″ content_font_color=”#ffffff” icon_position=”left”] [/intense_tab] [intense_tab title=”Video03″ border=”3px solid #e8e8e8″ link_target=”_self” icon_size=”1″ content_background_color=”#000000″ content_font_color=”#ffffff” icon_position=”left”] [/intense_tab] [intense_tab title=”Video04″ border=”3px solid #e8e8e8″ link_target=”_self” icon_size=”1″ content_background_color=”#000000″ content_font_color=”#ffffff” icon_position=”left”] [/intense_tab] [intense_tab title=”Video05″ border=”3px solid #e8e8e8″ link_target=”_self” icon_size=”1″ content_background_color=”#000000″ content_font_color=”#ffffff” icon_position=”left”] [/intense_tab] [/intense_tabs] [/su_panel] [su_panel border=”3px solid #990066″ radius=”10″] [/su_panel]