0

I am working on development of alarm clock using Arduino.

No doubt RTC will be the best but it increases the Price of the project. Also I opened a digital clock (which I purchased online) and I see that there is only one IC (obviously it is covered with something black wax). But there was that one patch only. So it seems it used only a controller or RTC. But with only RTC its not possible to control LCD. So it must be only a microcontroller

Now I have three options for maintaining time

  1. I use RTC like DS3231
  2. I use millis() function
  3. I use timer and timer interrupts of micro controller for free running timer.

Can I get accurate time using micro controller.

1
  • 1
    It depends, can you show us a photo of your arduino board? A 16MHz resonator is not accurate, but a 16MHz crystal is pretty good. You don't need interrupts, the millis can be just as accurate as the 16MHz crystal/resonator (when the sketch uses millis in the right way). The time library can be used with millis, and the time library can be used with the ds3231 as well, so it is easy to upgrade: github.com/PaulStoffregen/Time The time library works with the TimeAlarms library. If you want only a clock with hours, minutes and seconds, then you can use millis and write code for it yourself
    – Jot
    Commented Mar 30, 2019 at 7:10

1 Answer 1

2

I see from eBay that you can get the DS1307 for around 10 cents. Is that really too much to pay? You also need a crystal and a backup battery (eg. CR2032). Without a battery the device cannot possibly remember the time if it is powered off.

If your device is battery powered then you could conceivably just use millis(), however you would need to have a way of setting the time. The resonator used on a Uno is not as accurate as a crystal, however that might be good enough depending on your project.

If you are trying to save money I wouldn't use a Uno or Micro, but the bare chip, with a few extra components (eg. decoupling capacitors, a couple of resistors, and a crystal).

1
  • Yes, I am now making a project with all the available board, just after proving everything I'll go for separate IC's and components.
    – muphy
    Commented Mar 30, 2019 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.