Wednesday 5 February 2020

Arduino Giant LED (RTC) Clock with Seconds












Arduino LED (RTC) Clock with Seconds and AM/PM indicator , 12/24 hr changing switch



















First You have to download following libraries (link is given end of this page)





1. Wire.h


2. RTClib.h






Parts List





















Watch the video























This is the RTC clock Module










This is the Arduino Circuit










RTC Wiring Connections
















RTC Switches























Circuit Diagram (COMMON ANODE)





















IF YOU USE COMMON CATHODE LED DO THE CHANGES AS FOLLOWS















POWER SUPPLY










24/12 clock LED Indicator












Download Code File










Download Library Files



















This is the code








AliExpress.com Product - 100Pcs F3 F5 super bright 3mm 5mm Round water transparent green / yellow / Blue / White / red LED Kit




/*
4 digit 7 segment display: http://www.sparkfun.com/products/9483
Datasheet: http://www.sparkfun.com/datasheets/Components/LED/7-Segment/YSD-439AR6B-35.pdf
*/
// modified connexion by niq_ro from http://nicuflorica.blogspot.com
// dataseet: http://www.tme.eu/ro/Document/dfc2efde2e22005fd28615e298ea2655/KW4-563XSA.pdf
// Code modified by BMIAK Basnayaka
// http://www.setnfix.com

int digit1 = 11;
int digit2 = 10;
int digit3 = 9;
int digit4 = 6;
int digit5 = 5;
int digit6 = 3;

//Pin mapping from Arduino to the ATmega DIP28 if you need it
//http://www.arduino.cc/en/Hacking/PinMapping
int segA = 0; //Display pin 11
int segB = 1; //Display pin 7
int segC = 2; //Display pin 4
int segD = 4; //Display pin 2
int segE = 7; //Display pin 1
int segF = 8; //Display pin 10
int segG = 12; //Display pin 5
int segDP =13; // Display pin 3



#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;

// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
// original sketck from http://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/
// add part with SQW=1Hz from http://tronixstuff.wordpress.com/2010/10/20/tutorial-arduino-and-the-i2c-bus/
// add part with manual adjust http://www.bristolwatch.com/arduino/arduino_ds1307.htm



byte SW0 = A0;
byte SW1 = A2;
byte SW2 = A1;
byte SWT = A3;
int Adhr=0;
int Admnt=0;
int D = 0;
int Z =0;

// use for hexa in zecimal conversion
long zh, uh, ore;
long zm, um, miniti;

void setup() {

//Serial.begin(57600);
Wire.begin();
RTC.begin();
// RTC.adjust(DateTime(F(__DATE__), F(__TIME__)));
// if you need set clock... just remove // from line above this

// part code for flashing LED
Wire.beginTransmission(0x68);
Wire.write(0x07); // move pointer to SQW address
// Wire.write(0x00); // turns the SQW pin off
Wire.write(0x10); // sends 0x10 (hex) 00010000 (binary) to control register - turns on square wave at 1Hz
// Wire.write(0x13); // sends 0x13 (hex) 00010011 (binary) 32kHz

Wire.endTransmission();


pinMode(segA, OUTPUT);
pinMode(segB, OUTPUT);
pinMode(segC, OUTPUT);
pinMode(segD, OUTPUT);
pinMode(segE, OUTPUT);
pinMode(segF, OUTPUT);
pinMode(segG, OUTPUT);
pinMode(segDP, OUTPUT);

pinMode(digit1, OUTPUT);
pinMode(digit2, OUTPUT);
pinMode(digit3, OUTPUT);
pinMode(digit4, OUTPUT);
pinMode(digit5, OUTPUT);
pinMode(digit6, OUTPUT);


//Serial.begin(9600);

pinMode(SW0, INPUT); // N.O. push button switch
pinMode(SW1, INPUT); // N.O. push button switch
pinMode(SW2, INPUT); // N.O. push button switch
pinMode(SWT, INPUT); // N.O. push button switch

digitalWrite(SW0, HIGH); // pull-ups on
digitalWrite(SW1, HIGH);
digitalWrite(SW2, HIGH);
digitalWrite(segDP, LOW);


}


