element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Project Videos
  • Challenges & Projects
  • element14 presents
  • Project Videos
  • More
  • Cancel
Project Videos
Documents Creating an IMU based 3D Mouse with an ESP32-S3 -- Episode-636
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Project Videos to participate - click to join for free!
Related
Recommended
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 4 Jan 2024 3:18 PM Date Created
  • Last Updated Last Updated: 22 Jan 2024 5:01 PM
  • Views 8240 views
  • Likes 11 likes
  • Comments 46 comments

Creating an IMU based 3D Mouse with an ESP32-S3 -- Episode-636

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:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

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.   

image

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.

image

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. 

image

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. 

image

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. 

image

Downloads and Links:

  • Download CAD Files, Code, and Schematics!
  • Paper about the challenge of tracking lateral movement with IMU

Bonus Video:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

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.

element14 presents

element14 presents  |  About Clem  |  Project Videos

  • Arduino Mouse Project
  • Bluetooth Air Mouse
  • Inertial Measurement Unit Mouse
  • Mouse Design
  • Electronic DIY Innovation
  • MPU6050 Mouse
  • Logitech BT83 Inspired Mouse
  • Maker Electronics
  • DIY Mouse Project
  • 3D Air Mouse Design
  • Open Source Electronics
  • IMU Sensor Innovation
  • Trackpoint Inspired Mouse
  • PCB Design for Mouse
  • Motion Sensor Mouse
  • friday_release
  • e14p_CMM
  • Share
  • History
  • More
  • Cancel
Actions
  • Share
  • More
  • Cancel
  • Sign in to reply
  • koudelad
    koudelad over 1 year ago in reply to mayermakes

    Exactly. The best movie that addressed this topic is still The Light Bulb Conspiracy from 2010. Both consumers and investors should think more about sustainability, but there is no simple solution. I guess it would be a nightmare for corporations, if we all could build most of our everyday stuff on our own.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mayermakes
    mayermakes over 1 year ago in reply to koudelad

    it is for sure a worthwhile challenge not just because of the freedom that goes with open source, but also because having open designs available to be produced everywhere could help end the price race to the bottom. the savings are usually paid by people in horrible working conditions.
     The sad truth is that fair locally produced products could be easily achieved if the work would be put in to develop good reference designs instead of chasing slight edges in margins at the expense of labourer rights and conditions.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • koudelad
    koudelad over 1 year ago

    Interesting episode, Clem. I love the idea of making peripherals open source. And reusable and repairable. I saw how computer peripherals are made in some Asian countries - not a pretty look to see sleeping kids on a production line. It was terrified seeing someone assembling the exact same mouse I was holding in my hand.

    As you mentioned, it is not a good idea to base a new open source project on NRND components.

    Anyway, new IMUs made for consumer devices feature some functions that could be handy in such a mouse - click and double click detection. I believe the fruit company used it in their mouse? However, if you need two or more buttons, you then need some capacitive sensing device to distinguish between left and right (maybe middle) click area.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 1 year ago in reply to mayermakes

    Yes, looks like they turned into registration offices.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • cstanton
    cstanton over 1 year ago in reply to beacon_dave

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mayermakes
    mayermakes over 1 year ago in reply to beacon_dave

    the patent office back then actually cared if its even an invention, my current impression is they only look for propperly filled out forms and the paid fee...if anyone easily takes it down with a counterclaim orlack of susbtance/infringement on other IP/patents that is the patent holders problem to defend.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 1 year ago in reply to Jan Cumps

    Patenting is sometimes harder than it looks. According to the Wikipedia page about the first rolling ball mouse:

    "...Anecdotal reports claim that Telefunken's attempt to patent the device was rejected by the German Patent Office due to lack of inventiveness..."

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 1 year ago in reply to mayermakes

    Just one ? There will be several.

    One is when you need to constantly switch between typing at a keyboard to using a mouse (or two mouses) for navigation/selecting. For 3D CAD you might have SpaceMouse in one hand, and a mouse in the other hand so you can quickly target an insertion point but then darn you now need the keyboard to type in a textual or numeric information, then return back to the mouses for the next insertion point.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 1 year ago in reply to Jan Cumps

    That was so '60s Slight smile

    There was also the knee input device amongst others:

    https://www.dougengelbart.org/content/view/162/#5

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 1 year ago in reply to Jan Cumps

    > " go get a worldwide patent ..."

    I'll have to keep my current job. https://en.wikipedia.org/wiki/Footmouse

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube