
DS1307 Arduino based Digital Clock in Proteus

Libraries used in this project
Arduino Library for Proteus: V1.0 (2015, used in this project) · latest version: V4.0 (October 2026)
DS1307 Library for Proteus: V1.0 (2016, used in this project)
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
So, now I hope that you have installed both these libraries successfully and are ready to design this DS1307 Arduino based Digital Clock. I have given the Simulation and Code for download below but as I always advise, don't just download the files. Instead design your own simulation and try to write your own code. In this way, you will learn more out of it. So, let's get started with DS1307 Arduino based Digital Clock in Proteus ISIS:
DS1307 Arduino based Digital Clock in Proteus
- You can download the complete Proteus Simulation along with Arduino Code by clicking the below button.
- You will also need DS1307 Library for Arduino, which is also available in this package.
- Now, let's get started with designing of this DS1307 Arduino based Digital Clock.
- So, first of all, design a circuit in Proteus as shown in below figure:
- You can see in the above figure that I have used Arduino UNO along with RTC module, LCD and the four buttons.
- These four buttons will be used to change the year,date etc as mentioned on each of them.
- Now here's the code for DS1307 Arduino based Digital Clock.
#include <LiquidCrystal.h>
#include <DS1307.h>
#include <Wire.h>
LiquidCrystal lcd(13,12,11,10,9,8);
int clock[7];
void setup(){
for(int i=3;i<8;i++){
pinMode(i,INPUT);
}
lcd.begin(20,2);
DS1307.begin();
DS1307.setDate(16,4,7,0,17,50,04);//ano,mes,dia,semana,horas,minutos,segundos
}
void loop(){
DS1307.getDate(clock);
lcd.setCursor(0,1);
lcd.print("Time: ");
Print(clock[4]);
lcd.print(":");
Print(clock[5]);
lcd.print(":");
Print(clock[6]);
lcd.setCursor(0,0);
lcd.print("Date: ");
Print(clock[1]);
lcd.print("/");
Print(clock[2]);
lcd.print("/");
lcd.print("20");
Print(clock[0]);
if(digitalRead(7)){
clock[5]++;
if(clock[5]>59) clock[5]=0;
DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
while(digitalRead(7));
}
if(digitalRead(6)){
clock[4]++;
if(clock[4]>23) clock[4]=0;
DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
while(digitalRead(6));
}
if(digitalRead(5)){
clock[2]++;
if(clock[2]>31) clock[2]=1;
DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
while(digitalRead(5));
}
if(digitalRead(4)){
clock[1]++;
if(clock[1]>12) clock[1]=1;
DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
while(digitalRead(4));
}
if(digitalRead(3)){
clock[0]++;
if(clock[0]>99) clock[0]=0;
DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
while(digitalRead(3));
}
delay(100);
}
void Print(int number){
lcd.print(number/10);
lcd.print(number%10);
}
- Now get your hex file from Arduino software and then upload it in your Proteus software.
- Now run your simulation and if everything goes fine, then it will look like something as shown in below figure:
- Now you can see its today's date in the LCD and the same is shown over on the small pop up of DS1307 Clock.
- Now the time will start on ticking and the buttons will used to change the minutes hours etc.
- You will get the better demonstration of this project in the below video.
So, that's all for today. I hope this projects DS1307 Arduino based Digital Clock will help you in some way. So see you in next post.
tnx Nasir..this is a v.cool work you've shown
pls, can I get documents (.rar file) for same project, buh dis time with 4digits 7segment display. adjustments for mins and hours only
thanks!
1 reply
Yeah we can provide it to you. Please add me on Skype and we will discuss it in detail.
Thanks.
Hello,
I have a problem with clocks frequency, the shown Time is ticking slower than PC colock. How can i repair it?
the coded above is showing error "unable to compile for uno "
plz help
and what does this statement do "'while(digitalRead(7))'"
what is going on in this block of code and how
if(digitalRead(7)){
clock[5]++;
if(clock[5]>59) clock[5]=0;
DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]);
while(digitalRead(7));
}
plz don't consider my previous query
1 reply
Are you solved that error ,if you solved it send your code
can you send me the hex file because in laptop the program not compling
1 reply
Hi,
You should have a look at How to get Hex File from Arduino software (https://www.theengineeringprojects.com/2015/10/hex-file-arduino.html). It's quite easy.
Thanks.
Give DS1307 library for arduino
1 reply
Download the project files. DS1307 Library for Arduino is included in it.
Code doesn't compile;Your code is wrong
1 reply
Hi,
It's not that good technique to blame others, instead of trying a little hard. :P
Please download the files, everything's there and also watch the video as I have explained everything in it.
Thanks.
hey sir
iam a big fan of yours
and i always follow up ur project.
sir i am facing some issue regarding hex file creat plz solve my issue
i am getting this message when i verify
exit status 1
DS1307.h: No such file or directory

























Comments
14