-
1Step 1: Required Components
- Arduino board
- DS3231 RTC board
- 16x2 LCD screen
- 2 x push button
- 10K ohm variable resistor (or potentiometer)
- 330-ohm resistor
- 3V coin cell battery
- Breadboard
- Jumper wires
-
2Step 2: Connection of Arduino Clock
- Connect SCL pin to RTC module to the Arduino A5
- Connect SDA pin to RTC module to the Arduino A4
- Connect VCC TO 5v and GND TO GND
- Connect a pushbutton to the pin 8
- Connect another pushbutton to the pin 9
- Connect RS of LCD to pin 2 of Arduino
- Connect E of LCD to pin 3 of Arduino
- Connect D7 of LCD to pin 7 of Arduino
- Connect D6 of LCD to pin 6 of Arduino
- Connect D5 of LCD to pin 5 of Arduino
- Connect D4 of LCD to pin 4 of Arduino
- Connect VSS & K to the GND
- Connect VDD & A to the 5v
- Connect vo to the potentiometer output pin
-
3Code for Arduino Clock With RTC
The DS3231 works with BCD format only and to convert the BCD to decimal and vise versa I used the 2 lines below (example for minute):// Convert BCD to decimalminute = (minute >> 4) * 10 + (minute & 0x0F);
// Convert decimal to BCDminute = ((minute / 10) << 4) + (minute % 10); void DS3231_display() : displays time and calendar, before displaying time and calendar data are converted from BCD to decimal format.void blink_parameter() :
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.