missing pulse detector

I have a stream of infrared pulses coming in to a sharp type detector. I get a negative going pulse from the detector every 45 mS ( I need to play with this timing later, but it is a good guess )
It is a 600uS pulse, so I thought of using it for the interrupt so as not to miss it.

I want to pick up that a pulse is missing ( i.e. the beam is momentarily broken )

The unit needs to be battery operated, so I would like to have the Arduino ( chip ) go to sleep for 40 mS, then wake up and check for an interupt within the next 20 mS say, and either go back to sleep, or light an LED for 4 seconds if no interrupt occurs.

This is the different to what I normally do with sleep mode. I guess I need the watchdog function to automatically wake after 40 mS ?
Below are the things I normally call for sleep ( but now I want the interupt to put it to sleep instead of waken it )

My question is, before I waste time , how much time will it take to sleep and wake up again ( is it worth the power saving ? )

void enterSleep(){
  attachInterrupt(0, pin2Interrupt, LOW);
   set_sleep_mode(SLEEP_MODE_PWR_DOWN);  // setting up for sleep ...
  sleep_enable();                       // setting up for sleep ...
  ADCSRA &= ~(1 << ADEN);
  PRR = 0xFF;
  sleep_mode();                         // now goes to Sleep and waits for the interrupt
  /* The program will continue from here after the interrupt. */
  detachInterrupt(0);                 //disable interrupts while we get ready to read the keypad 
  PRR = 0x00;
  /* First thing to do is disable sleep. */
  sleep_disable(); 
   }

What I would do is to make a missing pulse detector from a 555. Just feed the pulses into a transistor connected across the capacitor on a 555 connected as a monostable. Then when it times out you can have that wake up the arduino.

What fuse settings do you have? Some of them require 258 clock cycles from power-down (16 mS).

Thanks Mike,

Prototype Mk II has a 7555 , one half as you described, and the other as the timer for the alarm, but now I am thinking of sending a wireless signal to an alarm panel indoors, so by the time I add a HT12 encoder chip, I thought I could do it all with just the 328 chip.. although the HT12 draws very low current , I could have it and the Tx powered from the 555 output, so there would be no quiescent current there ..

My projects tend to jump around at first :slight_smile: , that's why I was wondering about the time to sleep/wake up, and if it is even worth it, before wasting time building Proto MkIII ( Mk I had a hex scmitt inverter )

I dont know about the fuse settings Nick, presumably its the default, ?