Time and Ethernet

Arduino DUE, Windows 10

I selected the DUE because I need 10 analog sensors. I am creating a device mounted in a box next to the air conditioning compressor. I use Ethernet to monitor the device and capture readings, pressure, temperature, voltage, current. It is not monitored all the time presenting the need for the DUE to know and remember time of day. I will eventually add an SD card to the Ethernet shield and log information when not actively monitoring the DUE

My google searches reveal that Adafruit has a battery module with a 2032 battery. Will that supply power to the board such that the DUE can keep time? If not, what do I need?

What is the most simple method to set time on the DUE. If need be I can write an app on my computer. But, forum readers probably know more about this than I so here is a good place to stop.

Links to articles are preferred and I prefer to read articles rather than watch videos.

bkelly:
My google searches reveal that Adafruit has a battery module with a 2032 battery. Will that supply power to the board such that the DUE can keep time? If not, what do I need?

Clearly a 2032 coin cell cannot possibly "power" a DUE, so not sure what you mean here. :cold_sweat:

Cite (Web link) the Adafruit module and we can talk. :grinning:

Since the device is being sold, the thought is that the board might have a clock only chip that keeps time. I will look some more.
Any suggestions as to the best path to take?

bkelly:
What is the most simple method to set time on the DUE.

It sounds very much like you are trying to re-invent the wheel. All you need do is do what everybody else does - add a Real Time Clock module - probably a DS3231. The only two considerations are

  1. The module comes with its own battery backup - I don't know of one which doesn't
  2. It is suitable for use with your Due - they probably all are.
    bildr Do You Have The Time? DS1307 RT Clock + Arduino - bildr

I wouldn't go that far always. It can be nice to have an integrated RTC to keep module count down. I don't know about the production Due, but the unknown Due that I have, has no parts installed on the 32kHz crystal circuit pads. Boo. IIRC there is some library support for it though. I have so far, STM32F1 and F4, some boards with an onboard battery, yay! Also I think some of the newer Arduino models must have an integrated RTC. It's starting to become standard on MCUs.

So in practice, with the hardware frequency calibration built into the STM's, installed in desk clocks, they are very stable though I wouldn't claim as much as the DS3231 but close. I think it's really because the temperature doesn't change much day to day or hour to hour (in my home). But that is without temperature compensation which in theory could be done in software as well because you can read the chip temperature with a few register pokes.

In fact, relying on tuning bare crystals has been done and I copied it to verify. :slight_smile: It involves copper foil capacitors that you carefully trim down to achieve an exact capacitance to tune the crystal. This is on cheap market store dollar digital clocks. Again, once you get it, it's amazingly stable but temperature changes make it drift. I'm not claiming that's the whole story, there's crystal aging to consider and so on.

The ZS module with DS3231 that everyone knows, has no battery charging problem if run on the Due's 3.3V, and also it is quite comfortable communicating at those logic levels. It's actually better because it means the voltage will be more the same between standby and powered up modes. Hence a more stable voltage for the timing circuit.

Personally, I would try and see what happens, except in my case I know I'd have to source the parts which is a too much of a headache right now.

aarg:
Also I think some of the newer Arduino models must have an integrated RTC. It's starting to become standard on MCUs.

As one might well expect. :roll_eyes:

Reminds me of the 1980s where on my Motorola 6809 system - and the first IBM PCs - the very first thing you did on startup was set the date. Time was more airy-fairy but of course, the first critical add-on for the PC was indeed, the clock.

Now wile many basic microcontroller projects do not care about time, in fact, many either do, or would benefit greatly from knowing the time.

Chicken coop doors. :grinning: