Arduino Project: Real time clock DS3231 and 1.8 Color TFT display ST7735
HTML-код
- Опубликовано: 2 окт 2015
- Building a Real Time Clock (DS3231) with Arduino and a 1.8" color TFT display (ST7735) is very easy. All you need to do is to follow the steps we show in this video. The cost of the project is very low as well. You can build this project with around 10$. Impressive isn't it? That's the power of Arduino and open software.
The code of the project is very simple and it is described in the video. In the .zip file that I share, you can find both version of the code, with temperature in Degrees C and degrees F.
--------------------
Code & Parts
--------------------
educ8s.tv/arduino-real-time-cl...
Want to learn to code?
👨💻 Check my new RUclips channel: bit.ly/3tku2n0 - Наука
Great! RTC project very fun to build. Works and looks very good !
Thank you!
I've made it! Thanks for the nice tutorial.
Thanks Nick, learn much from you!
Never mind I found your video on connecting and using the 1.8 TFT display.
thanks for the project and keep going greetings from mexico.
Your my favorite human.
Great job! I build something like it but with a nokia display :)
thanks, I will try that.
thanks for the idea and help, it's working correctly now, I am happy.
+Steve Tripoli I glad that it helped!
Hello Steve I have been trying for over a hour to get mine to be a 12 hour clock, could you help me since it sounds like you actually got yours to work.
well... after the errors are sorted out, i just get really weird hazy lines(4 in total) on the screen and do not see any text at all...?
Great videos, I have learned a lot from them. How about a video on some of the larger TFT displays that are also available.
Thanks for all your hard work!!
+ProjectGuns Yes, we are going to test the larger TFTs as well. Stay tuned!
Would like to put my 2.4 TFT on this project
Thank you
you are making great ... I love you project s ... but still it seems little bit hard for me as beginner .
I like your project
Thank you!
ωραίος!
great thanks
would be great to use the TFT on your previous data logger as well as the usual storage to SD card.
Hello, great project thanks for sharing. I didn't hear what you said about how to connect the 1.8 TFT display, could you tell me where to look for the connections.
Thanks,
Steve
You do a nice job is wind direction next?
Hey need ur help can we add a realy so when the temperature reach a set limits it turn on the fan ....
Do you have a video or could you make one that would use the time as a condition that if the time is between (X:XX) and (X:XX) then a relay is activated or something to that nature?
+Daniel Nasif Yes, that's a nice project to build!
I want to replace the min temperature and max temperature at the bottom of the display and make it an alarm? How will i change that in the code ?
Thank you sir, very good teaching. I want to build this but I have a macintosh. I put the ide from arduino but the vendor says the Uno not good for mac. Must be pc to flash with sketch?
Hello Nick. Thank you for the educational motivation and supports.
I am trying to get the 1,8" TFT display and Ds3231 to work, as per your video, but is struggling with the GFX.h library. I cant find the right one, or version. When I compile i get this message ""Arduino\libraries\Adafruit_ST7735_Library/Adafruit_ST7735.h:34:26: fatal error: Adafruit_GFX.h: No such file or directory" ??
What am I doing wrong?
Thank you Niels,
Denmark
thanks for the information. Question: how to make seconds?
Hi Nick,I have made this project and it seems to rum but my screen looks milky most of the time. If I press the Reset I get what looks like a normal screen for a few seconds until the reset happens. Any thoughts? I have checked my wiring, hardware and another TFT module.
hi...video at 4:08.the screen flicker to update the value.this is big problem with this lcd library.if you can fix this this it would be great.
con alarma despertador ?? con sumvador ,,gracias
Hi, setRTCTime() command will synchronize the PC system time with ds3231 module ?
Great job!!! I like the idea of refreshing the display only when it's needed. That's a good idea! :-) Also is that a different library for the real time clock then what you use the last time? I'm still fiddling around with the other previous library, I can't seem to get it to display Fahrenheit. I'm trying to convert Celsius to Fahrenheit with that formula but somehow my code isn't working. I may try this new library. I don't have the color display yet, but will soon because it looks cool :-)
+Dog Rox Thanks, if you need any help with the code, drop me a line..
Hi, I am manage to get the code to translate to Fahrenheit. The original code was the example code for the real time clock. There's a lot of it I still don't understand about that code, like the floats, the integers, and the dtostrf where it looks like its not even needed. I may just start from scratch, as it makes it easier to learn what's going on in the code. :-)
think about exercising dht22
or 18b20
great movies
Finally managed to complete the clock after a few months, thanks for your videos which help tremendously. My display is very dim is it the part or connection?
+Ian Hughes Check your connections again, and if there is no mistake at the connections try another display.
I will have to get another display to try, but thanks for the reply. Keep up the good work.
Love this project but would like to add a menu to it so it becomes an alarm clock for my bedside table.
Will it be easy to add a menu to add arm time ?
Thank you for any help Bob
It is not that difficult to add such functionality. I will try it someday.
I'm doing similar project but want the time to be updated from D1 wifi board or any esp8266 wifi module, is it possible. If you have done any project please forward it
sir i am using DHT11 instead of real time clock DS3231 so can you please tell me the connections and code
Educs, i would like to edit the Time with push button. How can i do that?
Thank very much I have it up and running in few hours I enjoy is very much but which line of code to change the order of date also to change time to a 12 hour format also incorporate DTH11 or DTH22 .. Please when down loading software go slower and show more details.. any code I change would gladly share it with you for future subscribers..
Thank You,
Sincerely, Robert B
USA, NJ
Hi, I would like to ask about the time and date how to enter it, because it doesn't work for me.But everything works. thanks for the reply.
sir can you make a video about how we can program for this displats as we want
hello, love watching your videos, already much learned, I set some of his projects, the latter was that the RTC, but he lags mine, in two days it ta 5 late seconds jo rode several other RTC, other codes but all delays, tems an opinion.
Have you tried another module? Maybe you got a faulty one.
Can we use noKia 5110 display
Hi I made the above item and it is up and running but I am unable to reset the temperature as it is to high I am relieve new to arduino hope you can help.
Steven
Hi!
So I run the code and everything works just fine. However my LCD gets a black screen and stops there. Do you know what could be the problem? Thanks!
Ok, so I just plugged the sd card on the back and it worked fine lol see if that's the problem
How about touch screen function? what do i do ?
Sodaq_DS3231.cpp:12:26: fatal error: avr/pgmspace.h: No such file or directory ?
In Sodaq_DS3231.cpp you have to replace
#include
with
#if (defined(__AVR__))
#include
#else
#include
#endif
Hi buddy I would need more information about how to make interactive buttons menu and SD card reading.Could you send me? I have the TJCTM24028 SPI module with XTP2046 controller compatible with ILI9341 libraries.
Hi. I'm building a RTC with DS3231, and i want to change the weekday, hour, minute, second, day and year... and i'm wonder how with this library?
can you help me?
Thank you so much!
Marc.
+Marc Paradis There is a function in the code which is name setTime. There you can change the time and the date easily.
#include // Define the base class to std::allocator.
^
compilation terminated.
exit status 1
can you explain a little about setting the rtc, when i do it it sets to 27.08.2015 at 9.35 every time?
+Poulsen Media™ You have to manually set the current time in the code.
Change this line of code: DateTime dt(2015, 8, 27, 9, 35, 30, 4); // Year, Month, Day, Hour, Minutes, Seconds, Day of Week
+Educ8s.com Sorry i missed that one, thank you
Hi can you help I built your real time clock but I cannot change the day in the program and the temperature is not reading correctly I am new two ardiuno so hope you pint me in the right direction.
Many Thanks Steven.
Hey, nice project. I am looking for a posibility to set the time via menu and buttons. Any idea how to do this. Maybe this could be a feature for your next version of the clock
+Joachim Lange Yes, I plan to make a special video on that!
+educ8s.tv i have found an intersting Link for this issue: liudr.wordpress.com/libraries/phi_prompt/
I have not understood the connections of the display to arduino.
Please help me.
Your code is generating the following error: Compilation error: redefinition of 'Adafruit_ST7735 tft'
and stops at line 14
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
I installed the Adafruit library ST7735 and ST7789, version 1.10.4
Any ideas please?
hi could make this clock witch alarms? very good video.
+EPICELECTRONICA HERNANDEZ yes we can do that
Nick, sorry to bother you... I am not expert in Arduino, but I have build many of your projects.
That was the first time I got a compilation error. I believe it is a simple definition mater, but I was not able to solve it. Do you have a clue, please? Thanks a lot.
RTCTFT160.ino: In function ‘void loop()’:
RTCTFT160.ino:81:52: error: call of overloaded ‘String(float&, int)’ is ambiguous
RTCTFT160.ino:81:52: note: candidates are:
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:192:0,
from /home/tzmijevski/sketchbook/libraries/Adafruit_ST7735/Adafruit_ST7735.h:28,
from RTCTFT160.ino:1:
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:70:11: note: String::String(long unsigned int, unsigned char)
explicit String(unsigned long, unsigned char base=10);
^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:69:11: note: String::String(long int, unsigned char)
explicit String(long, unsigned char base=10);
^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:68:11: note: String::String(unsigned int, unsigned char)
explicit String(unsigned int, unsigned char base=10);
^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:67:11: note: String::String(int, unsigned char)
explicit String(int, unsigned char base=10);
^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:66:11: note: String::String(unsigned char, unsigned char)
explicit String(unsigned char, unsigned char base=10);
^
+Thiago Rodrigo Lóss Zmijevski I have the same problem
+Hgjfbz F nombre
It does work under the Windows version of the IDE.
+Hgjfbz F nombre
After updating the IDE to the latest version (1.6.8) it did work under Ubuntu as well!!!
Great project but i get an error code "redefinition of 'Adafruit_ST7735 tft'" Can you solve the problem
great
+Maxwell Moojw Thanks!
sorry sir ! this line of code: DateTime dt(2015, 8, 27, 9, 35, 30, 4); I had changed but tft display is not change can you
explan this problem to me please~
Hi friend! My screen is a TFT 2.2" ILI9341; I took your code but is presenting flicker (flashing) on the screen and is not showing the time; you can help me? Thank you
In order the project to work you need to use the 1.8" display I use.
Hello, I built this project and it works great, but I tried everything I know of, which isn't much, to change it from 24 hour clock to 12 hour clock with no success. Can you help me figure how to change it to 12 hour.
Thanks,
Steve
+Steve Tripoli Hi Steve, try a switch case. For example:
switch(hour)
{
case 13: hour = 1; break;
case 14:hour=2;break;
.
.
.
}
where the MOSI pin on TFT?
would be perfect if this had a SD card ready so the data could be pulled off of it, im trying to get one of these for my wife for her class room..
Wait the st7735 has a SD card slot on the back, can this be used for data logging or is it intended for the display?
Sure, we can use the SD card at the back for data logging.
Hola. he realizado el montaje y funciona correctamente, pero cuando saco la alimentación el reloj vuelve a la hora que lo inicie. Me puede indicar como puede mantener la hora al perder la alimentación.
Un saludo
Gracias
+Manel Angulo You have to comment the line of code that sets the time else it will always set the time each time the Arduino starts. That line of code has to run only once.
+ Educ8s.com OK SOLUCIONADO, muchísimas gracias por su atención y pronta respuesta.
Soy un entusiasta seguidor de sus vídeos. Usted puede incluir en este programa con sensores de Humedad y Presión Atmosférica y editarlo.
Me agradaría poder experimentar con ello y tenerlo montado.
Gracias
Un saludo
+Manel Angu Si, voy a hacerlo pronto! Saludos desde Grecia!
+Educ8s.com Gracias lo espero con impaciencia
Un saludo
+Manel Angulo ,,como lo resolviste ? a mi me pasaba con el LCD de 16x2 y luego me di cuenta que al poner en hora no ponia las // delante de los comandos ,,tambien el tema es desconecta los 5v del reloj ,,antes de desconectar el cable de la compu,,gracias
i have exit status 1 error
hi, the link for code seems not found
Sorry for that. It is now fixed! Cheers!
DONDE ENCONTRAR LA BIBLIOTECA SODAQ_ds3231?
github.com/SodaqMoja/Sodaq_DS3231
FUNCIONO BIEN LA COMPILACIÓN SOLO EL SENSOR DE TEMPERATURA QUEDO FUERA DE LO NORMAL POR LO DEL CÓDIGO QUEDO EXCELENTE LO FELICITO Y MUCHAS GRACIAS,
HAY ALGUNA FORMA DE CALIBRAR EL TERMÓMETRO?
EXCELENTE BUEN VIDEO
Please circuit diagram
Can this be on 12hr mode?
Yes of course!
actually, I am not sure it can be 12hr mode.
per sodaq_ds3231.h in library line 65
"// Only 24 Hour time format is supported in this implementation"
I would LOVE to have this display in 12 hour mode but just not experienced enough to create a work-around..
thinking there is a simple conversion that can be made prior to output that would work..
please help if you have some time to look at it again.
hello again, I tried the switch case, but it didn't work I think because the hours is a string.
String hours = String(now.hour());
int(hours);
switch(hours)
{
case 13:hours=1;break;
case 14:hours=2;break;
case 15:hours=3;break;
case 16:hours=4;break;
case 17:hours=5;break;
case 18:hours=6;break;
case 19:hours=7;break;
case 20:hours=8;break;
case 21:hours=9;break;
case 22:hours=10;break;
case 23:hours=11;break;
case 24:hours=12;break;
}
}
if(now.minute()
+Steve Tripoli Yes, I just gave you the idea, not a working code. You can create another int variable for hour, use it for the switch - case and the convert it to a string in order to print it.
You do a nice job is wind direction next?
Educs, i would like to edit the Time with push button. How can i do that?
+Marc Paradis That's more complicated. I will prepare a video on that.
+educ8s.tv ,
br-arduino.org/2015/09/arduino-interrupcoes-relogio.html
+Marc Paradis br-arduino.org/2015/09/arduino-interrupcoes-relogio.html