Use your TV remote as an HID mouse

[Vinod’s] latest project lets him use a TV remote control as a mouse. It may not sound like much, but he did it with a minimum of hardware and packed in the maximum when it comes to features.

He’s using an ATmega8 to read the remote control signals and provide USB connectivity. With the V-USB stack he enumerates the device as an HID mouse. One note of warning, he used the PID/VID pair from the USBasp programmer project. If you use that programmer you’ll need to uninstall the drivers to get this to work (we think this is only necessary on a Windows box).

The cursor can be moved in eight directions using the number pad on the remote. The numeral five falls in the center of the directional buttons so [Vinod] mapped that to the left click, with the zero key serving as right click. He even included the scroll wheel by using the volume buttons. The firmware supports cursor acceleration. If you hold one direction the cursor will move slowly at first,then pick up speed. Fine adjustments can be made by single clicking the button. Check out his demonstration embedded after the break.

17 thoughts on “Use your TV remote as an HID mouse

  1. Interesting, I did the similar thing for XBMC.

    Basically, I used the IR decode of the ps3toothfairy and ported it to a USB avr. I made the USB AVR look like a keyboard so that my IR remote could invoke the xbmc keystrokes …

  2. it would be great if he could add programability to the software. maybe have the choice between some buttons being keyboard or some being mouse. Or make the whole thing recognized as a keyboard and use software on the computer to make some keyboard keys act as mouse (not a fan of this idea though, but an option). This would be a great thing if it could program any ir input to keyboard/mouse. I would buy one. is there something like that on the market? if not, Kickstarter?

    1. Or have the power button on the remote toggle between keyboard/mouse mode. Then again, there are enough buttons on the average TV remote to do many jobs at once. Use a remote with a few buttons arranged in a circle for the mouse, the the play/pause buttons for music/video control, and use a few others to act as a next/prev for powerpoint, etc.

    2. I kinda think the point of designing it with the minimum of components and documenting so thoroughly is that you can break out the iron and some perf board and put one together yourself in a couple of hours, then go ahead and tweak the firmware to your requirements.

      Excellent work, Vinod!

  3. Heh kind of an odd idea but I think it would be good for longer distance wireless use…just find a way to make it more smooth (I think the wii remote mouse is a little better)

  4. I was kind of mislead by the title, I thought this build would allow you to move the remote in the air and make the cursor follow your movements.

    I guess it could be done with a webcam detecting the IR.

  5. Very good use of v stack. The atmega 8 seems like a lot of extra pins, and I think I’ve seen some attiny business card designs that used v-stack, but I’ve never used v-stack so you might have it right on target.

    I did this with a teensy, mine works as a mouse, and youtube playlist player/browser controller. It uses the number pad and channel buttons to access a array of youtube videos then plays them. It also allows alt-tab options for multi-windows support, arrow keys, volume control, and refresh of a browser.

    The mouse programming, to get it so it wasn’t to slow, jittery, or to fast was very tricky. You did quite well on yours, congrats.

    The only thing mine falls short on is the hotkey software that does the volume control for you. I couldn’t figure out how to add media key keystrokes to the teensy library, but other than that it is independent of software, and still works even without the software.

    Good job, and good luck on your next project.

    -Shawn McCombs

  6. Have a look at the lirc project. The lircmd (lirc mouse daemon) is used for controlling the mouse cursor… Also specific actions can be executed by a button on the remote, e.g., launch your favorite webradio.
    I am using lirc on linux for several years now without any problems…

  7. i did something simillar before, still have the code.

    instead of IR -> AVR -> USB -> USBHOST -> PCBUS
    it was: IR -> AVR -> MSMOUSE -> PS/2 -> PS/2HOST -> PCBUS

    1. “host” as in the port on the back ofd the desktop.

      and yes i cheated by using a uSoft uC chip from a uSoftMouse and just plugging it into the computer.

      the IR recieve with AVR was what i actually did…
      it was part of a project that was sharing the same AVR but functionally seperate.

  8. Love it! I had some nice adventures a few years ago with the ubiquitous Packard Bell remote/serial IR dongle :) I used WinLIRC and girder for most of the programming iirc, and it did respond to pretty much anything. A learning remote also helps bridge any gaps when working with this stuff. Both programs are very useful for this kind of stuff. Kudos to the builder and thanks for the write up :) Keep tinkering :)

  9. I am working on a USB HID Mouse with ATtiny85 currently but find that “clicking” seems to be trickier than it appears – why is Vinod Stanur blocking the interrupt for 50 ms after a button press has been decoded (
    Unless the V-USB interrupt is higher level and can interrupt this routine, will this not just cause a delay before the button press or click is generated?
    The main loop of his program seems to be resetting the button state “automatically” on the next USB request.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.