I am looking for timer which will wait for event 20 to 30 days. if it didn't received a reset command (May be Digital Out or simple 5v signal), it will switch on another circuit(i.e to switch on Led)
Constrains are :
It is battery powered (ideally it should run on coin cell battery for at-least 6 months ).
and circuit must be as little as possible
Design Options are :
RTC and low power micro controller
using timer + interrupts in low power micro controller with deep sleep mode
555 timer + 16 bit counter
Can anyone suggest me Best Design Approach and Why ??
In My View the problem with three approaches are :
for 1 : RTC + Microcontroller is a over kill, RTC isn't really required here since we are not looking for date and time
for 3 : Power Consumption is very for 555 + timer approach. is there anyway i can achieve low power consumption ? any references to calculate the power consumption ? any design without micro controller is more preferrable
for 2: i didn't find any low power consumption boards in arduino series. any suggestions for low power micro controller and implementations are welcome.
How much drift is acceptable? If you need to time this event accurately enough that it doesn't drift 6-12 hours over a year, then you need an RTC.
If it doesn't matter if the event happens at day or night, but plus-or-minus half a day is acceptable, then I would go for the Arduino solution using the watchdog timer to keep the Arduino asleep most of the time. Nick Gammon has a good page on this subject. It should run for a few years on a coin cell battery if you get it right.
The 555 solution won't work well for intervals of >15 mins , and needs to be powered at all times for this to work.
RTC gives high accuracy but don't they also have to be powered at all times?
Option 2 makes the most sense, power wise.
If you need accurate timing and have WiFi available you could use NTC instead for accurate timing. When the device thinks it's getting close to the wake-up time it may do an NTC request to correct itself. An ESP8266 should be able to do this and run off a small battery for ages.
Just use a simple microcontroller running its own clock program.
A promini, or a standalone 168 or 328 design with crystal, 2 22pF caps, 10K resistor, 3-4 0.1uF caps.
Code like this, adjust the alarm code at the end
unsigned long currentMicros;
unsigned long previousMicros;
unsigned long elapsedTime;
// Initial time to start, 00:00:00 with 0 years, 0 days.
// adjust as needed.
// Get this working, then more display code if needed
byte hundredths;
byte tenths;
byte secondsOnes = 0;
byte oldsecondsOnes;
byte secondsTens = 0;
byte secondsTOtal;Â Â // added for alarm check, see below.
byte minutesOnes = 0;
byte minutesTens = 0;
byte minutesTotal;Â Â // added for alarm check
byte hoursOnes= 0;
byte hoursTens = 0;
byte hoursTotal;Â Â // added for alarm check
int days = 0; //
byte years = 0;
void setup(){
Serial.begin(115200); // make serial monitor match
Serial.println ("Setup Done");
}
void loop(){
currentMicros = micros();
// how long's it been?
elapsedTime = currentMicros - previousMicros;
if ( elapsedTime >=10000UL){Â // 0.01 second passed? Update the timers
previousMicros = previousMicros + 10000UL;
hundredths = hundredths+1;
if (hundredths == 10){
  hundredths = 0;
  tenths = tenths +1;
  if (tenths == 10){
    tenths = 0;
    secondsOnes = secondsOnes + 1;
    if (secondsOnes == 10){
      secondsOnes = 0;
      secondsTens = secondsTens +1;
      if (secondsTens == 6){
        secondsTens = 0;
        minutesOnes = minutesOnes + 1;
        if (minutesOnes == 10){
          minutesOnes = 0;
          minutesTens = minutesTens +1;
          if (minutesTens == 6){
            minutesTens = 0;
            hoursOnes = hoursOns + 1;
             if (hoursOnes == 10){
               hoursOnes = 0;
               hoursTens = hoursTens +1;
                if ( (hoursTens == 2) && (hoursOnes == 4){
                   hoursOnes = 0;
                   hoursTens = 0;
                   if (days>1){
                     days = days-1;
                     }
                   else {
                    days = 365;
                    years = years - 1;
                    }
                 Â
                   } // 24 hr rollover check
                 } //hoursTens rollover check
               } // hoursOnes rollover check
            } // minutesTens rollover check
          } // minutesOnes rollover check
        } // secondsTens rollover check
       } // secondsOnes rollover check
     } // tenths rollover check
   } // hundredths rollover check
} // hundredths passing check
if (oldSecondsOnes != secondsOnes){Â // show the elapsed time
oldSecondsOnes = secondsOnes;
Serial.print (years);
Serial.print(":");
Serial.print(days);
Serial.print(":");
Serial.print(hoursTens);
Serial.print(hoursOnes);
Serial.print(":");
Serial.print(minutesTens);
Serial.print(minutesOnes);
Serial.print(":");
Serial.print(secondsTens);
Serial.println(secondsOnes);
} // end one second check
// add alarm check
if ( (hoursTotat == 12) && (minutesTotal == 0) && ( (secondsTotal >= 0) && (secondsTotal <=10) ){ //12:00:00 to 12:00:10
if ( (days & 0b00000001) == 1) { // 1 = odd days, 0 = even days
digitalWrite (2, HIGH); // odd day turn on
}
else {
digitalWrite (4, HIGH); // even day turn on
}
else {
digitalWrite (2, LOW); // outside of time window turn both off
digitalWrite (4, LOW);
}
} // end loop
anilkunchalaece:
can you please share more details about it ?
http://esp8266.com/
And Google of course - I haven't built such a project but read more than enough to know it's possible. NTP code is also readily available, forgot where I got mine. The ESP is famous for very low power use in deep sleep.
Virtually any CPU in low-power deep sleep mode.
DS323x in low-power sleep mode.
Use RTC alarm as an interrupt to wake the CPU and perform the task.
Same day solution.
User interface of your choice... probably serial (no buttons or display) if you only need to adjust it every xx weeks.
Forget the 555!! Any 555 solution, even with cmos, is always active and will typically require more power than a proper rtc/microP solution
There isn't enough information to go much further.
Is this a one time use?
Does the timeout need to be adjustable?
What does it do when it times out?
Is it driving an external device? LED?
How is it reset?
Is size a factor? Smaller = better?
lastchancename:
Virtually any CPU in low-power deep sleep mode.
DS323x in low-power sleep mode.
Use RTC alarm as an interrupt to wake the CPU and perform the task.
Thanks (i think two controllers is overkill.. but this is a simpler task than other like mentioned, but i am looking for optimum solution ).
Are they programmable RTC's ? I did google'd it but didn't find any.
It seem like we are have to pull out of you what is acceptable.
It is difficult to pull hens teeth because they don't have teeth.
When you decide to do a project, put 'everything' down in detail and present it in your request.
It is very difficult for a diverse crowd to guess what is in your mind so tell us what is actually there.
The more information you give us, the better we can help you.