2021-01-27

Bluetooth trackball Mark II

I made a Bluetooth trackball in which all the electronics are inside the ball. The ball is the entire trackball. Here it is in action:

Inside the ball there's a microcontroller and a set of sensors that together with some clever algorithms allow the microcontroller to know the ball's absolute orientation in 3D. When the ball is rotated, it sends the appropriate commands to the computer over Bluetooth to move the mouse cursor. Oh, and the keyboard in the video is a completely separate USB device, it's only used for mouse clicks and doesn't interact with the ball in any way.

This is actually the second iteration of the project. While I was very proud of my previous attempt, it had some undeniable shortcomings and was generally a proof-of-concept quality device. This new version improves upon it in many regards, to the point where I think it could possibly be used on a day to day basis as a replacement for your regular mouse. Specific features include:

  • an nRF52840 chip along with LSM6DS33 accelerometer/gyroscope and LIS3MDL magnetometer
  • a wirelessly rechargeable 500 mAh battery
  • battery level reporting over Bluetooth
  • more robust "up" calibration
  • fully sealed construction allowing for smooth rolling of the ball

I used Adafruit's Feather nRF52840 Sense, it has all the necessary sensors onboard. The other components are a lipo battery, a wireless charging coil and two reed switches, one of which is connected to the board's "En" pin, allowing us to turn the device off with an external magnet, the other is connected to a GPIO pin and is used to trigger the "up" calibration.

The ball is 65 mm in diameter and is made of two 3D printed halves. After putting the electronics inside I glued the two halves together and smoothed the surface by progressing through increasingly finer grits of sandpaper. It rolls pretty smoothly on 2.5 mm zirconium oxide bearing balls, though it's still admittedly not as smooth as a real trackball. I made a few bases in various shapes for the ball to roll on, they are just pieces of 3D printed plastic and don't have any electronics in them.

To charge the battery inside the ball I also made a special base that has a wireless charging coil inside and is powered with USB (or any 5V source). It also has a strategically placed magnet that can be used to trigger one of the two reed switches inside the ball, one will turn the device off, the other allows for setting the logical "up" directon of the trackball (by itself the trackball doesn't know which direction should move the mouse cursor up, so you can set it by putting a magnet near one of the reed switches and rotating the ball around the vertical axis).

The Arduino code and 3D models are on GitHub.

12 comments:

  1. Beautiful work! Have you considered using an air bearing / cushion in the cradle rather than ball bearings? I imagine it could make the action as smooth as you like it. Missile Command meets air hockey... genius or madness? Only one way to find out :). Sincerely, thank you for sharing your work!.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. un ventilateur de pc dans le socle… facile à faire…

      Delete
  2. This is what i’ve been waiting for!! Amazing!!

    ReplyDelete
  3. When you say it doesn't know which direction should move the cursor up, does that mean that the ball can rotate such that pushing up will move some amount of left/right/down?

    ReplyDelete
  4. Kickstart it! I'd back it... (assuming the mouse clicks could be done e.g. by tapping the ball .. or at least with exposed API I could modify :))

    ReplyDelete
  5. This is super cool. When I am done with my current project, I may have to look into this!

    ReplyDelete
  6. I think if the base was made with space for one or two MX switches for click buttons it would complete the device quite nicely...

    ReplyDelete
  7. pour les boutons de clic droit et gauche, les metre sur le support, ou un micro qui transforme des tapotements en clic. un tapotement sur la boule : clic gauche, un tapotement sur le support (donc une autre sonorité)donne un clic droit.

    ReplyDelete
  8. What if you used an already known round item (like a pool ball but maybe larger) and cut that in half. Wouldn't that make an easy smooth & round trackball with some heft? Ofc you'd need to hollow some of it which might be a bit tricky.
    And could you put the wireless charging coil in the middle along the cut part?

    ReplyDelete