Design of wireless pointer based on micro accelerometer

Abstract: In order to make up for the shortage of laser pointer in multimedia teaching, a wireless pointer system based on micro accelerometer is proposed. It not only has the function of turning up and down the laser pen, but also can move freely and flexibly in the air to realize high-precision click function. The system uses the micro-accelerometer ADXL345 as a signal detection component, and uses the low-power low-cost microcontroller AT89S52 and the RF chip nRF24 L01 for information processing and wireless transmission. It is ergonomically designed to maximize the satisfaction of people when using the mouse. Requirements in terms of feel and comfort and usage habits.

This article refers to the address: http://

Wireless pointers have been used in multimedia teaching or conference presentations, but more can only be used for page turning of documents, so they must be used with wired or wireless mice, due to this traditional mechanical or optical mouse. We can't get rid of the flat and frictional working surface, the volume is large, the working space is limited, and the movement is not free, so we developed a wireless pointer based on micro accelerometer.

Some units in foreign countries and Hong Kong and Taiwan have already carried out research in this area in the early years. In recent years, domestic research on this technology has become increasingly mature. In 2002, Li Hongsheng of Southeast University applied for the name of “mobile full electronic inertial mouse”. The utility model patent uses the acceleration signal detected by the accelerometer to integrate and divide the frequency to generate a speed pulse, and then is implemented with a dedicated mouse IC chip. In 2004, Zhang Leping of the Department of Engineering Physics of Tsinghua University successfully designed an inertial mouse based on accelerometer, which achieved good results by tilting the use of 1. In 2006, Huang Dezhi and others of the Institute of Micro-Nano Science and Technology of Shanghai Jiaotong University successfully designed a wireless mouse based on micro-acceleration sensor. The above three kinds of mice can be said to be very good, but they use special encoding and decoding chips or Dedicated AD conversion, mouse IC chip or high-performance microcontroller, which increases the size of the board and increases the cost. Based on this, we developed a wireless pointer based on the micro-accelerometer ADXL345, which integrates the accelerometer. The AD conversion function can convert the acquired acceleration signal into a digital signal. The microcontroller adopts the AT89S52 with low power consumption and low price. Its wireless transmission distance can reach 30-60 m, which is 2 to 4 times that of the traditional mouse. The remote control of the host-side cursor in any position of the teacher and the conference room is a perfect combination of the functions of the traditional mouse and laser pen. The volume can be made small, portable, flexible and various occasions, and the wireless pointer conforms to the human body. Engineering design can prevent the emergence of mouse hands.

1 system overall design

The project design is divided into two parts, the remote user control subsystem and the host side signal receiving subsystem. The remote user control subsystem is responsible for collecting mouse displacement information and button information, and transmitting it to the host terminal signal receiving subsystem. The host side signal receiving subsystem is responsible for encoding the received information and communicating with the computer to control the computer to perform related operations.

The remote subsystem consists of a micro accelerometer, a microcontroller, and a wireless RF receiver. First, the remote subsystem acquires the signal of the micro accelerometer ADXL345 and converts it into a displacement by a special integration algorithm. Then, the remote subsystem integrates the displacement signal and the key signal, encodes the signal according to the format defined by the wireless module, and finally transmits the encoded data to the host terminal system through the wireless RF module.

The host terminal system consists of a wireless RF transceiver, a microcontroller and a USB control chip. The USB control chip USBPD1D12 is responsible for USB communication control between the host terminal system and the host computer. After the host terminal system is connected to the host computer through the USB interface, the host computer operating system automatically loads the driver of the HID class device to complete the connection between the host terminal and the host computer. Then, the host-side microcontroller receives the displacement and key signals transmitted by the wireless module nRF24L01, thereby controlling the movement of the cursor and the operation of the keys.

As shown in FIG. 1, it is a structural block diagram of a remote user control subsystem and a host side signal receiving subsystem.

Design of wireless pointer based on micro accelerometer

2 system hardware design

2.1 Remote subsystem hardware circuit design

1) Micro accelerometer module

The ADXL345 is a three-axis digital accelerometer from Analog Devices. The principle of operation is to first sense the acceleration of the front-end sensing device and then convert it into an identifiable analog electrical signal. The ADXL345 integrates an AD converter. This analog signal is digitized and the output is a 16-bit twos complement. Most notably, it integrates a 32-level first-in, first-out (FIFO) memory management system that can be used to buffer data output, reduce host processor load, and reduce overall system power consumption.

