top of page

(Re)Building a Vertical Mouse - Part 1

I bought this mouse as sort of a hopeful experiment - my current vertical mouse is starting to do interesting things like not sending left clicks. The mouse I ordered is really the best option for me, on Amazon at the time of writing, at least as far as input methods are concerned.

As far as I can tell, this mouse is the only vertical mouse that has extra "buttons" - and actually it has a joystick and not buttons! I bought it in hopes that I could program the joystick to do whatever I wanted, but when I received it I had two major problems:

  • The mouse is far too small for my hand

  • The joystick can't be programmed on linux

And indeed, after disassembly to see if I could simply re-program the microcontroller, I was met with some odd (though kinda neat) Holtek microcontroller. I didn't even know there was such a thing as a Holtek microcontroller. Turns out they have a few product lines of them!


The microcontroller in my mouse seems to be an 'HT66FB560'. Fancy little chip, but almost impossible for me to work with. I might learn it for professional reasons in the future, but for personal projects like this my basic list of requirements is essentially just:

  • Everything works on linux

  • No proprietary IDE - need mah vim keybindings

  • No stupid special programmer

Anddd Holtek fails all of those. There is a neat instructable for using this chips, but I think it mostly demonstrates why I don't want to use them. The programmer is $60 by the way, and needs to be activated in order to use it. (:

For context, I often try and use my bus pirate for programming MCUs rather than their fancy-pants programmers. I don't think I own any AVR or Atmel programmers, just an st-link. And in summary, that's a lot of words to say that I will be re-building the mouse PCB, and making its base larger to accommodate my hand. Might add more buttons too, who knows!


New PCB

The first and most important hurdle is re-creating the PCB. It has no design elements I haven't done before, and most of the challenge will be having the same mechanical shape and not frying any of the components while transferring them.


Mechanical Recreation

I started by taking pictures of the PCB and using them as a reference image in FreeCAD to model the PCB, importing it into KiCAD as the board outline, and then exporting the shape of the PCB as an STL to 3d print and check fit. This approach actually worked pretty well and I got a 3d print to fit the base of the mouse. I also tried using a photoscanner to scan the PCB, and that worked pretty well too!

The new outline in FreeCAD

Most of what mattered was hole placement, the complicated exterior didn't actually seem to matter much and I think was probably mostly just like that to maximize PCB size and lighting distribution.


Circuitry / EDA

I figured I would make this project hopefully a bit easier on myself by using a fairly common MCU, and one that I've worked with before. It looks like the ATMega32u4 chips can be had these days (hallelujah!) and I know for a fact that the keyboard/mouse firmware, QMK, supports those. There are also Arduino libraries for pretending to be a mouse, and those will work as well.


By the way, the only other part of any real consequence is the mouse sensor, which is thankfully a PMW3325DB-TWV1 from pixart. There is a surprising amount of documentation available for these chips, and I think there is probably enough similar code online to make my own library if there isn't an existing one already.


The first thing I did was go ahead and refine my Atmega32u4-A schematic a bit, and make it a hierarchical sheet in KiCAD. This is what I'm starting with:

I think the next thing to do is probably to plan out the power rails, and actually maybe I should have done that first. I sorta want to order these from JLCpcb, with as many parts pre-populated as I can manage - so things like the voltage regulator(s) will be whatever I can find through LCSC that works.


It does turn out that the PMW3325 needs a lower voltage, it says its range is 1.8-2.1V in the datasheet. I'll almost certainly need a level shifter, but it's probably also possible to just run the atmega32u4 at a lower voltage, since the given "input high voltage", is `0.6*V_(cc)` - or about 3v when Vcc is 5v. Still, it's pretty easy to level-shift SPI, and I could just include some protection diodes to make sure I don't fry the pins on the PMW3325. The other thing is the datasheet shows the serial pins working to 3.3v, with what I think is their own supply pin "Vddio". There is no other indication I can find in the datasheet saying that those pins will work at 3.3v, but it might be worth a shot since it would remove the need for a level shifter.


I didn't see any voltage regulators in stock at LCSC that would work for ~1.9v, and were a "basic part". Hopefully the additional cost of extended parts won't hurt too much. For a 1.9v regulator, the VRH1902LTX from AnaSem looks like a good choice. They have 2k+ in stock and the price is good. For a 2V option (probably preferable) - there is the ME6206A20M3G. Yes that's quite a mouthful, but there are 3k+ in stock and they're like $0.05 apiece.

et voilà!

As far as protection diodes go... There isn't a lot of headroom left when only using 2v/2.1v, so for now I'm just going to leave it out and hope nothing goes wrong. What's the worse that could happen? :D


I went ahead and just measured the voltage on the VDDIO pin on the existing PMW3325 circuit, and found it was indeed 3.3v. That's a good sign! It does mean that I need a 3.3v regulator onboard as well as the 2v one. That's fine though, voltage regulators are easy. I chose a HT7533-1, since there was already a KiCAD symbol ready and they seem ubiquitous. That leaves the PMW3325 circuit looking like this:


For the flat-pack cables running to the joystick and the mousewheel, it looks like the 6-contact will work with a JUSHUO connector from JLCPCB. The other one is 12 contacts, and should hopefully work with this connector. For now I won't be modifying the sub-pcbs, but I will have to figure out their pinout.


That's all I'm going to write for this part of the process, since I sort of dropped this project to work on other pieces. This draft has been sitting here and annoying me, so I should just wrap it up and post it. Part 2 will hopefully be completing the first PCB design & ordering it.


What I've Learned

It's not that hard to do basic reverse engineering of stuff like this mouse, but knowing techniques like using a photo scanner helps speed up the process a lot. I also think it's an excellent idea to print out the basic shape of the PCB once you have a CAD model of it, that really makes the project more approachable I think.


I also learned a bit about flat-pack cables (FPCs) - I haven't used those in my projects before. Besides that, I feel like for small projects like this, taking as many shortcuts as possible is important. Kind of a weird thing to come away with, sure, but for instance I could have saved a lot of time by just probing out voltages on the existing mouse PCB rather than trying to decipher datasheets and app notes for the MCU and the mouse sensor. It's about the priorities I suppose; whether your goal is to learn about mouse design or just to get the project done so you have a working mouse.








117 views0 comments

Recent Posts

See All

تعليقات


bottom of page