It may be inappropriate that I write a tutorial for dummies when I myself am also a dummy. Anyway I decided so because there isn’t really any tutorial out there. This tutorial was born thanks to my TA Sakari. Yes, Sakari rocked today!!!
What you need: RTC module, Arduino, four jumpers.
We are going to use this library from NorthernWidget. Yes the model number is different from the one we are using but it worked for me(or for Sakari). Place it in the right place:
By putting in the library folder you can use it as the library and also the examples.
Naturally what you would do first is setting the time. So open DS3231_set. You will see:
For instance if it’s 2014.Oct.16th Thursday 3 p.m. 3 min 0 second now. You will enter 1410164150300x in the serial monitor. x in the end is to ensure that your given input is a valid input. Small “w” is a day of week, Mon, Tue, Wed, …. Monday is 1, Tuesday is 2 and so on. If you did correctly and everything goes right, then Serial monitor print your input. Remember to set the correct baud rate!!!
Actually the coding part is relatively easier than wiring it because there is no straightforward manual for it.
So back to the module. What the heck are the pins about?
How to connect? Voila!
SDA(data line) and SCL(clock line) pins are noted here because we use Wire library. Noticed #include <Wire.h>? For more info check the official site.
If you’ve done wiring and setting then you can check how it works. Open the example “now”, upload it and open serial monitor. Remember that baud rate for now.pde and set.pde is different. When you have set the correct baud rate you will see a good result 🙂 Hope this helped some of you. If you’ve got any question, leave a comment 😉