1
eleksir a212bbc28a Port changes from photoresistor branch
* Poll RTC by trigger, set via ISR
* Change blink state by trigger, set via ISR
* Set time compensation trigger in ISR
* Refresh clock by timer
* Re-calculate displayed time only ater rtcsync or when time adjusted by buttons
* Simplify draw algo
2019-08-17 11:50:23 +03:00
2019-02-23 19:01:52 +03:00

Simple Clock

Just clock that shows time, accurately.

Component base is very simple:

  • Arduino NANO v3 chinese replica (on Atmega-168 chip)
  • 7 segment 4 digit LED indicator with common anode, FYQ-5641BD-21 (red LEDs)
  • 8 resistors that limiting current on LED segments, 330 Ohms, 0.25 watts
  • RTC Module GEEGROW with DS1307 chip (very basic, only RTC chip, quartz resonator, button battery, no additional memory chip)
  • 5x7 cm single side prototyping board
  • usb phone charger as power supply
  • 2 push buttons
  • 1 on/off switch
  • Gainta G521G enclosure (92x66.5x28мм)
  • 5m power cord

Optionally you may need:

  • Capasitor with well capacity if your charger has small capasitor on output
  • Fuse, to protect your device
  • DC/DC transformer if you have power supply that gives more than 5 volts or less than 4.5 volts (this will give additional surge protection if your power supply dies, this can happen after 3-5 years of uninterrupted work)

Additional Notes:

My RTC module is not very accurate due to bad quartz chrystal calibration, looks like it is not exactly 32768 Hz and clock runs faster than it should be, giving about 5-8 seconds runaway per day. So i have to implement time correction in software (temperature changes during day/month/year is not very big - about 10 degrees Celsius, so we can use software compensation without thermal compensation).

This project split into 2 branches:

  • default that contains generic clock without any additional elements
  • photoresistor that contains additional hardware - photocell bridge - and software algorithm that compensates ambient light sensed by photocell basing on LED display charachteristics.

Stable tags for branches:

v1.5 - default v1.4 - photoresistor

Description
Simple Arduino-based clock.
Readme 1.5 MiB
Languages
C++ 100%