I'm planning on building an LED clock, but I want it to be lit only when I press the POWER button on my remote control. Using an IR receiver, which Arduino sleep mode should I use to reduce the current consumption but still be able to receive this interrupt?

  • 2
    Please be aware that, if you are using an Arduino board -ie you did not build your own- then you have a minimum consumption that you cannot reduce, e.g. due to voltage regulator current leakage, or (for UNO) ATmega16u2 is always running (for USB handling).
    – jfpoilpret
    Commented Dec 29, 2014 at 19:37
  • Also the IR-receiver uses something like a milli-amp. And then there is the power-on led.
    – Gerben
    Commented Dec 29, 2014 at 19:46
  • @jfpoilpret Thank you I'm aware of that but at least I can consume a little bit less during the whole day. Commented Dec 29, 2014 at 20:33
  • You can drive the vcc directly by-passing the on board linear regulator. You can directly drive it with 2(2.8v), 3(4.5v) or 4(6v) for AA's. Note the ATMEGA328 is 6v and TSOP38238 is 2.5 to 5.5v
    – mpflaga
    Commented Dec 30, 2014 at 0:52
  • Related question has an answer by me with example code.
    – Nick Gammon
    Commented Sep 22, 2015 at 5:36

1 Answer 1


I recommend reading ArduinoSleepCode. Where it demonstrates placing the avr into a sleep state and using an interrupt to awake from the sleep state. In your case you can connect the output of your IR demodulator to the interrupt pin, to simular awake.

Ken Shirriff's IR library allows you to use any pin as a receive input, so that you can use INT0 or 1 on D2 or D3. If you need to use a different pin, the Microtheron's github fork uses Pin Change interrupts. (I am not sure if stock sleep.h will awake from PCint, like int0 or 1 will, without tweek. Section 10.1 of data sheet says it will.)

  • You can only wake from INT0 and INT1, and only using the LOW trigger-mode; no PCINTs. The only problem is staying awake for a moment, while all the IR data is coming it, as the library you propose uses timer1 to sample the data coming in.
    – Gerben
    Commented Dec 29, 2014 at 19:40
  • @Gerben I didn't think of that, while I'm pressing for the first time the POWER button the Arduino is still sleeping so it could miss some data, am I right? Commented Dec 29, 2014 at 20:42
  • Note the bootloader from any reset typically takes 5 seconds before executing the setup () followed by loop ().
    – mpflaga
    Commented Dec 30, 2014 at 0:33
  • 1
    Most ir protocols have a long initial pre-amble, before the data part to allow settle time for waking up. Where sherrif's already learned protocols require this in entirety. And as you noted it will be partial, at first. Where sherrif's ir library could be adjusted for this.
    – mpflaga
    Commented Dec 30, 2014 at 0:40
  • My thougt was to wake up from the intitial space (pre-amble) and start so that timer1 can resume. Alternatively one can tweak the lib to either go back to sleep if no ir is present otherwise stay wake. This will only be awake for a moment every 50ms. This will extend life a long time (years). Many systems do such.
    – mpflaga
    Commented Dec 30, 2014 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.