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.

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?

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.

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.

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.

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.

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…

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

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.