TV remote controlled computer mouse (an avr VUSB project)
14,412
TV remote controlled computer mouse (an avr VUSB project)
While lying in bed and watching movies on a laptop, the idea arose that having a remote control would simplify the tasks of pausing, playing, fast forwarding, rewinding, adjusting volume, and playing the next track without needing to approach the system. Consequently, a plan was devised to create a remote control. Without owning a Bluetooth mouse, various options were considered. The AVR microcontroller was identified as a suitable solution, especially due to the availability of the VUSB project. Utilizing the VUSB library allows for the implementation of a low-speed software USB port (slave) on an AVR microcontroller. The VUSB library includes an example of an HID-mouse implementation, which employs a USB report descriptor similar to that of a Logitech USB mouse. Additional code was incorporated to receive and decode RC5 signals from a Philips TV remote and send corresponding mouse events to the system using the VUSB library. This method is advantageous as it does not necessitate special drivers on a PC, functioning as a HID device. It is compatible with nearly all AVR microcontrollers (tiny, mega, etc.), does not require a USB-to-serial converter or special hardware, and is cost-effective. Moreover, it is platform-independent, operating similarly to a USB mouse on Windows, Linux, and Mac. The obdev's shared VID/PID pair (0x16c0/0x5dc) was utilized, which is also used in USBasp; thus, if the USBasp driver is installed, it should be uninstalled to ensure functionality on Windows. The USBASP AVR ISP programmer is widely recognized among AVR enthusiasts, many of whom have used or continue to use this VUSB-based solution. The circuit design was made nearly identical to that of the USBasp, allowing easy experimentation on the same USBASP hardware by simply replacing the ATmega8 with another ATmega8 programmed with the new hex from this project. Additionally, a TSOP 1738 IR receiver module needs to be connected to the USBasp hardware, with its output linked to the INT1 pin of the ATmega8. The hardware is now ready; it can be plugged into a USB port and used as an RC5-Mouse. A Philips TV remote with the RC5 protocol is required for testing. RC5 decoding is accomplished using an external interrupt and a timer. The mouse data consists of four bytes: the first byte represents the mouse button states, the next two bytes indicate the increments in the x and y coordinates (signed values), and the last byte indicates the wheel displacement, which is also signed. The values of this four-byte structure must be set, followed by invoking the VUSB function "usbSetInterrupt" to transmit the mouse data to the system. A comprehensive VUSB tutorial is available at codeandlife.com, and the VUSB home page provides additional resources. This setup is also compatible with the ATmega328P.
The project involves creating a USB HID device that acts as a mouse, controlled by an IR remote. The core components include an AVR microcontroller (such as ATmega8 or ATmega328P), a TSOP 1738 IR receiver, and the VUSB library for USB communication. The design leverages the HID capabilities of the USB protocol, allowing seamless integration with various operating systems without the need for specific drivers.
The TSOP 1738 IR receiver is crucial for capturing signals from the Philips remote, which operates on the RC5 protocol. The microcontroller is programmed to decode these signals and translate them into corresponding mouse actions, such as movements and button presses. The implementation uses external interrupts to efficiently handle incoming IR signals, ensuring responsive control of the mouse functions.
The circuit design closely resembles that of the USBasp programmer, facilitating easy prototyping and modification. By retaining the same hardware layout, users familiar with the USBasp can quickly adapt this project with minimal changes. The connection of the IR receiver to the INT1 pin of the microcontroller allows for quick signal processing, while the use of the VUSB library simplifies the USB communication aspect, making it accessible for developers and hobbyists alike.
Overall, this project presents a cost-effective and versatile solution for creating a remote-controlled mouse interface, enhancing the convenience of multimedia control from a distance. The combination of readily available components and open-source libraries makes it an attractive option for electronics enthusiasts looking to expand their projects with innovative input devices.While laying in bed and watching movies on my laptop, I used to think if there is a remote control, it will be easy to pause, play, fwd, rev, adjust volume, play next etc etc without going near to the system. Then I planned to make a remote control. I don`t have a bluetooth mouse. There are many options infront of me. We can do it easily using AVR microcontroller because there is a great VUSB project :-). Using vusb library, we can implement a low speed software usb port(slave) on avr microcontroller. In the vusb library, there is an example of hid-mouse implementation in which the author used the usb report descriptor same as that observed on a logitech usb mouse. I then added few more lines of code to it to make it receive and decode RC5 signal from a philips tv remote and to send the corresponding mouse events to the system using vusb library.
I believe this is the best method because it doesn`t require any special driver in pc since it is a HID device. Also it works on almost all avr microcontroller(tiny, mega etc) and it doesn`t require any usb to serial converter or any special hardware and it is cheaper.
Also it is platform independent. It will work similar to that of a usb mouse in windows, linux & mac. I used obdev`s shared VID/PID pair(0x16c0/0x5dc). The same pair is used in usbasp, so the usbasp driver should be uninstalled(if it is installed earlier) and deleted otherwise it will not work in windows. Hope all avr lovers have heard the famous USBASP AVR ISP programmer and most of them might have used/still using this VUSB based stuff.
I then made the circuit design almost similar to that of the usbasp so that any one can try this easily on the same USBASP hardware just by replacing the atmega8 with another atmega8 programmed with the new hex from this project. Also we need to connect a TSOP 1738 IR receiver module to the USBasp hardware and need to connect it`s o/p to the INT1 pin of Atmega8.
Finished! Hardware is ready. Now we can plug it to usbport and use it is as an RC5-Mouse. We need a philips TV remote with RC5 protocol to test it. RC5 decoding is done using external interrupt and a timer. The mouse data consist of 4 bytes. The first byte is the mouse button states, the next two are dx and dy (increment in x and y coordinate, signed value) and the last byte is the wheel displacement which is also signed. We need to set the vaues of this four byte structure and then need to call a vusb function "usbSetInterrupt" to send the mouse data to system.
There is a very good vusb tutorial at codeandlife. com. Also you can check out the vusb home page. Also it works with atmega328p but it 🔗 External reference
A clock-controlled relay, also known as a time delay relay, allows for the automatic activation of a load, such as a water pump, at a predetermined time. This device utilizes a standard clock mechanism to trigger the circuit, enabling...
This temperature-controlled relay circuit is a simple yet highly accurate thermal control circuit that can be used in applications where automatic temperature regulation is required.
The temperature-controlled relay circuit operates by monitoring the ambient temperature using a temperature sensor, such...
These are simple AVR programmers. I designed and built four different programmers for various environments: LPT controlled parallel programmer, LPT controlled ISP adapter, COM controlled ISP adapter, and COM controlled generic SPI bridge. Additionally, COM controlled adapters can be...
A voltage-controlled oscillator (VCO) operates similarly to a voltage-to-frequency converter (VFC). Its output frequency is determined by a control voltage input. In the circuit diagram, 'd' represents the amplifier input voltage, which is set to 0.6V, while 'h' denotes...
The following circuit illustrates a schematic diagram for a remote control toy car. Features: it does not affect the performance of the original design.
The remote control toy car schematic circuit diagram typically consists of several key components that work...
A tiny speedometer/trip computer was constructed using an Atmel ATTiny2313 microcontroller and an HD44780-compatible character LCD display, along with a reed switch and magnets. This device measured the speed of a soapbox derby cart by attaching a permanent magnet...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more