The chip is mainly used in miniature inertial devices of consumer electronics. It can sense an acceleration of ±16 g at the maximum, and the induction accuracy can reach 3.9 mg/LSB. The typical error of the inclination measurement is less than 1°, and the ultra-low power consumption. The built-in ADC converts the acceleration signal into a digital quantity and stores it in the on-chip buffer. In actual use, in order to improve the stability of the output data, the sensing range is set to ±2g, and the sensing precision is 3.9 mg, which can satisfy the human body motion acceleration. Range and accuracy requirements.

ADXL345 can be connected to the MCU through SPI bus or I2C bus. The AT89S52 selected by this product does not have SPI and I2C interface, so we use I/O port to simulate I2C bus or SPI bus interface.

2) Button circuit module

The button circuit module mainly considers the problem of debounce. We use the software delay debounce here, but it does not use the delay in the main program, which wastes the system resources, but uses the timer delay to set the flag variable method.

2.2 Host terminal system hardware circuit design

As shown in Figure 2, the microcontroller connects the four-wire SPI bus to the nRF24L01 through the P1 port (P1.4 to P1.7). The control signal is received and processed. The received signal is transmitted to the USB interface through P0 and other control ports. The chip PDIUSBD12 further controls the movement of the host-side cursor. The nRF24L01 radio frequency module is a new single-chip RF transceiver device that operates in the 2.4 GHz ISM band and has a maximum operating speed of 2 Mbps. The signal transmission time is very short and greatly reduced. Collision phenomenon and current consumption in wireless transmission, the chip incorporates enhanced ShockBurst technology, which can automatically process the header and CRC check code, which is convenient to use. The chip consumes low power and operates at -6 dBm with an operating current of only 9 mA. When receiving, the operating current is only 12.3 mA. A variety of low-power modes (power-down mode and idle mode) enable energy-efficient design. more convenient.

Design of wireless pointer based on micro accelerometer

The PDIUSBD12 is a performance-optimized USB device from Philips that is typically used in microcontroller-based systems and communicates with microcontrollers via a high-speed universal parallel interface and supports local DMA transfers. The PDIUSDB12 is fully compliant with the USB 1.1 specification and can be adapted to most device class specifications such as imaging, mass storage, communications, printing and manual input devices. PDIUSBD12 also integrates features such as SoftConnect, GoodLink, programmable clock output, low frequency crystal and termination resistors. All of these features save money when the system is implemented, and it's easy to implement more advanced USB functions on peripherals.

3 system software design

3.1 Remote Subsystem Software Design

3.1.1 Transmit and Receive Modules

The wireless RF transceiver module nRF24L01 is connected to the client and the host through the SPI bus. It must be configured separately when it is used. The client is configured in transmit mode, and the host is configured in receive mode. It must be sent in strict accordance with its data format and process. Receive data.

3.1.2 Micro Accelerometer Module

1) Reconstruction of data in the register

The micro accelerometer ADXL345 is connected to the microprocessor through the I2C bus. The data transmission between them needs to follow the I2C bus protocol. The registers 0x32 to 0x37 respectively store the x, y, and z axis output data, and the output data is two's complement. DATAx0 is the least significant byte and DATAx1 is the most significant byte, where x represents X, Y, or Z. Because the ADXL345 is a 16-bit data format, the user must reconstruct the data after acquiring the acceleration data from the data registers. We use the interface function Multiple_read_ADXL345() to read the data of the register continuously in multiple bytes, and then reconstruct the data by shifting the high byte left by 8 bits and the low byte of 8 bits, and for us, only X and Z are needed. The acceleration data of the direction can be, the program is as follows:

ADXL345_DataReconstrution()

{ unsigned int Acceleration[2];

Multiple_Read_ADXL345();

Acceleration[0]=BUF[1];

ACCeleration[0]=(ACceleration[0]<<8)|BUF[0];

Acceleration[1]=BUF[5];

Acceleration[1]=(Acceleration[1]<<8)|BUF[4];

}

2) Comparison of the accuracy of the micro accelerometer ADXL345 and ordinary mouse

