Clem, driven by curiosity and the age-old wisdom of "you won’t know until you try", embarked on a quest to create a mouse with a motion sensor, or more precisely, an inertial measurement unit (IMU). Wondering why major manufacturers hadn't explored this avenue, he pondered the potential of leveraging IMUs, given the success of smartphones and game controllers in spatial movement tracking.
Watch the Video:
Equipped with an MPU6050 MEMS accelerometer, an ESP32S3 for Bluetooth connectivity, and a reliable battery charging circuit, Clem jumped into the design process. Drawing inspiration from a classic Logitech BT83 mouse, Clem meticulously crafted a board in KiCad to fit a familiar mouse-shaped shell. In fact, the project came to mind when the BT83 he’d been using for the past two decades started misbehaving, a problem caused by a worn-out cable, which was easily fixed in an afternoon. After receiving the PCB from Aisler, Clem quickly soldered all the SMD parts to the board and proceeded to check if the MPU6050 was recognized over I2C. The unit successfully booted and after flashing a modified I2C_detect example, revealed that a device was detected at address 0x68, the expected default ID of the MPU6050! However, the success was short-lived; checking readout examples showed that the IMU was only recording zeroes. Investigation with other libraries and raw sensor stat reports pointed to the culprit being most likely not a software error, but a damaged sensor. After consulting online makers, Clem pinpointed the culprit—a likely impact during the ultrasonic cleaning process, damaging the delicate MEMS device.
After receiving the PCB from Aisler, Clem quickly soldered all the SMD parts to the board and proceeded to check if the MPU6050 was recognized over I2C. The unit successfully booted and after flashing a modified I2C_detect example, revealed that a device was detected at address 0x68, the expected default ID of the MPU6050! However, the success was short-lived; checking readout examples showed that the IMU was only recording zeroes. Investigation with other libraries and raw sensor stat reports pointed to the culprit being most likely not a software error, but a damaged sensor. After consulting online makers, Clem pinpointed the culprit—a likely impact during the ultrasonic cleaning process, damaging the delicate MEMS device.
Undeterred, Clem replaced the damaged chip with a new one from Farnell. Taking a cautious approach, he opted for a sensitive PCB cleaning method, utilizing a toothbrush dipped in Isopropanol. Yet, the challenges didn't end there; Clem still faced the formidable task of deriving lateral motion from angular velocity, acceleration, and gyroscopic movement.
The next hurdle came in form of complex mathematics. In theory, deriving lateral motion from angular velocity and acceleration, as well as gyroscoping movement, can be done by recording a range of values over time and using a not-so-simple formula to analyze the changes. The formulas involve integrals of integrals, with a side-effect of yielding extremely big numbers that crashes the MCU.
After scouring the web for solutions, Clem discovered that while possible, the practical approach involved using two superior IMUs or offloading data processing to a desktop PC—beyond the scope of his project. This underscored why major manufacturers steer clear of relying on IMUs for mouse tracking; it's intricate, calculation-intensive, and less accurate.
After a quick chat with fellow host Katie, Clem pivoted to a new design inspired by the trackpoint on IBM/Lenovo laptops. He took advantage of the MPU6050_light library for Arduino to design a circular red mouse with two buttons, highlighting the ease of building a 3D air mouse compared to the challenges of creating a "simple" mouse with an IMU. Clem's journey showcased the complexities and unexpected turns that innovation often entails.
Downloads and Links:
- Download CAD Files, Code, and Schematics!
- Paper about the challenge of tracking lateral movement with IMU
Bonus Video:
Bill of Material:
Product Name | Quantity | Buy Kit |
---|---|---|
TDK INVENSENSE MPU-6050 | 1 | Buy Now |
DIODES INC. AP9101CK-AHTRG1 | 1 | Buy Now |
STMICROELECTRONICS USBLC6-2SC6 | 1 | Buy Now |
MOLEX 105450-0101 | 1 | Buy Now |
MICROCHIP MCP73831T-2ACI/OT | 1 | Buy Now |
Additional Parts:
Case made with MAYER MAKES Engineering Resin https://lectronz.com/products/mayer-makes-engineering-resin-extreme-strength-1kg |
USE CODE : „ELEMENT14“ for a 10% Discount for Element14 community members. |