Pages: [1]   Go Down
Author Topic: Arduino Read system date and time  (Read 1929 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 121
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm trying to find out how to get Arduino to read the system date and time so i can then display it on an LCD.

Would be grateful for any help.

Rich.
Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 12
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Write a program that runs on your computer in a language you know.
Make it send the system time over the serial.
Have arduino listen for input, and display it.

OR use this: http://www.mikmo.dk/gobetwino.html
 smiley
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

or you can use this library to manage date and time: http://www.arduino.cc/playground/Code/DateTime

It can be set using a program running on the PC (a Sketch for doing this is provided in the download) or you can use a few buttons to set the time.

If you don't mind connecting some additional hardware you can use a external real time clock: http://www.flickr.com/photos/sjunnesson/3344651050/
« Last Edit: October 17, 2009, 02:01:19 pm by mem » Logged

Boston, MA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1024
wiblocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you decide you want a hardware solution take a look at the
schematic in my NB1A datasheet  -- http://tinyurl.com/y8exe7k
I use the DS1337 which has two time-of-day interrupts.

There are some software examples in the application hint section.

(* jcl *)
Logged


0
Offline Offline
Full Member
***
Karma: 0
Posts: 121
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Mem,

I tired the DateTime library. The file comes in 2 different libraries DateTime & DateTimeString.

The DateTimeString libaray seems to be Valid, but arduino does not see the DateTime library as being a valid libarary file.

Rich
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
… arduino does not see the DateTime library as being a valid library file.
Make sure that the DateTime files (DateTime.cpp and DateTime.h) are in a directory called DateTime that is a subdirectory of your libraries directory.

Are you getting an error message and if so what is it?
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 121
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm still struglling with this, I've used the Exaple sketch and i've madre sure the libraries are in the right place.

The sketch uploads ok, with no errors, but when i run the serial monitor i get nothing being displayed at all.

All i want to do i ready the time and dat from my laptop.
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ribuck, are you running the Processing sketch on the computer that the arduino is connected to?  Arduino runs a sketch called DateTime.pde that receives messages from your computer with the system time. These message are sent from a Processing sketch called SetArduinoClock that reads the system time when the Processing sketch is clicked and sends this to Arduino . Are you running SetArduinoClock on your computer (its in the examples/Processing directory)?  
Logged

Pages: [1]   Go Up
Jump to: