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.

Comments

  1. ayman says:

    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. dude says:

    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?

    • Daniel says:

      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.

    • nes says:

      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. willow says:

    I like the exercise and work put into the project, really nice.

    To keep things cheap/lazy, I grabbed this last year: http://www.amazon.com/gp/product/B001M56DI0/ref=wms_ohs_product

    At the time it was $4 shipped via prime. Works like a charm. I’ve since replaced the remote with my fancy universal, and it’s a lot more fluid (universal is a touchscreen, and the keypad arrangement is better.

  4. zuul says:

    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)

  5. Philippe says:

    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.

  6. Hirudinea says:

    Shame laptops don’t have IrDA ports anymore.

  7. 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.

    http://theifdark.blogspot.com/2012/03/teensy-ir-pc-remote-keyboard-mouse.html

    Good job, and good luck on your next project.

    -Shawn McCombs

  8. Stefan Nowy says:

    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…

  9. NewCommentor1283 says:

    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

    • NewCommentor1283 says:

      “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.

  10. gleen close says:

    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 :)

  11. usbaby says:

    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 (https://github.com/vinodstanur/RC5-mouse/blob/master/main.c#L168)?
    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.

  12. swathika says:

    give me the block diagram of this project

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,434 other followers