Arduino Timer?

Hello,

I want to make something for my DUE Arduino that displays how much time has elapsed since a certain point. For example, if I have planted some carrots, I want to start the time monitor when I sow the seeds and be able to see if I check the timer how long the seeds have been growing. I want to be able to see this physically, outside of the Arduino. I'm quite new to Arduino so any help is much appreciated.

Regards,

Valkiyare

Is that all the Due will be doing or is this timer just one part of the project?

Pick a display that suits you for size/budget/energy consumption like seven segment/dot matrix using LED/LCD/OLED, then find an appropriate library for that device. The library should have example code shipped with it.

pert:
Is that all the Due will be doing or is this timer just one part of the project?

It's part of a plant carer project, it waters the plants too. I want to see how long the plants have been growing to monitor their progress.

Electromania: Clock and calendar using Arduino due internal RTC and I2C LCD display :slight_smile:

Will your project be connected to the computer network?

The reason I ask is that typically if you want to do accurate timing with an Arduino board you need to use some sort of an external clock since the oscillator used by the Arduino will not give you very good precision. A common solution is to add an RTC (real time clock) module. But if your project has Internet access you can use NTP (Network Time Protocol) to get the time from a server and there's no need for an RTC.

If you don't mind the timer being off by some percentage points (varies from one board to another and with temperature) then you can just use millis().

Note that most arduino DUE boards (although not all) have an external slow clock Crystal. This external Crystal is not as accurate as a temperature compensated Crystal, however IMO this is more than sufficient to monitor plant growth.

For growing times, which are measured in days or weeks, the internal timer will be off by minutes in the end. But that doesn’t really matter for this application.

What is more important: you must know the actual (wall clock) time and date as you will want to save a timestamp in EEPROM or external memory, so in case you have a power outage for whatever reason you don’t lose this timestamp (tip: use a UNIX timestamp, seconds since epoch, so you just need 4 bytes to store it and you can really easily do calculations with it).

To get this time, use an RTC (with backup battery) or connect to the Internet and get the time over NTP.

Valkiyare:
It's part of a plant carer project, it waters the plants too. I want to see how long the plants have been growing to monitor their progress.

Does it water the plants at specific time intervals?

What are you using to keep track of time?

A Due for this job is like using a dumptruck to carry a candy bar. Even a cheap Nano would be overkill but far less of a waste.