void loop() {

DateTime now = RTC.now();
long HR = now.hour()*1000;
long timp = (HR*10)+now.minute()*100+now.second();
Adhr = now.hour();
Admnt=now.minute();



int DIM = 0;
if (timp >=250000)
timp=timp-240000;
//------------------------------------------------------
//12/24 hours shitching
//------------------------------------------------------
if (timp < 130000){
digitalWrite(segDP, LOW);}


if (digitalRead(SWT)==0){delay(300);
if (D == 0) {
D =1;delay(200);}

else{
D =0;}
}




if (D == 0){
if (timp>=130000){
timp=timp-120000;
digitalWrite(segDP, HIGH);}
}

if (timp>=130000){
digitalWrite(segDP, LOW);
}

if ((D==1)& (timp <130000))
digitalWrite(segDP, LOW);





//------------------------------------------------------






//int timp = (now.minute(), DEC);
// displayNumber(12); // this is number to diplay



for(int i = 100 ; i >0 ; i--) {
if (timp >= 100000) displayNumber01(timp);
else displayNumber02(timp);
}

for(int i = 100 ; i >0 ; i--) {
if (timp >= 100000) displayNumber03(timp);
else displayNumber04(timp);
}

for(int i = 100 ; i >0 ; i--) {
if (timp >= 100000) displayNumber05(timp);
else displayNumber06(timp);
}




if (digitalRead(SW0)==0){delay(100);Z=1; set_time(); }// hold the switch to set time
}

void set_time() {
byte minutes1 = 0;
byte hours1 = 0;
byte minutes = 0;
byte hours = 0;
hours=Adhr;
minutes=Admnt;


if ((hours & 0x0f) > 9) hours = hours + 6;
if (hours > 0x24) hours = 1; // Mid night 12.00 will show as 12:00 (With PM LED on) or 24:00
//if (hours > 0x23) hours = 1; // Mid night 12.00 will show as 0:00
if ((minutes & 0x0f) > 9) minutes = minutes + 6;
if (minutes > 0x59) minutes = 0;

while (!(Z==0)){ // set time switch must be released to exit






int TST = digitalRead(SW2);
while (TST==0) // set hours
{
hours++;

// converting hexa in zecimal:
zh = hours / 16;
uh = hours - 16 * zh ;
ore = 10 * zh + uh;
zm = minutes / 16;
um = minutes - 16 * zm ;
miniti = 10 * zm + um;




if ((hours & 0x0f) > 9) hours = hours + 6;
if (hours > 0x24) hours = 1; // Mid night 12.00 will show as 12:00 (With PM LED on) or 24:00
//if (hours > 0x23) hours = 1; // Mid night 12.00 will show as 0:00
if (hours <= 9)
delay(1);

for(int i = 400 ; i >0 ; i--) {
displayNumber01(ore*10000+miniti*100);
}

TST = digitalRead(SW2);
}

while (!(digitalRead(SW1))) // set minutes
{
minutes++;
// converting hexa in zecimal:
zh = hours / 16;
uh = hours - 16 * zh ;
ore = 10 * zh + uh;
zm = minutes / 16;
um = minutes - 16 * zm ;
miniti = 10 * zm + um;

for(int i = 400 ; i >0 ; i--) {
displayNumber01(ore*10000+miniti*100);
}

if ((minutes & 0x0f) > 9) minutes = minutes + 6;
if (minutes > 0x59) minutes = 0;
if (minutes >= 9)
delay(1);
}

Wire.beginTransmission(0x68); // activate DS1307
Wire.write(0); // where to begin
Wire.write(0x00); //seconds
Wire.write(minutes); //minutes
Wire.write(0x80 | hours); //hours (24hr time)
Wire.write(0x06); // Day 01-07
Wire.write(0x01); // Date 0-31
Wire.write(0x05); // month 0-12
Wire.write(0x09); // Year 00-99
Wire.write(0x10); // Control 0x10 produces a 1 HZ square wave on pin 7.
Wire.endTransmission();

// converting hexa in zecimal:
zh = hours / 16;
uh = hours - 16 * zh ;
ore = 10 * zh + uh;
zm = minutes / 16;
um = minutes - 16 * zm ;
miniti = 10 * zm + um;



for(int i = 400 ; i >0 ; i--) {
displayNumber01(ore*10000+miniti*100);
}
delay(100);
//Serial.print(digitalRead(SW0));
if (digitalRead(SW0)==0) Z = 0;
delay(300);
}
//Serial.print(SW2);
}