At present, the mainstream optical mouse on the market has a mainstream resolution of 400 DPI, that is, the coordinates of 400 different points can be fed back every inch of movement, that is, the resolution of the mouse is 25.4 mm/400=0.06 35 mm. The ADXL345 uses a 13-bit or 10-bit resolution mode. This mode can be set by the DATA_FORMAT register (Address 0x31). In addition, the register can be set to ±2 g, ±4 g. ±8 g, ±16 g, the pointer selects the 10-bit mode, ±2 g can meet the resolution requirements, the resolution is 4g/1024LSB=3.9mg/ LSB, we will use the acquired acceleration data The hexadecimal number mode is stored in the register, and then the data is reconstructed and the division step is taken, and the movement of the mouse is controlled by wireless transmission to the receiving end, and the USB mouse report description specifies that if the received data is 1, the pixel is moved by one pixel. Assuming a 14-inch display with a size of 300mm*190mm, the resolution is set to 1 024*768, then the horizontal minimum point spacing is 300 mm/1 024=0.293 0 mm, although this data is not as high as an ordinary optical mouse, but for general pointers Already enough, the most important thing is that we can set the step size through the software, you can make accurate movement when the pointer is fretting, and shake the pointer to move the cursor to the edge of the screen quickly if necessary. Ergonomic requirements, and we can change the g value, the resolution mode and the step size from the movement of the adjustment pointer. The step size program is set as follows:

Design of wireless pointer based on micro accelerometer

3.2 Host terminal system software design

FIG. 3 is a flow chart of the main program of the receiving end, and the software part of the receiving end mainly includes: PDIUSBD12 firmware driver, and enumeration process of the USB device. In order to make the software portable and easy to maintain, the driver of PDIUSBD12 is written in a layered manner. The USB driver is divided into interface and device control driver layer, protocol layer and application layer. The program written by the layered method is clear and portable. The USB HID class is a relatively large class, and the HID class device belongs to a device for human-computer interaction operation. One of the benefits of using HID devices is that the operating system comes with HID-like drivers, and users don't have to develop troublesome drivers, just use API calls to complete the communication. So we enumerate the USB devices as HID devices so that they can be used without installing drivers. The enumeration process of the USB device actually tells the PC device to describe the type. When a USB device is plugged in, the host requests various descriptors from the device to identify the device, including five standard descriptors: device descriptor, configuration descriptor, interface descriptor, endpoint descriptor, string descriptor, and 3 HIDs. Device class specific descriptors: HID descriptors, report descriptors, entity descriptors. When the host knows all the information it can know from its descriptor, it starts installing drivers for this device. At this point, the USB enumeration process ends and the device can be used normally.

Design of wireless pointer based on micro accelerometer

4 Conclusion

This article applies a micro accelerometer and a wireless RF module to achieve wireless remote mouse operation. The effective distance of the remote control can reach 30-60 m, the power consumption is small, the cost is low, and the remote control has no directivity, which can greatly enhance the human-computer interaction performance of the multimedia. Moreover, the finished product has a reasonable design, comfortable hand and ergonomic design, which can prevent the appearance of the mouse hand.

1.5V AAA Alkaline Battery

DADNCELL 1.5V AAA alkaline batteries are more suitable for long-lasting continuous discharge and high-performance power consumption equipment because of their unique internal component structure, coupled with better battery materials, improved power capacity and electrical performance, and the same model of DADNCELL 1.5V AAA alkaline cell capacity and discharge time, Alkaline battery capacity and discharge time are 4-7 times that of ordinary batteries, and the gap in power discharge performance at high and low temperature is even wider.

At present, all types of cells developed by DADNCELL Labs do not involve any heavy metals in production, are green and can be disposed of with domestic waste.

DADNCELL 1.5V AAA battery advocates a more comfortable and smooth power supply experience for household appliances. Alkaline zinc-manganese dry battery series is suitable for various common household electronic equipment instruments such as smart door locks, infrared thermometers, cameras, flash lights, razors, electric toys, instruments, high-power remote controls, Bluetooth wireless mouse keyboards, etc.

1.5V Aaa Alkaline Battery,1.5V Alkaline Battery For Cameras,Lr03 Zinc-Manganese Cells For Electronic Product,Electronic Equipment Am-4 1.5V Battery

Shandong Huachuang Times Optoelectronics Technology Co., Ltd. , https://www.dadncell.com