I added the com port as an argument and also added 1 second to the seconds to more accurately sync.
So I used DS3231RTC (real time clock). 2 months ago This Instructable is strictly for the purpose of setting the correct time on a Real Time Clock board using an Arduino UNO.
Reply
A tiny computer shaped LCD clock that came with a subscription to a magazine many moons ago. So sometimes you have to run it twice. 4 years ago
Reply
Not "made for DS3231" but works exactly as indicated with it with the additional header as noted below. Note that it waits for any character to be sent from the serial monitor before actually preceeding to set the RTC. Before it can be useful, however, it needs to be set to the correct time. 1.8.5 on Windows 10.
Thank you so much.
Answer You need to change your arduino COM port. 3 years ago What followed were hours of cussing, modifying sketches till their authors would never recognize them should they see the results, all for nothing! Damn little clock showed ANYTHING but the right time! 4 years ago I ran it as instructed, everything is synced except for the first two digits of the year.
If you see the above picture as a result, including the time and date with some prefixes, that means the batch file is run completely.Now if you write "B," on the Arduino's Serial. 5 months ago I opened the sketch exactly as you described. For the people who have the same error this is my bat file. It will set the time & then display the time in the serial monitor from DS3231.
Before it can be useful, however, it needs to be set to the correct time. 11 months ago 1 year ago set ldt=%%jset /p x="S%ldt:~12,2%,D%ldt:~10,2%,H%ldt:~8,2%,"
Worked like a CHARM! 4 years ago
Thanks for the Time Set answer. Then I upload the sketch to the board. Before that, right-click on it and modify it. There are other very informative guides about RTC boards, but they contain a lot of extra information that you may not want to read through.
I searched for some codes to send the PC time to Arduino and I found something and I want to share it as my first instructable.First you have to upload this program to your arduino. Thanks 'yosoufe' for the excellent program and 'mennotjer' for the correction which, with me, was not working properly either. I used the two files here as they were. 2 years ago Maybe your Serial communication of your arduino IDE is open.
In the circuit there are 3 push buttons: B1, B2 and B3. 3 years ago The DS3231 is a highly accurate, widely used Real Time Clock (RTC), as are its slightly less accurate counterparts, DS3107 and DS1337.
Code Explain of DS3231 Time Set Arduino The code is a very simple one.
Mine was COM3. To send the PC time, you just need to run this batch file. I have downloaded the code.
!I had some problems running the bat file, somehow it gave an error when the if statement was executed. 3 years ago In the previous picture you can see a Raspberry Pi header attached, this is because I also use the same setup for a Pi too! DS3231 is a low-cost, extremely accurate I2C real-time clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO) and crystal.
Excelent program works perfect Thanks from Guatemala!!! You won't get a lot of background in this Instructable, but hopefully, if you've come here looking to set your DS3231 to the correct time, you'll find what you need!That's it! You need to change your arduino COM port. Try to debug.
The DS3231 interrupts the microcontroller when there is an alarm (alarm1 or alarm2).
Do not forget, your PC's serial should be free. before that right click on it and Edit it. But it has not been useful to me for setting the time on my rtc clock. Please close it first and then run the batch file.This batch file is not at all perfect.
It works.Make sure you have both the TimeLib.h and Wire.h librarys already installed.
The Time Clock Module ( or DS3231 ) is a module that measures the time, dependently or independently of his Arduino card through of his cell.
(without quotation mark)To send the time from PC, You just need to run this batch file.
The device incorporates a battery input, and maintains accurate timekeeping when main power to the device is interrupted.
11 months ago
I built a little clock out of what was once, well a clock. Note you need to replace COM11 with your own COM port number.for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.'
I really do not know.
Well I had tried everything else, why not? What could cause this?
Maybe your serial communication from your arduino IDE is open. I wanted to synchronise this RTC with my PC. Thanks for the correction; It is now working correctly. These buttons are used to …
You will see the same time as your PC. Once I do get a response in, it automatically sets the year to '13' which means 2013 then asks me for a month, when I type '06'/'6' it responds by making the month 48 or 50 sometimes.