void displayNumber01(long toDisplay) {
#define DISPLAY_BRIGHTNESS 25

#define DIGIT_ON HIGH
#define DIGIT_OFF LOW

for(int digit = 6 ; digit > 0 ; digit--) {

//Turn on a digit for a short amount of time
switch(digit) {
case 1:
digitalWrite(digit1, DIGIT_ON);

break;
case 2:
digitalWrite(digit2, DIGIT_ON);
//digitalWrite(segDP, LOW);
break;
case 3:
digitalWrite(digit3, DIGIT_ON);

break;
case 4:
digitalWrite(digit4, DIGIT_ON);

break;
case 5:
digitalWrite(digit5, DIGIT_ON);

break;
case 6:
digitalWrite(digit6, DIGIT_ON);

break;

}
lightNumber(toDisplay % 10);
toDisplay /= 10;
delayMicroseconds(DISPLAY_BRIGHTNESS);


//Turn off all segments
lightNumber(10);

//Turn off all digits
digitalWrite(digit1, DIGIT_OFF);
digitalWrite(digit2, DIGIT_OFF);
digitalWrite(digit3, DIGIT_OFF);
digitalWrite(digit4, DIGIT_OFF);
digitalWrite(digit5, DIGIT_OFF);
digitalWrite(digit6, DIGIT_OFF);
}
}

void displayNumber02(long toDisplay) {
#define DISPLAY_BRIGHTNESS 25

#define DIGIT_ON HIGH
#define DIGIT_OFF LOW

for(int digit = 6 ; digit > 0 ; digit--) {

//Turn on a digit for a short amount of time
switch(digit) {
case 1:
lightNumber(10);

break;
case 2:
digitalWrite(digit2, DIGIT_ON);
//digitalWrite(segDP, LOW);
break;
case 3:
digitalWrite(digit3, DIGIT_ON);

break;
case 4:
digitalWrite(digit4, DIGIT_ON);

break;
case 5:
digitalWrite(digit5, DIGIT_ON);

break;
case 6:
digitalWrite(digit6, DIGIT_ON);

break;
}
lightNumber(toDisplay % 10);
toDisplay /= 10;
delayMicroseconds(DISPLAY_BRIGHTNESS);

//Turn off all segments
lightNumber(10);

//Turn off all digits
digitalWrite(digit1, DIGIT_OFF);
digitalWrite(digit2, DIGIT_OFF);
digitalWrite(digit3, DIGIT_OFF);
digitalWrite(digit4, DIGIT_OFF);
digitalWrite(digit5, DIGIT_OFF);
digitalWrite(digit6, DIGIT_OFF);
}
}

void displayNumber03(long toDisplay) {
#define DISPLAY_BRIGHTNESS 25

#define DIGIT_ON HIGH
#define DIGIT_OFF LOW

for(int digit = 6 ; digit > 0 ; digit--) {

//Turn on a digit for a short amount of time
switch(digit) {
case 1:
digitalWrite(digit1, DIGIT_ON);

break;
case 2:
digitalWrite(digit2, DIGIT_ON);

break;
case 3:
digitalWrite(digit3, DIGIT_ON);

break;
case 4:
digitalWrite(digit4, DIGIT_ON);

break;
case 5:
digitalWrite(digit5, DIGIT_ON);

break;
case 6:
digitalWrite(digit6, DIGIT_ON);

break;
}
lightNumber(toDisplay % 10);
toDisplay /= 10;
delayMicroseconds(DISPLAY_BRIGHTNESS);

//Turn off all segments
lightNumber(10);

//Turn off all digits
digitalWrite(digit1, DIGIT_OFF);
digitalWrite(digit2, DIGIT_OFF);
digitalWrite(digit3, DIGIT_OFF);
digitalWrite(digit4, DIGIT_OFF);
digitalWrite(digit5, DIGIT_OFF);
digitalWrite(digit6, DIGIT_OFF);
}
}

