Hacker's IR remote

A hackable SMD IR emitter

Similar projects worth following
I was inspired by @facelessloser's Random Remote to take a shot at making a very small IR emitter for hackers.

In principle, it's very simple - an ATTiny powered by a boost converter and a single AA or AAA battery. One pin of the tiny goes to an IR LED, and all the rest (after taking away the 3 pins for power and !RESET) go to buttons.

Most of the actual circuit here is the same as the Crazy Clock. The difference is that the tiny is not clocked by an external crystal. Instead, most of the pins are connected to a 5-way joystick (up, down, left, right and "in" or select), and one pin to an IR LED.

The firmware will put the tiny in the deepest sleep possible most of the time. A pin change interrupt will wake up the tiny whenever one of the outputs of the joystick is grounded. The code will then do whatever is required, and once the joystick returns to rest, the tiny will go back to sleep.

From my experience with the crazy clock, I expect the battery to last a very long time because the NCP1402 is quite efficient at supplying minuscule current draws. The trick is getting the tiny into the state with the minimum possible draw. There are two register bits required to turn the analog-to-digital converter all the way off, and if you don't do the second one, then the ADC will continue to draw 250 µA or so for nothing.

The IR emitter is a standard 0805 SMD part. To make the infrared energy go out the front, the way you'd expect a remote control to work, a light pipe is used to redirect the energy 90 degrees. If the board were put in a case, the pipe's round front would protrude out (or at least be flush with the outside surface).

hacker IR.pdf


Adobe Portable Document Format - 19.21 kB - 06/13/2016 at 06:06


hacker IR.sch

EAGLE schematic

sch - 223.15 kB - 06/13/2016 at 06:06


hacker IR.brd

EAGLE board file

brd - 54.10 kB - 06/13/2016 at 06:06


  • The firmware is all

    Nick Sayer06/13/2016 at 06:30 0 comments

    The hardware is really the high point of this project. It's all quite pedestrian. It's a boost converter powering an ATTiny45. The tiny has to exercise the LED, watch for button activations, and sleep to minimize power usage when it's not doing anything.

    For power management, the good news is that we can use the pin change interrupt to watch for button pushes. This allows us to drop the tiny into power down mode, which is the absolute lowest power usage possible. It won't be absolutely zero draw, since the boost converter will need to keep the 3 volts available, but the NCP1402 is fairly efficient at low power (battle tested in the crazy clock).

    I've never done IR before, so it'll be interesting how best to supply a library and firmware "base" for this project. I envision a method that's called with the button number. The button push will wake up the controller, then it will call the method in question, which will decide what to do. An IR library (TBD) will be available to transmit with the LED. The user's method will be able to poll the button to see if it's still being pushed down and either auto-repeat the IR or not and when the button is released, the method can return, which will put the controller back to sleep.

  • Which AVR to choose?

    Nick Sayer06/07/2016 at 14:25 0 comments

    The boost converter portion of the project will be quite straightforward - it'll be a copy of the boost converter in the Crazy Clock based on the NCP1402. It'll be powered by a single off-board AA or AAA battery (at the discretion of the builder).

    Next is which AVR to choose, and that choice comes down to the ATTinyx4 or ATTinyx5. And which of those to choose comes down to how many buttons are desired.

    We lose 3 pins of the controller to power and !RESET (while you can turn !RESET into a GPIO pin, that means you can't program the chip conveniently after you do so). We lose another pin to the IR LED. We're left with either 4 or 10 pins left.

    A joystick (up, down, left, right, and center) is 5 pins, but one workaround for that is to chord up and down to get an extra button. While adjacent directions can be chorded on a joystick, opposite ones cannot, so there's no ambiguity.

    But is a joystick enough? We could use a button matrix to multiply the available buttons, but we would need more than 4 pins to do that (a 2x2 matrix is no better than just four individual wires). With the x4 chip, we could use up to a 5x5 matrix to get 25 different buttons.

    None of this precludes in-system programming. As long as you don't push a button during programming, those lines would still be disconnected while programming was taking place.

    Which direction should we go? A larger button matrix or a minimal joystick remote?

View all 2 project logs

Enjoy this project?



johnlagend06 wrote 01/12/2022 at 13:39 point

There are some very impressive things that you can visit lg blu ray to learn some informative codes here.

  Are you sure? yes | no

mpinner wrote 10/12/2017 at 16:33 point

nice light piping!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates