Introduction: Long Duration Timer: Clock Winding-reminder

An extra long duration timer or universal reminder is used as wall clock winding reminder. Project describes circuit with microprocessor Attiny85, which is able to make alarms periodically in hours, days, month's and even longer intervals.

Our family wooden pendulum wall clock, memory of my parents, is about 80 years old. It is still ticking (after I have roughly cleaned them).

The small problem is: The clock must be wind-up approximately every 10 days. I would like to keep it running always and not interrupt in moving. This is reason for reminder project: not to forget to wind it up in the right day.

In adjusted intervals the LED light comes on and blink until push-button is pressed. Light is visible behind front bottom glass of the clock, to remind you wind up clock.

Supplies

Parts are:

  • Attiny 85, tiny microprocessor in DIL8 package
  • DS3231, real time clock module
  • Socket for IC, DIL 8 pins
  • Resistor 10k
  • Push-button , switch
  • LED diode 10mm, white
  • Single row female connector 6 pins, here
  • Universal PCB 3cm x 7cm - optional, or made in PCB shop
  • Battery holder for two AA type or battery holder for one 18650
  • Battery Li-ion 1.5V, rechargeable type AA 2pcs, or battery Li-ion18650

Tools:

  • Soldering iron

Recommended tool:

Step 1: Long Interval Timer

There are a number of different timers available. Timers using the famous 555 chip, transistor flip-flops with big capacitors, IO binary counters and so on. Only a few of them are usable as a long duration timer.

Requirements are:

  • Time interval adjustable in days
  • Precise real time clock
  • Simple technical solution with a few components
  • Low power consumption


The heart of suggested timer is small microprocessor Attiny 85. Time interval could be simply programmed and set to a certain number of days and to exact, given hour, minute and second in that day. As a precise clock is used module of real time clock DS3231. Just three more components complete the simple timer.

Microprocessor is running in two modes: Attiny 85 is in the most time (during long interval) in sleep mode. After adjusted number of days and time, the real time clock DS3231 initiate pin change interrupt and MCU is awakened. LED start blinking, remind that is right time to wind up clock or do something else. This interval is short, it is awake mode, and after pushing button the mode is change back to sleep mode.

SQW pin on the DS3231 provides an interrupt signal (according to alarm conditions) for MCU, pin 6. Communication Attiny 85 to RTC is done by I2C, pin 5 to SDA and pin 7 to SCL. Both pins, 5 and 7, contain internal pull-up resistors. Alarm LED is connected to pin 2 and Sleep button to pin 3 (internal pull-up resistor).

To reduce power, LED1 indicator located directly on module DS3231 should be disabled. Carefully remove diode D1 or its resistor R4. (Circuit diagram for DS3231.) Remove D1 or R4 on module as well. This step disable charging circuit if backup battery is not rechargeable.

After connecting circuit to the power, LED start blink. Push button Sleep must be pressed and device would go to sleep mode. From this moment is interval running according adjusted time, in my case for 10 days. In 10-th day interrupt would change mode of MCU to awake. LED again start blink.

Required voltage is 3 V to 5 V and current consumption is about 0.5 mA (3 V). Two classic powerful 1.5 V alkaline batteries with 3000 mAh can last half an year theoretically. Problem is voltage level. From initial about 1,6V is soon voltage bellow 1.5 V and less than 3V for two cells. This is not enough and alkaline ones I do not recommend.

The best batteries are lithium. One 3.7 V battery can last more than 6 month.

In the last time, there is a new type rechargeable Li-ion AA 1.5 V battery available, with even more capacity than 3000 mAh. Voltage level is stable 3 V during long time f discharge and two batteries can last longer. In describe project I have use Li-ion rechargeable 1,5 V batteries, type AA. If alarm is active, during awake time, discharged battery could be replaced. The current time and all settings remain, thanks to the backup battery.

Step 2: Construction

In my case the Reminder circuit is mounted on universal double sides prototype board. If you want to make it on dedicated PCB, made by PCB provider, separate Gerber files are attached.

Unfortunately, Instructables does not support compressed files ZIP and RAR. Complete Gerber file could not be transfer, for that I have split Gerber to individual files, and these files need to be packed together again. In Windows create NEW folder as ZIP folder and put there all ten files. Zipped Gerber could be checked in some online Gerber Viewer.

Plastic holder for battery is attached by binding tape to PCB. The Reminder is placed inside the Wall Clock or could be placed enywhere.

Step 3: Software

The best way to program Attiny 85 is using Arduino IDE and simple programming tool (link was mentioned in Supplies). I recommend following steps:

In File Preferences, Additional Board Manager must contain URL for Attiny. If not, copy there following link: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Arduino should be connected to Attiny via programmer or without programmer by wires:

  • pin 10 Arduino..........pin 1 Attiny 85
  • pin GND.................. pin 4
  • pin 11...................... pin 5
  • pin 12...................... pin 6
  • pin 13.......................pin 7
  • pin 5V.......................pin 8

Programming procedure is as follows:

  1. Arduino IDE without programming tool, select board Arduino Uno. Choose FILE........EXAMPLES.......ARDUINOISP......UPLOAD
  2. Connect Programming Tool with Attiny 85, select board Attiny 25/45/85, Clock 8MHz, Processor 85. In IDE select TOOLS ......PROGRAMMER "Arduino as ISP", than select TOOLS....Burn Bootloader. Now is Attiny ready for sketch.
  3. Upload tab "Scetch". At first, check if board is Attiny85 and than upload code. Be careful, Upload should be done from Scetch, by "Upload using programmer".

In attached file, there is software code - ino file for the the Reminder.

Adjustment of interval in 10 days is on line 115: "alarmDay = (dayMonth + 10);".

In line 120: "myRTC.setAlarm(DS3232RTC::ALM2_MATCH_DATE, 10, 19, alarmDay);" is set time 19:10 at which is alarm activated in 10th day. For different intervals class variable must be changed according to JChristensen's library for DS3232.

Before programming Attiny 85, there is necessary to adjust actual time for module DS3231. At Arduino web pages are examples how to do it. If you do not want look for it, use DS3231SetTime.ino.

Step 4: Conclusion

Current consumption of circuit is relatively high and could be reduced. Many articles available on internet are concerning current reduction for RTC module DS3231. This way could be interval for battery replacement prolonged.

The Reminder, an extra-durables timer could be used as universal adjustable timer in other applications as well. In that case, especially if interval is longer, do not forgot what for it remind you!?

Anything Goes Contest

Participated in the
Anything Goes Contest