void displayNumber04(long toDisplay) {
#define DISPLAY_BRIGHTNESS 25

#define DIGIT_ON HIGH
#define DIGIT_OFF LOW

for(int digit = 6 ; digit > 0 ; digit--) {

//Turn on a digit for a short amount of time
switch(digit) {
case 1:
lightNumber(10);

break;
case 2:
digitalWrite(digit2, DIGIT_ON);

break;
case 3:
digitalWrite(digit3, DIGIT_ON);

break;
case 4:
digitalWrite(digit4, DIGIT_ON);

break;
case 5:
digitalWrite(digit5, DIGIT_ON);

break;
case 6:
digitalWrite(digit6, DIGIT_ON);

break;
}
lightNumber(toDisplay % 10);
toDisplay /= 10;
delayMicroseconds(DISPLAY_BRIGHTNESS);

//Turn off all segments
lightNumber(10);

//Turn off all digits
digitalWrite(digit1, DIGIT_OFF);
digitalWrite(digit2, DIGIT_OFF);
digitalWrite(digit3, DIGIT_OFF);
digitalWrite(digit4, DIGIT_OFF);
digitalWrite(digit5, DIGIT_OFF);
digitalWrite(digit6, DIGIT_OFF);
}
}

void displayNumber05(long toDisplay) {
#define DISPLAY_BRIGHTNESS 25

#define DIGIT_ON HIGH
#define DIGIT_OFF LOW

for(int digit = 6 ; digit > 0 ; digit--) {

//Turn on a digit for a short amount of time
switch(digit) {
case 1:
digitalWrite(digit1, DIGIT_ON);

break;
case 2:
digitalWrite(digit2, DIGIT_ON);

break;
case 3:
digitalWrite(digit3, DIGIT_ON);

break;
case 4:
digitalWrite(digit4, DIGIT_ON);

break;
case 5:
digitalWrite(digit5, DIGIT_ON);

break;
case 6:
digitalWrite(digit6, DIGIT_ON);

break;
}
lightNumber(toDisplay % 10);
toDisplay /= 10;
delayMicroseconds(DISPLAY_BRIGHTNESS);

//Turn off all segments
lightNumber(10);

//Turn off all digits
digitalWrite(digit1, DIGIT_OFF);
digitalWrite(digit2, DIGIT_OFF);
digitalWrite(digit3, DIGIT_OFF);
digitalWrite(digit4, DIGIT_OFF);
digitalWrite(digit5, DIGIT_OFF);
digitalWrite(digit6, DIGIT_OFF);
}
}

void displayNumber06(long toDisplay) {
#define DISPLAY_BRIGHTNESS 25

#define DIGIT_ON HIGH
#define DIGIT_OFF LOW

for(int digit = 6 ; digit > 0 ; digit--) {

//Turn on a digit for a short amount of time
switch(digit) {
case 1:
//digitalWrite(digit1, DIGIT_ON);

break;
case 2:
digitalWrite(digit2, DIGIT_ON);

break;
case 3:
digitalWrite(digit3, DIGIT_ON);

break;
case 4:
digitalWrite(digit4, DIGIT_ON);

break;
case 5:
digitalWrite(digit5, DIGIT_ON);

break;
case 6:
digitalWrite(digit6, DIGIT_ON);

break;
}
lightNumber(toDisplay % 10);
toDisplay /= 10;
delayMicroseconds(DISPLAY_BRIGHTNESS);

//Turn off all segments
lightNumber(10);

//Turn off all digits
digitalWrite(digit1, DIGIT_OFF);
digitalWrite(digit2, DIGIT_OFF);
digitalWrite(digit3, DIGIT_OFF);
digitalWrite(digit4, DIGIT_OFF);
digitalWrite(digit5, DIGIT_OFF);
digitalWrite(digit6, DIGIT_OFF);
}
}
//Given a number, turns on those segments
//If number == 10, then turn off number
void lightNumber(int numberToDisplay) {

//Common Anode *************************
#define SEGMENT_ON HIGH
#define SEGMENT_OFF LOW

/* Common Cathode *****************
#define SEGMENT_ON LOW
#define SEGMENT_OFF HIGH
*/

switch (numberToDisplay){

case 0:
digitalWrite(segA, SEGMENT_ON);
digitalWrite(segB, SEGMENT_ON);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_ON);
digitalWrite(segE, SEGMENT_ON);
digitalWrite(segF, SEGMENT_ON);
digitalWrite(segG, SEGMENT_OFF);
break;

case 1:
digitalWrite(segA, SEGMENT_OFF);
digitalWrite(segB, SEGMENT_ON);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_OFF);
digitalWrite(segE, SEGMENT_OFF);
digitalWrite(segF, SEGMENT_OFF);
digitalWrite(segG, SEGMENT_OFF);
break;

