Where [ ] represents integer; a is the voltage output by the acceleration sensor, V. The maximum sampling rate of the ATmega 16L microcontroller can reach 15,000 times/second, and this article uses 1,000 times/second; that is, sampling once every 1ms, and reporting the relative displacement change to the computer once every 25ms to ensure the accuracy and smoothness of the mouse pointer movement on the screen, then each reported displacement change contains 25 acceleration sampling data. An approximate algorithm can be used to perform a secondary integration of the acceleration signal to obtain a displacement signal.
The purpose of encoding is to encode the displacement changes in the X and Y directions, together with the real-time information of the mouse buttons, in the format required by the standard Microsoft mouse protocol, so that the information finally sent to the host can be correctly recognized by the computer, so that the computer can correctly process the displacement signal sent to it to correctly control the movement of the mouse cursor and other actions. Table 1 shows the three-byte data packet format specified by the standard mouse protocol. The first byte records the information of the left and right buttons and the highest two bits of the mouse X and Y displacement. When the button is pressed, the corresponding position is 1, otherwise, it is set to 0; the second and third bytes record the lower 6 bits of the X and Y displacement data respectively. The displacement value ranges from -127 to +127, and any larger displacement change will automatically overflow.
Table 1 Microsoft standard mouse protocol data packet format
2 Specific design plan
2.1 Mouse Principle
At the heart of an optical mouse is a low-resolution mini camera called a sensor. A viewing LED illuminates a surface, and the light bounces off the surface and is collected by a lens. Most mouse manufacturers use visible red LEDs, and some also make mice that use infrared LEDs.
As the mouse moves, the sensor continuously photographs the surface and uses digital signal processing to compare the images to determine the distance and direction of movement. The results are sent back to the computer, and the cursor on the screen moves based on these results. Although optical mouse sensors can move over almost any surface, there are some surfaces that mouse sensors cannot navigate, such as mirrors, glass, glossy surfaces, magazines, and holographic surfaces.
According to Figure 1, the mouse can be divided into the following functional parts:
1) Displacement detection unit--X, Y dual-axis acceleration sensor;
2) Key detection unit;
3) Single chip microcomputer (MCU);
4) Bluetooth transmitter chip;
5) Bluetooth transceiver chip - as receiver (RX);
6) Microcontroller with USB interface (USB MCU).
Figure 1 Description of wireless mouse based on acceleration sensor
The specific working principle of the mouse is as follows: the single-chip microcomputer in the mouse monitors the movement and button status of the acceleration sensor in real time. When the state of the mouse changes, the single-chip microcomputer reads the button status and promptly obtains the current X/Y coordinate movement position; then the single-chip microcomputer packages the changed data according to the agreed communication protocol and sends it to the receiving end through wireless transceiver technology. The receiving end decodes the data packet that conforms to the mouse USB protocol to the USB port of the PC host through the single-chip microcomputer; the mouse driver in the PC receives the data packet from the port, decodes it and transmits it to the corresponding application software, thereby completing the detection and control process of the mouse.
Previous article:Wireless mouse solution based on micro-electromechanical system
Next article:Non-contact air distance measurement method based on ultrasonic sensor
Recommended ReadingLatest update time:2024-11-16 17:46
- Popular Resources
- Popular amplifiers
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- RaspberryPi Pico To-Do Board using Micropython
- TTP223_BA6 uses non-isolated power supply + inverter and the lower button fails
- 【TI Recommended Course】#TI.com Online Purchasing Special: Smart Buildings#
- Filtering and Signal Processing Reference Design for MSP430 FRAM Microcontrollers
- [Chuanglong TLT3-EVM Development Board Review] From Development Board to PLC
- This article explains the process of Keil compiling a program
- Support EEWorld 19 Growth Plan and win wonderful gifts!
- Qorvo has launched a series of articles on motor science. Let’s take a look.
- About the problem of Proteus access error
- I took apart a multimeter. As usual, after taking it apart there must be many parts that cannot be put back together!