Simple Time Data Logger for Newbie

I need a device that records time (unix time or whatever) whenever it is on. That's it.

In python, which is the only programming language I know, the code would look something like this:

#!/usr/bin/env python

import time

interval=1

while True:
    t = time.time()
    f=open("myfile.txt", "a")
    f.write(str(t) + "\n")
    f.close()
    time.sleep(interval)

I never did any Arduino before. Is it possible to do this so that the device and the code is started whenever it is provided with electricity and stopped whenever electricity is cut off. If there is a simple solution, what hardware do I need?

Thanks!

You need a simple Arduino and an RTC device (like a DS1307) which is battery backed to keep the time while not being powered externally. Some storage device is needed too, an SD card is probably the easiest to use. A relatively cheap solution to include all that is the Seeeduino Stalker from Seeed Studio (http://www.seeedstudio.com/wiki/Seeeduino_Stalker_v2.2).

Arduinos are programmed in C++, it's not that much different from Python, just a few braces and semicolons more and some colons less. The only concept that you have to learn is typing, meaning that you have to declare variables to being of a defined type before you can use them.

pylon,

Seeduino Stalker looks like a decent solution. Your link provides detailed explanations for how to use it so I think I'll place an order and try it out. It's a bit overkill but certainly a way of learning. Thank you for the advise!

If anybody has any more tips that's also appreciated. Ideally, it would be even simpler and cheaper than Seeeduino Stalker.

The cheapest will be to take an ATmega328, a crystal, a few capacitors, a DS1307 and an SD socket and put that together on a PCB yourself. Using a Seeeduino Stalker is much simpler, though.

In that case I think I'll try the Seeeduino Stalker first and then perhaps try to reproduce it the cheap way. Thanks!