case 2:
digitalWrite(segA, SEGMENT_ON);
digitalWrite(segB, SEGMENT_ON);
digitalWrite(segC, SEGMENT_OFF);
digitalWrite(segD, SEGMENT_ON);
digitalWrite(segE, SEGMENT_ON);
digitalWrite(segF, SEGMENT_OFF);
digitalWrite(segG, SEGMENT_ON);
break;

case 3:
digitalWrite(segA, SEGMENT_ON);
digitalWrite(segB, SEGMENT_ON);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_ON);
digitalWrite(segE, SEGMENT_OFF);
digitalWrite(segF, SEGMENT_OFF);
digitalWrite(segG, SEGMENT_ON);
break;

case 4:
digitalWrite(segA, SEGMENT_OFF);
digitalWrite(segB, SEGMENT_ON);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_OFF);
digitalWrite(segE, SEGMENT_OFF);
digitalWrite(segF, SEGMENT_ON);
digitalWrite(segG, SEGMENT_ON);
break;

case 5:
digitalWrite(segA, SEGMENT_ON);
digitalWrite(segB, SEGMENT_OFF);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_ON);
digitalWrite(segE, SEGMENT_OFF);
digitalWrite(segF, SEGMENT_ON);
digitalWrite(segG, SEGMENT_ON);
break;

case 6:
digitalWrite(segA, SEGMENT_ON);
digitalWrite(segB, SEGMENT_OFF);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_ON);
digitalWrite(segE, SEGMENT_ON);
digitalWrite(segF, SEGMENT_ON);
digitalWrite(segG, SEGMENT_ON);
break;

case 7:
digitalWrite(segA, SEGMENT_ON);
digitalWrite(segB, SEGMENT_ON);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_OFF);
digitalWrite(segE, SEGMENT_OFF);
digitalWrite(segF, SEGMENT_OFF);
digitalWrite(segG, SEGMENT_OFF);
break;

case 8:
digitalWrite(segA, SEGMENT_ON);
digitalWrite(segB, SEGMENT_ON);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_ON);
digitalWrite(segE, SEGMENT_ON);
digitalWrite(segF, SEGMENT_ON);
digitalWrite(segG, SEGMENT_ON);
break;

case 9:
digitalWrite(segA, SEGMENT_ON);
digitalWrite(segB, SEGMENT_ON);
digitalWrite(segC, SEGMENT_ON);
digitalWrite(segD, SEGMENT_ON);
digitalWrite(segE, SEGMENT_OFF);
digitalWrite(segF, SEGMENT_ON);
digitalWrite(segG, SEGMENT_ON);
break;

// all segment are ON
case 10:
digitalWrite(segA, SEGMENT_OFF);
digitalWrite(segB, SEGMENT_OFF);
digitalWrite(segC, SEGMENT_OFF);
digitalWrite(segD, SEGMENT_OFF);
digitalWrite(segE, SEGMENT_OFF);
digitalWrite(segF, SEGMENT_OFF);
digitalWrite(segG, SEGMENT_OFF);
break;

}
// End of the coding, BUDHUSARANAI, Best of luck.

}












































Previous Post
Next Post

post written by:

106 comments:

  1. It's Very good project i love It's so much

    ReplyDelete
    Replies
    1. Sir when my Clock reached 12
      It's not show 12, shows 0 how can i solve this problems reply pleas. Thank you

      Delete
    2. it is 12 midnight shows as 0

      Delete
    3. yes. Download new codes

      Delete
  2. Please help me I'm trying to Making this projects but when i upload the arduino all digital pin are blinked Solution please please

    ReplyDelete
    Replies
    1. It may be the reason due to an issue on wiring.

      Delete
    2. I think wiring is ok.
      Problems in code

      Delete
  3. Give me your whatsapp Number

    ReplyDelete
    Replies
    1. Contact me on FB https://www.facebook.com/setnfix

      Delete
    2. blinking fast or slowly ? and can you see the time even it is blinked.

      Delete
    3. No time only all led is bliking
      Im Check wiring its absolutely ok with your diagram

      Delete
  4. My whatsapp number +8801644057379

    ReplyDelete
  5. How to add this project ds3231 rtc,
    Please help me

    ReplyDelete
  6. Is there a reason you did not want to use the arduino board and just used the Atmel chip?

    I am working on getting this project running but am running into issues. Would 2N3906 PNP transistor work instead of bc557?

    ReplyDelete
    Replies
    1. If you want, you can use the arduino board as well, but it is more cost and more space consume. Yes you can use.

      Delete
  7. Sir i make this Clock project successfully, but DP is not blinking. So please give me guideline.
    thanks

    ReplyDelete
    Replies
    1. DP led is directly connected to the LED of RTC module.

      Delete
  8. Hello sir, when the time for example 8:00 , the clock shows 8:00:00( First digit off). But I want 08:00:00, I want '0' before '8' , how do I do that, Pls help me sir

    ReplyDelete
    Replies
    1. Find the following code
      void displayNumber06(long toDisplay)

      and, under that code find

      //digitalWrite(digit1, DIGIT_ON); code and remove "//" mark. Best of luck.

      Thank you for visiting SetNFix

      Delete
    2. In respect of this your advice, I tried removing the "//" mark and it showed quit well but it's blinking is not stable

      Delete
  9. I follow your step , all 6 digit now active , but 1st digit '0' is not constant, blinking very fast , pls solve this problem

    ReplyDelete
  10. Replies
    1. There may be a wire short. pls check the wiring and the connection of the pins of LED (+) and (-)

      Delete
  11. I made 2nd another clock , same problem , all my connection I checked 50s time , but same problem, there is a problem with the code. plsss fix this problem . thank you :)

    ReplyDelete
  12. I can't upload the code to Atmega 328pu microcontroller using Arduino uno. Shows upload error while uploading and shows board problem. How to program a new Atmega328 microcontroller with the help of Arduino uno, I would benefit from the process window. Thanks.

    ReplyDelete
    Replies
    1. Sir, can you let me know by means of a communication so that I can send two pictures about the error? here is no possible add any pictures & imag.

      Delete
    2. you can copy the error and post it

      Delete
  13. please sir i want to enhance it modify the 7 segment clock by adding more 8 pieces of 7 segments display to enable it to display DD/MM/YYYY. (00/00/0000). So please how do I go about it in terms of code and hardware

    Thanks.

    ReplyDelete
  14. Sir I really want to know if I am going to connect all the segments A,B,C,D,E,F and G of the new 8 pieces of 7-segment (SSD) display i want to add to the modification I am working on and again I am thinking of making use of another AVR chip that can accommodate more input and output pins such as ATmega16 with 40pins. Please sir I really need your advice because I am serious about adding date, month, and year functions to this digital clock

    ReplyDelete
    Replies
    1. It is not enough pins there in Atmega16 for your purpose. But if you want to add Date, Time, Year you have to use arduino Mega board. Then start the programming. Programming part is complicated but it can be done if you check the existing code and the details of the Library well.

      Delete
  15. Thanks, it's the best clock design.

    ReplyDelete
  16. sir i made this clock but when i powered then no led is in on position, when i pressed the setup button this hour and minute leds are flashing, please help....

    ReplyDelete
    Replies
    1. I think you have to chose common anode or common cathode correctly.

      Delete
    2. i have made common anode seven segment display with 4 pcs. of red led in parallel in connection.

      Delete
    3. Did you apply the correct circuit?. ok trouble shoot like this. Find int DIM = 0; from the code and type timp = 121212; and check the result.

      Delete
    4. This comment has been removed by the author.

      Delete
  17. Replies
    1. Yes you can. but you can not keep the time in memory and also you have to generate pulse of 1Hz.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Pls helpe me sir,,,give me without rtc code.

      Delete
  18. i have made common anode seven segment display with 2 pcs. of red led in parallel in all segment connection. how can i operate this. plz help me. what is code for this.

    ReplyDelete
    Replies
    1. no need to change the codes, just see the description and and use the transistors correctly applicable for common anode.

      Delete
  19. hi sir ! in my project all connections are correct but ds1307 ic become verry hot. and clock atomically off after sometime. why? how can i solve this problem

    ReplyDelete
  20. I made this clock, but all 7 segment are not glow full brightness, how to increase its brightness, I used 5v 2amp power supply, please help

    ReplyDelete
    Replies
    1. i think use 9 volt power supply but connect proper resister for each segment second option use low resistance transister base resister

      Delete
    2. Change the brightness level amount in the code and find out the suitable amount.

      Delete
  21. i have made this clock successfully, but the input for led directly from trainsistor is enoughf? i mean that there is no resistor used for output of led. is that not decreased the life of led's? please reply....

    ReplyDelete
    Replies
    1. No. I am using the same product more than 4 year without an issue.

      Delete
  22. sir, i want to increase the brightness of led. what code need to change for this?

    ReplyDelete
    Replies
    1. Then you have to use arduino PWM pins. You need 6 PWM pins such as pin no 3,5,6,9,10,11.

      STEP 01
      Find #define DIGIT_ON HIGH

      Then change the HIGH in to your value (0 to 256)
      STEP 02
      Then all the coeds from digit1 to digit6 should be changed from digitalWrite to analogWrite.

      Delete
    2. Please send any new updated code (6 digit 12/24 7 segment digital clock)

      Delete
  23. Can you send me this kit and what price

    ReplyDelete
  24. Sir can i use a ready Arduino Nano board instead if Atmega328 with the same code

    ReplyDelete
  25. Uploading error

    An error occurred while uploading the sketch
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x3e
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x3e

    ReplyDelete
    Replies
    1. which microcontroller do u used?

      Delete
    2. 1st open a new program and upload it without codes. It is uploaded well, the Chip is working well.
      Then connect the board to arduino (without any other wirings) and upload the code.

      Delete
    3. Sir now code has been uploaded, but all the segments are blinking, if observed closely, clock is running
      Please help
      Regards

      Delete
    4. Check the wiring of switch board

      Delete
  26. Sir i am using common anode display, whether I will have to edit the code?
    ie:-
    //Common Anode *************************
    #define SEGMENT_ON HIGH
    #define SEGMENT_OFF LOW

    /* Common Cathode *****************
    #define SEGMENT_ON LOW
    #define SEGMENT_OFF HIGH
    */

    switch (numberToDisplay){

    THIS SECTION

    ReplyDelete
    Replies
    1. No need to edit the code, check the wiring diagram above.

      Delete
  27. I complete this project but time running fast 4 or 5 second in one day how can i fix it please help

    ReplyDelete
    Replies
    1. Due to the different qualities of products, this can be happened.

      Delete
  28. Hello,

    Made the project with my own 7" x 11" displays. Case is 3d printed. Love it. I used an Arduine Uno. Works great. Thanks for sharing.

    ReplyDelete
    Replies
    1. Greetings...!!! Share your project in SetnFix Facebook page and share your experience.

      Delete
  29. Hello,

    I used an DS3231 and had to modify the code for the blinking led into:

    // part code for flashing LED
    Wire.beginTransmission(0x68);
    Wire.write(0x0E); // move pointer to SQW address
    // Wire.write(0x00); // turns the SQW pin off
    Wire.write(0xc0); // sends 0xc0 (hex) 00010000 (binary) to control register - turns on square wave at 1Hz
    // Wire.write(0x13); // sends 0x13 (hex) 00010011 (binary) 32kHz

    ReplyDelete
  30. I create 4 digit clock.
    All led are lighting.
    adjust button is working , it OK.
    But can't adjust Hour and minute , it not working.
    I sent detail and photo from Facebook messenger.
    Please help me.
    Thank Sir

    ReplyDelete
    Replies
    1. // RTC.adjust(DateTime(F(__DATE__), F(__TIME__)));

      then, I remove // , but not OK.Please help me.

      Delete
    2. // RTC.adjust(DateTime(F(__DATE__), F(__TIME__)));
      This code is to decide keeping the time in RTC Memory or jut updating the time from the PC.

      Delete
  31. hello dear
    you have really done a wonderful job and i have made a clock by watching your instructions and using 3231 rtc but 1 problem is coming that please help but blinking leds are not working. soo please give your expert opinion..

    ReplyDelete
    Replies
    1. That blinking LEDs are not coming through the arduino programme. It is directly connected to the LED of RTC module. If the LED of RTC module is working, Check the wiring.

      Delete
    2. leds are constant not blinking but when i use this code
      // part code for flashing LED
      Wire.beginTransmission(0x68);
      Wire.write(0x0E); // move pointer to SQW address
      // Wire.write(0x00); // turns the SQW pin off
      Wire.write(0xc0); // sends 0xc0 (hex) 00010000 (binary) to control register - turns on square wave at 1Hz
      // Wire.write(0x13); // sends 0x13 (hex) 00010011 (binary) 32kHz

      led start blinking but timekeeping after power off is not working so please helppp....

      Delete
  32. Hello Sir,I loved your project.If you don't mind please give me the hole circuit diagram in one full ciruit..plz sir it's my humble request..

    ReplyDelete
    Replies
    1. Thank you. I will try. the problem is it will take more space and complicated.

      Delete
    2. Ok sir..but sir, can i use RTC modlue in this circuit..??

      Delete
  33. Hello Sir ,

    Some segment is dim lighting.
    For exempar , " 1 " number only need for light B Segment and C Segment , but D , E , F Segment are dim lighting.
    How to fit this error.

    then , Segments brightness are lower.

    How to increase brightness.

    Thank you very much .

    ReplyDelete
    Replies
    1. Now I replace High to 255 and digitalWrite to analogWrite, but
      not working.How to fit?
      Thank

      Delete
    2. Swap the number of the code assigned to A to G and check it again. let me know the result. If the error is as same the problem is with the wiring or components related to that lines.

      Delete
  34. Hello Sir,
    I am from Myanmar.
    I can not write English well.
    Please understand.

    I edited as you say.
    Brightness not increase.

    I tested and edited from
    " define DISPLAY_BRIGHTNESS 25 " to " define DISPLAY_BRIGHTNESS 3000 ".

    After editing , brightness are become increase.

    Clock is normally work.

    After editing ,
    When I press the SET Button it does not work immediately .
    Hold for about 5 seconds to work , Hour , Minute , 12/24 too.

    I mean,I can only adjust it once by holding down the button long time.

    How to fit it ?

    Thank you very much for your reply.

    ReplyDelete
  35. great project.i made the clock with common anode 6 digits with ds3231 rtc module .no led is lit.does the clock work with rtc ds3231 module and what do i have to modify in the code. thanks a lot

    ReplyDelete
    Replies
    1. I didn't try with DS 3231, You have to assign DS 3231 library and the cardings accordingly.

      Delete
  36. Hello admin
    Nice project thank you.
    I did it this morning and was using it. No problem for now, I'll check if there will be a time delay.
    Stay healthy and happy.

    ReplyDelete
    Replies
    1. I also had the same problem, but it is about 5 minutes to last 3 years. I think it is not a big issue. The time accuracy is depend on the quality of the components, specially crystal and the Atmega IC. There are different levels of the products' qualities. If the time variation is high, try with changing brightness amount in the coding.

      Delete
  37. I was wondering if i could use a 3 non-adressable led rgb strip for each segment and how would that affect the diagram. Thank you

    ReplyDelete
    Replies
    1. If you are not expecting to change the colors while the clock is running, it is no needed to change the diagram.

      Delete
  38. If I want to use 12 volt LED then how can I do it? Please.

    ReplyDelete
    Replies
    1. Give 5v to the board and give 12v to the transistors

      Delete
  39. Code error problem
    (redefinition of ' void setup ()')
    What to do now?
    Please help me

    ReplyDelete
  40. Sir DS3231 and nano board this project is not working no led blink. Please help me

    ReplyDelete
  41. subhradip276@gmail.com20 August 2021 at 08:42

    sir i want to add a buzzer that beep in every hour, in ihe place of seconds degits pin of arduino. i want to remove 2 last digit that showing seconds and use this pins of arduino with a buzzer. please help me to give me the code to make the buzzer beep in every hour....

    ReplyDelete
    Replies
    1. If so, you may not need int digit5 = 5; int digit6 = 3; pins.

      then create int variable as an OUTPUT.

      then you have to find the hours using timp variable. if its value is 120010
      the time is 12h 00m 10s.






      Delete
  42. RTC lib can not even find the DS1307 chip, all it does is blink with 0-s , i have no idea how did you compile this, but the currently available compiler and libraries do not work at all with it.

    ReplyDelete