USB Mouse Decoder - Serial Output
The product is a USB Host which accepts any USB Mouse at its USB port and decodes the movement and button presses including scroll wheel. The data is output as serial TTL UART at 9600 baud rate for easy interfacing with various applications. The output is suitable for 3V or 5V level microcontroller applications.
- Easy to Use with variety of mouse types (including wireless mouse but excluding gaming type composite mouse)
- Multicolor Status LEDs for Error, Activity and Power
- Simple output can work with any type of microcontroller
- Accepts Wireless Mouse also by inserting its receiver into USB host port
- Graphical User Interface (GUI)
- Virtual Screens
- Servo Control
- X-Y Control Positioning
- LCD cursor movement
- TX-OUT - Transmit output, usually goes to your microcontroller receive pin RXD
- +5V - Regulated +5V power input
- GND - Common Ground
- DET - Idle Low, Goes High when mouse activity happens and date is ready to be sent. Goes low again after data transfer at TX pin is finished. Useful for input to external microcontroller for polling or interrupt to process the data from board.
Note: RX-IN pin and other pins are not used in this application, leave it floating. Below you can see, we have provided holes for mounting header of 2.54mm pitch if required.
- Board has three LEDs
- PWR - Green LED indicate that board is getting power
- STS - Yellow LED indicate any mouse movement activity
- ERR - Red LED indicate any error like mouse not detected
Output Data Format
- 9600 bps - 8 - N - 1 (No parity)
- Output voltage level 3.3V TTL UART (Can also connect to 5V operated MCU RX pin directly.)
- 22 bytes of fixed length data, Start with 0x0A and ends with 0x0D
- Data packet is sent out only when there is movement in mouse or any button is pressed.
- Data output is comma seperated values containing total 22 bytes of flxed length having various parameters.
Output format for data is 0,0,0,0x00,0x00,0x00 where each value are as LB,MB,RB,SW,X,Y
- LB - Left button press, Value is 1 if button pressed and 0 if not pressed
- MB - Scroll button press, Value is 1 if button pressed and 0 if not pressed
- RB - Right button press, Value is 1 if button pressed and 0 if not pressed
- SW - Scroll Wheel, Value is 0x01 if moved in one direction and value is 0xFF is moved in other direction, Idle value is 0x00
- X - its a 8 bit value from 0x01 to 0xFF depending on its movement, On idle value is 0x00 if packet is button press
- Y - its a 8 bit value from 0x01 to 0xFF depending on its movement, On idle value is 0x00 if packet is button press
Here is a screen showing output data in terminal software on PC
Interfacing UART Serial Data by various methods
To Interfacing with PC's Serial port, which has RS232 level(+/-12V) the output from board needs to be converted to RS232 level by using MAX232 IC. Then the data is connected to PC's RS232 port. Board+MAX232 will need external +5V power supply and ground has to be common between both boards.
Note : Images shown is only for representation. The actual product may vary with the picture shown.