8
\$\begingroup\$

I need to design a timing circuit. After a duration of 6 months a LED must come on. The LED can then be turned off at the press of a button and the 6 month count-down must begin again. Anyone have any idea where I would start? Is a 555 timer capable of doing something for a time of this duration or would I need somthing else? Any help would be greatly appreciated..

[added] it will be used as a reminder to change a water filter so it should be powered off a small battery..something small, easy to setup and with a low current consumption would also be handy..any help appreciated..thanks for the previous input..

\$\endgroup\$
  • 7
    \$\begingroup\$ Does this have to be portable, or will it be connected to an AC supply? If so, you could count 60 (or 50) Hz crossings, which are very accurate over the long run. \$\endgroup\$ – tcrosley Oct 12 '10 at 15:28
  • 1
    \$\begingroup\$ Don't try using the AC supply - you can't count on the power staying on for 6 months straight without taking extraordinary measures. \$\endgroup\$ – Michael Kohne Oct 12 '10 at 17:45
  • 1
    \$\begingroup\$ I have seen this application used in water filters to alert you when the filter needs to be replaced. They can run for many years with out having to replace a battery so I assume they are able to do it very easily. \$\endgroup\$ – Kellenjb Oct 12 '10 at 18:03
  • 3
    \$\begingroup\$ @Vincent Conlon: What precision do you need? In the water filter example, I am sure the precision is horrible, but I don't think anyone cares if you get alerted a week early or late. \$\endgroup\$ – Kellenjb Oct 12 '10 at 18:06
8
\$\begingroup\$

Based on this answer, I think a 555 won't work. You'd need a massive capacitor and a huge resistor, and the accuracy would be terrible.

I'd recommend using the simplest of 8-bit microcontrollers. You'd have to handle the numbers carefully, but a PIC16F84A (or an Arduino, or lots of other similar devices) could do it. I might set up a 1 second timer, and then count 15778463 timer expirations, storing the count in a 32-bit variable. (For Arduino 32-bit variables, see http://www.arduino.cc/en/Reference/Double)

\$\endgroup\$
  • 2
    \$\begingroup\$ Um...double? Wrong. You mean long, or preferably int32_t. \$\endgroup\$ – Nick T Oct 12 '10 at 20:16
  • 8
    \$\begingroup\$ AH, you're right. Rude, but right. \$\endgroup\$ – pingswept Oct 12 '10 at 21:09
  • 12
    \$\begingroup\$ Um... int32_t? Wrong. You mean uint32_t, unless you're expecting time to go backwards too. \$\endgroup\$ – Toby Jaffey Oct 13 '10 at 8:18
  • 1
    \$\begingroup\$ @Nick while technically true most implementations of C on 8 bit micro-controllers do not follow ansi defined type promotion. They often just use the largest type in the statement. \$\endgroup\$ – Mark Oct 23 '10 at 18:35
  • 1
    \$\begingroup\$ Bear in mind that without an RTC or an external oscillator, the accuracy here will be fairly awful, especially over such a long time period. And don't forget to periodically write the current count to EEPROM! \$\endgroup\$ – Nick Johnson Aug 10 '11 at 4:33
8
\$\begingroup\$

Like pingswept, I'd recommend a cheap microcontroller. The TI Launchpad MSP430 comes with a 32.768KHz crystal and supports very low power operation.

This project is not far off what you want: http://kennethfinnegan.blogspot.com/2010/08/msp430-bicolor-led-clock.html

\$\endgroup\$
6
\$\begingroup\$

First off, it's an interesting little project, but you're using the wrong tool really. This is something which has been solved since centuries using a tool known as an agenda.

agenda

Let's do it electronically anyway, just for the fun of it. You don't seem to need a very high accuracy; it won't matter if the filter is replaced a day earlier or later (a day in 6 months is 0.5% accuracy). I make a note that it has to run off a battery, so it has to be real low-power.

I'm going to start with changing the requirements. You want a LED as indicator, but your device would have to be rather prominently present in the living room if you want to be sure to see the lit LED, even when flashing. (Let's note that flashing may be necessary to avoid that the battery is drained before the LED gets noticed; after all the LED may go on just after you went to bed.)
I would use a buzzer instead of a LED. And to prevent that the buzzer sounds in the middle of the night we'll need accurate time-keeping which will also tell us the time of day. That means a 555 is out, and we'll have to rely on a microcontroller. A small microcontroller costs less than 50 cent, and running on a 32.768kHz crystal doesn't consume much (for one project I used an MSP430F1101 which consumed less than 4\$\mu\$A), and has minutes accuracy over months.
But that would mean you have to be careful of the moment you start your timer, and that's not very user friendly.
Enter the atomic clock receiver. DCF77 in Europe and WWVB in North-America broadcast time as 1 second pulses. The microcontroller can run on an internal RC clock (doesn't have to be that accurate) and keep time based on the received time code. To save power you could have the atomic clock receiver wake-up the microcontroller on every 1 second pulse, so that the controller can update time and date, and go back to sleep. You could program the microcontroller to give a signal at 14:00 on the first saturday following the timeout, for example.

Then there's the power supply. The microcontroller solution needs only a few \$\mu\$A, so a CR3032 lithium cell (good for 500mAh) may last several years. But the time between events is so long that eventually the battery will give up halfway a 6-month period, and the filter-replacement-due-time will pass unnoticed.
I would suggest a mains powered device, using a small transformer; I have a bunch of 6V, 0.35VA transformers for this kind of small products. Since a long period like 6 months doesn't guarantee that there won't be a power outage you'll need a battery/capacitor backup. Here in Belgium we have less than 1 power outage in 2 years on average, the longest I experienced lasted 2 hours. I wouldn't use a battery, at least not a primary cell. A rechargeable will do, but let's use a supercap instead. A 0.1F cap will keep a 10\$\mu\$A device running for more than 24 hours. The microcontroller may monitor the mains power, so that, if the 6 months timeout would occur during a power outage, the microcontroller can postpone the signal until power is restored.

For an application which requires so little user interaction it's still useful to have some kind of feedback. You could flash a LED once every second to indicate the timer is running, and if you care to make it a luxury version could display the remaining day count on a three digit LCD or LED display.


edit (re Ben's comment)
In the past I used these small DCF77 receiver modules from Conrad.

dcf77 module

I live in Europe, hence DCF77, for WWVB (North-America) similar modules exist.
Connections are simply power supply (1.2V to 15V) and 2 DCF77 outputs, one non-inverted, one inverted. The outputs are open collector, so with the right pull-up suitable for whatever voltage the microcontroller run on.


Further reading:

\$\endgroup\$
  • \$\begingroup\$ Nice approach, but there's a huge glaring omission when it comes to the hardware you'd use to receive the timestamp broadcasts. \$\endgroup\$ – Ben Voigt Aug 9 '11 at 15:05
  • \$\begingroup\$ @Ben - fair enough. Added to my answer. \$\endgroup\$ – stevenvh Aug 9 '11 at 15:28
  • \$\begingroup\$ Your link for "similar modules" is dead. Could you provide a model number and/or update your link? \$\endgroup\$ – bcsteeve Mar 9 '17 at 19:16
6
\$\begingroup\$

Arduino (or other microcontroller) with a DS3231 super accurate real-time clock IC. When the button is pressed, the time and date is stored in memory - the MCU can loop around checking the date and time and turn off when ready; or when button pressed it restarts etc.

\$\endgroup\$
  • 1
    \$\begingroup\$ +1 RTC for sure. DS3234 if you'd rather use SPI instead of I2C. \$\endgroup\$ – Craig Oct 3 '11 at 1:04
  • \$\begingroup\$ That is a great chip. Let it keep track of all of the tedious counting and timing for you. Much easier than counting pulses and doing all the conversions to real time. \$\endgroup\$ – captncraig Oct 3 '11 at 4:25
  • \$\begingroup\$ 2 ppm surely is nice, but overkill. A 20 ppm standard crystal will do here: I don't think the exact minute to change the water filter is important (as long as it's not in the middle of the night). \$\endgroup\$ – stevenvh Jul 5 '12 at 9:41
4
\$\begingroup\$

The tricky part would be precision over such a large time interval.

You may want to consider a crystal oscillator combined with a cascade of binary counters. See 4060 datasheet for examples.

\$\endgroup\$
4
\$\begingroup\$

I think you should use a 555 timer to time for 16 minute intervals, and then feed that into a counter circuit of some sort to divide it. A 14-bit counter would make the interval about 6.06 months.

\$\endgroup\$
  • 3
    \$\begingroup\$ You shouldn't use a 555 with a period of 16 minutes; better to cascade two counters and run the 555 at a more-sane frequency (kHz or so). Better to not use a 555 at all if you care about tolerance much. \$\endgroup\$ – Nick T Oct 12 '10 at 20:13
  • \$\begingroup\$ A CMOS 555 will easily run for hours. The OP seemed to suggest accuracy was not an issue. \$\endgroup\$ – Thomas O Oct 12 '10 at 20:29
  • \$\begingroup\$ Even if accuracy was not an issue a 555 running over such a long time span will be so wildly inaccurate as to make it essentially an arbitrary time. I like the MSP430 solution much better, cheap and the supplied crystal will be reasonably accurate over the required timespan. \$\endgroup\$ – ttt Oct 14 '10 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy