Maintenance/Mouse button replacement: Difference between revisions

From ludd
Adamw (talk | contribs)
Begin final section
Adamw (talk | contribs)
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Background and problem ==
== Background and problem ==
I'm your ordinary sort of office worker, who types and clicks far too often in the course of a day.  Various body parts connected to these devices are getting old and very much appreciate that my employer has supplied me with a mid-range ergonomic keyboard and mouse.  Office workers of the world, you are advised to ask for at least this much. I think I'm emotionally attached, perhaps it makes me feel fancy that someone spent one hundred euro on me, or one must perform one's longevity once the job becomes a career, like a delivery driver hanging a pair of fuzzy dice over the rear-view mirror after pulling away from headquarters.
I'm your ordinary sort of office worker, one who types and clicks far too often in the course of a day as if this digital thwacking were my only form of exercise.  Various body parts connected to these devices are getting old and very much appreciate the mid-range ergonomic keyboard and mouse generously granted by my employer.  Office workers of the world, you are advised to ask for at least this much.
The mouse trouble began when I moved into a "home office"—we'll spare most of the details except to say that my standing desk is not much more than a cutting board screwed to the wall at navel height.  This is the perfect height for extremely destructive impact of any plastic-encased electronics unlucky enough to fall to the floor, and small enough that this happens often.  My mouse has suffered and its once-noble exterior is held together either by gravity or by a small number of the original fasteners.  But it still clicks!


At least, it clicks most of the timeWhere this inconsistency really starts to burn is double-clicking, which is an ableist-enough exercise under normal circumstances and a fool's errand with iffy buttons.  For the past year, I've software-mapped the right and left buttons to switch them, and I hold the mouse in a funny way which lets me imagine that everything is fine, sort ofIt's also causing my habits to cross-wire, and anyway I find that the right button becomes increasingly important in proportion to how much I can't use it.
Maybe I've become too emotionally attached to these toolsI feel fancy that someone once spent a hundred euro on my well-being.  Or maybe it's all a performance of longevity as this job becomes a career—like a delivery driver who hangs a pair of fuzzy dice over the rear-view mirror to announce that they were once cool, or an academic whose bookshelf holds all the back issues of a professional journalEither way, I begin to fade when I'm separated from the mouse and keyboard.


The keyboard and mouse are a thing together, but e-waste if separated. I'd really like to make the mouse work again for the sake of the planet if nothing else.  It's just so much junk to produce and reproduce otherwise.
The mouse trouble began when I moved into my "home office"—the mouse lives on a homemade standing desk not much bigger than a cutting board, screwed to the wall at navel height where I can accidentally bump into it as I stumble out of bed.  This is also the ideal height for an extremely destructive impact of any plastic-encased electronics unlucky enough to fall to the floor.  My mouse has suffered a thousand of these shocks and its once-noble exterior is held together by a combination of gravity and only a handful of the fasteners it was born with.  But it still clicks!
 
At least, it clicks most of the time.  When I first noticed an issue with the clicking, I rushed into the denial stage of grief and just clicked a bit harder every time, until the charade wore thin.  It's not fun to jab at a mouse with maximum force every time, and even less fun when it might take two or three attempts to get a click.  This inconsistency really starts to burn when double-clicking—an ableist caprice under normal circumstances but a fool's errand for a fool whose buttons are iffy.  Then there was the hot minute for which I imagined I had worked around it by software-mapping the right and left buttons to one another, holding the mouse in a funny way so that both pointing fingers reach across to what used to be the right-hand button.  Devious games like this are causing my habits to cross-wire too, so I end up right-clicking on the trackpad, on other computers, and worst of all I found that the right button becomes increasingly important according to how unusable it is.
 
Maybe I could have adopted another mouse but the manufacturer cleverly shipped it as a bundle with the keyboard.  These two and the USB dongle are a happy little nuclear family, and nothing but the unhappiest e-waste if separated.
 
I'd really like to make the mouse work again for the sake of the planet if nothing else.


== Pop the hood<ref>I don't own a car nor do I condone their use but did I grow up in California, USA so everything comes with a car metaphor.</ref> ==
== Pop the hood<ref>I don't own a car nor do I condone their use but did I grow up in California, USA so everything comes with a car metaphor.</ref> ==
[[File:Mouse in original condition.jpg|thumb|Something's rotten about these microswitches]]
[[File:Mouse in original condition.jpg|thumb|Something's rotten about these microswitches]]
I measured missed clicks with the linux utility <code>xev</code> <ref>https://www.x.org/releases/X11R7.7/doc/man/man1/xev.1.xhtml</ref> and it showed that the buttons had become sensitive to the exact orientation of my finger.  Either something was wrong with the alignment of the broken plastic parts, contact material was worn off of the internal switch, dust sand and chips had gotten in, or all of the above.  First thing to do is just put it back together, next I cleaned the stray lint, squirted air all around and flooded the button with isopropyl, finally imagining very hard that I had fixed the issue, yet still nothing changed.
I started the repair by measuring missed clicks with the linux utility <code>xev</code> <ref>https://www.x.org/releases/X11R7.7/doc/man/man1/xev.1.xhtml</ref>, which showed that the buttons had become sensitive to the exact orientation of my finger.  Only a downward-and-rightwards press would have an effect.  Either something was wrong with the alignment of the broken plastic parts, contact material was worn off of the internal switch, dust sand and chips had gotten into the sealed part, or all of the above.  First thing to do is just to disassemble and reassemble.  Next, I cleaned it by wiping out the stray lint, squirting canned air at all the moving parts and flooding the heart of the buttons with isopropyl alcohol, finishing off the routine by squinting my eyes and imagining very hard that I had fixed the issue, yet nothing changed.  Even with the cover off, the buttons behaved badly.


Firmly stuck in the honeymoon phase, I believed that a light repair would involve a quick business of swapping out the standard microswitches (silver squares with an orange dot in the middle)They seem to all come in the same vanilla flavor since long before this particular thing was made ten years ago.  All 8 solder points are accessible as you might see in this image.
Still feeling stubborn though beginning to accept fate, I planned to replace the standard microswitches, the little silver squares with an orange dot in the middle which are pressed by plastic stems inside of the buttonsThese switches come in exactly the same vanilla flavor that has been made since long before this particular mouse was dreamed up ten years ago.  All 8 solder points are accessible as you might see in this image, so it shouldn't be a challenging fix.


I confirm that the switches have the same pinout and footprint as the potential replacements, although the proof will not be definitively in the pudding until the switches are isolated from their circuit.
I was able to confirm that the switches have the same pinout and footprint as their potential replacements, although the proof will not be definitively in the pudding until the switches are isolated from their circuit.


A fellow Earth defender in my office's IT department orders the new switches and I barely remember the next couple of weeks of missed clicks.
Two fellow Earth defenders on my office's IT Team ordered the new switches and encouraged my bravado, and I barely remember the next couple of weeks of missed clicks.
[[File:Desoldering a mouse microswitch.jpg|thumb|Prying the switches off]]
[[File:Desoldering a mouse microswitch.jpg|thumb|Prying the switches off]]


== What could possibly go wrong? ==
== What could possibly go wrong? ==
To lift both legs on one side, I think the right tool would be a hot air setup or a double-headed iron.  Desoldering the legs one at a time is hard to do otherwise.  I relied on the versatile thumbtack to apply some pressure to the joint as I heated up each pad in turn.
The old switches need to be desoldered but the geometry of a four-legged chip is slightly annoying.  I believe that the right tool to lift both legs on one side or all four legs at once would have been a two-headed iron like soldering tweezers, or a rework station with a hot air gun.  Desoldering the legs one at a time with the regular soldering iron is hard to do.  I turned to the infinitely versatile metal thumbtack to apply some pressure to the switch body as I heated up each pad in turn.


In hindsight, I relearned the lesson that coffee and fine motor work mix poorly.  My hands were trembling like leaves and I probably used ten times the force that I should have when pushing the thumbtack under the switch.  I also should have pried only at the legs and not at the body of the switch itself.
In hindsight, the main lesson I relearned is that coffee mixes poorly with fine motor tasks.  My hands were trembling like leaves in wind, and I probably used ten times the force that I should have when pushing the thumbtack under the switch.  I also should have pried only at the legs and not at the body of the switch itself, if possible.


As you have probably guessed, gentle reader, I tore a bunch of important and small electrical traces off of the top of the board during this step.
What I'm trying to get around to telling you, gentle reader, is that I tore away half of the important little electrical traces during this step.


Here are some photos of the damage:
Here are some photos of the damage:
[[File:Old_and_torn_microswitches.jpg|left|thumb|Removing the original microswitches has wounded their host]]
[[File:Old_and_torn_microswitches.jpg|thumb|Removing the microswitches has wounded their host.]]
[[File:Mouse_switch_board_with_missing_traces.jpg|thumb|There should be no brown visible, this shows that electrical traces were torn away.]]
[[File:Mouse_switch_board_with_missing_traces.jpg|thumb|There should be no bare circuit board visible, this is where the electrical traces were torn away.|left]]
It's a bit like discovering that bits of a placenta are missing after birth: this is going to be a serious problem and we shouldn't continue without knowing exactly what went wrong.
It's similar to discovering that bits of a placenta are missing after birth: inspect everything that came out, if it's intact then you're probably good.  If something is missing then assume it's going be a serious problem and don't continue without finding out exactly what went wrong.
[[File:Microswitch_internal_circuit.png|thumb|Internal schematic for a microswitch]]
[[File:Microswitch_internal_circuit.png|thumb|Internal schematic for a microswitch]]
Nonetheless, I thought I would try to finish the replacement as planned.
Nonetheless, I thought I would try to finish the replacement as planned.


After all, the internal wiring for these switches has the left and right pads tied together internally so it's possible that we only need one pad conducting the signal and the other would have no traces, purely for mechanical attachment.  This could also explain why the exact same pads tore more easily on each switch?
After all, the internal wiring for these switches has the left and right pads tied together internally so it's possible that we only needed one pad conducting the signal and the other had no traces anyway, it's purely there for mechanical attachment.  This could also explain why the same pads tore away on both switches?


The new switches went in.
The new switches went in without too much fuss.


I should mention at this point that I'm a complete hack—an unlicensed hobbyist.  I was let go from a summer job soldering for a hardware video artist decades ago, and flashbacks from this experience came against my will, singeing my conscience with a cloud of lead smoke even at this distance through time, as I sweat over two small switches.
I should mention at this point that I'm a complete hack—an unlicensed hobbyist.  I was let go from a summer job working for a hardware video artist at which I made 10,000 solder connections, decades ago.  Honestly, flashbacks from this experience came to me against my wishes, singeing my conscience with a cloud of lead smoke as I sweat over the two small switches.


Okay but it went uneventfully and here is the result, notice the handsome slate-gray nubs.
Okay but it went uneventfully and here is the result, notice the handsome new slate-gray nubs.
[[File:Mouse with new microswitches.jpg|thumb|New mouse same as the old mouse|left]]
[[File:Mouse with new microswitches.jpg|thumb|New mouse same as the old mouse|left]]
There was a slight height difference between the old and new switches, so I was ready to sand down the part of the button which does the internal pressing.
There was a slight height difference between the old and new switches, so I prepared to shave down the plastic step which does the internal pressing.  The mechanical clickiness felt great.
[[File:Two types of microswitch.jpg|thumb|Side view of old (left) and new (right) switches]]However, this is where the story turns sad: although the mechanical clickiness feels better than what I remember of original condition, there is no signal sent from either button.  They are dead to the computer, and a multimeter confirms nothing is happening on the board.
[[File:Two types of microswitch.jpg|thumb|Side view of old (left) and new (right) switches]]However, this is where the story takes a sad turn: there was no signal sent from either button.  They are dead to the computer, and a multimeter confirms nothing is happening on the board.
My photographer suddenly gets distracted by the pretty trees outside of our window and mercifully snaps a few photos of that, instead of zooming in on my shed tears as a more seasoned journalist might have done.[[File:Trees outside a window.jpg|thumb|All is not lost.|left]]
 
This is the point at which my photographer suddenly gets distracted by the pretty trees outside of our window and mercifully snaps a few photos of that, instead of zooming in on my fallen expression and the tears running down my cheeks, as a more seasoned journalist might have done.
[[File:Trees outside a window.jpg|thumb|All is not lost—hey, look at these trees!]]
 
<div style="clear: both;"></div>


== Nothing to lose but our chains ==
== Nothing to lose but our chains ==
[[File:Scattered screws.jpg|thumb|So many screws]]
[[File:Scattered screws.jpg|thumb|So many screws]]
Time to go deep.  Take the everything apart and find out what's going on.  I'd rather not pull the switches back off, for fear of tearing out the remaining traces.  Instead, there's got to be a way of reconnecting the signals that connected to the missing surface-mount pads.  A continuity tester confirms that the working buttons do what we might expect: one side has a positive voltage and the other causes a wire in the board connector jumper to toggle between high-impedance and the positive voltage.  The broken buttons don't cause a similar signal anywhere on the jumper, and it's hard to tell where the traces should have gone because of the high-obscurity board layout and black solder mask.
Time to go deep.  Take apart the everything and find out what I broke.  I'd rather leave the switches in place, they seem good enough mechanically and I'll probably just tear away the remaining traces if I touch them again.  Instead, there's got to be a way of rerouting the signals that went to the missing surface-mount pads.  A continuity tester confirms that the other working buttons do what we might expect: one side has a positive voltage and the other side causes a wire in the board connector to toggle between high-impedance and positive reference.  The broken buttons don't cause a similar signal anywhere on the board connector, and it's hard to follow the traces because of the high-security board layout and black solder mask.
 
<div style="clear: both;"></div>
 
[[File:Mouse confidential board.jpg|thumb|left]]
<big>Oh, hold everything!  The middle board is clearly marked "confidential", we'll have to stop here because it's simply not allowed.  (I jest.)</big>
 
<div style="clear: both;"></div>
 
[[File:Two layer board.jpg|thumb|Two-layer board edge]]
Looking at the edge of the PCB shows that it's only two layers so everything that happens is on the front and back.  Electrical networks can only cross through the board via a via, go sideways along a trace of foil, or through a component.  Nonetheless, I can't quite follow the signal.  Now we're going to have fun: I make a test jumper ending with a small resistor to avoid a high-current short, clip it to the positive reference voltage on a working switch, and poke this into each conductor of the board connector one at a time with the mouse powered on.  Xev begins to reveal the confidential secrets.
 
Luckily for me, this is successful!  It becomes clear which of the switch pads should carry positive voltage and which board connector wires relay the outgoing button signals.
[[File:Mouse final jumpered top.jpg|thumb|Top jumper|left]]
[[File:Mouse final jumpered back.jpg|thumb|Bottom jumper]]
In the end it only takes two additional wires to make the mouse fully functional.  Photos are included for your amusement.  The top jumper looks especially scary since it attaches to an unusual hole cut in a ribbon cable, but both wires make me slightly queasy.
 
I would file this hack under the "I'll jam the satellite uplink with my hair clip while you break into the broadcast station with a chainsaw" school of electrical engineering, and the resulting monstrosity is a fire hazard without a doubt.  I wouldn't feel comfortable letting anyone else use it.  But it's good enough for me!
 
<div style="clear: both;"></div>
 
[[File:Mouse is patched.jpg|thumb|Empiricism rules.|left]]
<big>Here's a close-up of the most absurd detail, where I scraped away at the ribbon cable insulation to more easily patch in—kids, please don't try this at home.</big>
 
<div style="clear: both;"></div>


== Notes ==
== Notes ==

Latest revision as of 06:55, 20 September 2023

Background and problem[edit | edit source]

I'm your ordinary sort of office worker, one who types and clicks far too often in the course of a day as if this digital thwacking were my only form of exercise. Various body parts connected to these devices are getting old and very much appreciate the mid-range ergonomic keyboard and mouse generously granted by my employer. Office workers of the world, you are advised to ask for at least this much.

Maybe I've become too emotionally attached to these tools. I feel fancy that someone once spent a hundred euro on my well-being. Or maybe it's all a performance of longevity as this job becomes a career—like a delivery driver who hangs a pair of fuzzy dice over the rear-view mirror to announce that they were once cool, or an academic whose bookshelf holds all the back issues of a professional journal. Either way, I begin to fade when I'm separated from the mouse and keyboard.

The mouse trouble began when I moved into my "home office"—the mouse lives on a homemade standing desk not much bigger than a cutting board, screwed to the wall at navel height where I can accidentally bump into it as I stumble out of bed. This is also the ideal height for an extremely destructive impact of any plastic-encased electronics unlucky enough to fall to the floor. My mouse has suffered a thousand of these shocks and its once-noble exterior is held together by a combination of gravity and only a handful of the fasteners it was born with. But it still clicks!

At least, it clicks most of the time. When I first noticed an issue with the clicking, I rushed into the denial stage of grief and just clicked a bit harder every time, until the charade wore thin. It's not fun to jab at a mouse with maximum force every time, and even less fun when it might take two or three attempts to get a click. This inconsistency really starts to burn when double-clicking—an ableist caprice under normal circumstances but a fool's errand for a fool whose buttons are iffy. Then there was the hot minute for which I imagined I had worked around it by software-mapping the right and left buttons to one another, holding the mouse in a funny way so that both pointing fingers reach across to what used to be the right-hand button. Devious games like this are causing my habits to cross-wire too, so I end up right-clicking on the trackpad, on other computers, and worst of all I found that the right button becomes increasingly important according to how unusable it is.

Maybe I could have adopted another mouse but the manufacturer cleverly shipped it as a bundle with the keyboard. These two and the USB dongle are a happy little nuclear family, and nothing but the unhappiest e-waste if separated.

I'd really like to make the mouse work again for the sake of the planet if nothing else.

Pop the hood[1][edit | edit source]

Something's rotten about these microswitches

I started the repair by measuring missed clicks with the linux utility xev [2], which showed that the buttons had become sensitive to the exact orientation of my finger. Only a downward-and-rightwards press would have an effect. Either something was wrong with the alignment of the broken plastic parts, contact material was worn off of the internal switch, dust sand and chips had gotten into the sealed part, or all of the above. First thing to do is just to disassemble and reassemble. Next, I cleaned it by wiping out the stray lint, squirting canned air at all the moving parts and flooding the heart of the buttons with isopropyl alcohol, finishing off the routine by squinting my eyes and imagining very hard that I had fixed the issue, yet nothing changed. Even with the cover off, the buttons behaved badly.

Still feeling stubborn though beginning to accept fate, I planned to replace the standard microswitches, the little silver squares with an orange dot in the middle which are pressed by plastic stems inside of the buttons. These switches come in exactly the same vanilla flavor that has been made since long before this particular mouse was dreamed up ten years ago. All 8 solder points are accessible as you might see in this image, so it shouldn't be a challenging fix.

I was able to confirm that the switches have the same pinout and footprint as their potential replacements, although the proof will not be definitively in the pudding until the switches are isolated from their circuit.

Two fellow Earth defenders on my office's IT Team ordered the new switches and encouraged my bravado, and I barely remember the next couple of weeks of missed clicks.

Prying the switches off

What could possibly go wrong?[edit | edit source]

The old switches need to be desoldered but the geometry of a four-legged chip is slightly annoying. I believe that the right tool to lift both legs on one side or all four legs at once would have been a two-headed iron like soldering tweezers, or a rework station with a hot air gun. Desoldering the legs one at a time with the regular soldering iron is hard to do. I turned to the infinitely versatile metal thumbtack to apply some pressure to the switch body as I heated up each pad in turn.

In hindsight, the main lesson I relearned is that coffee mixes poorly with fine motor tasks. My hands were trembling like leaves in wind, and I probably used ten times the force that I should have when pushing the thumbtack under the switch. I also should have pried only at the legs and not at the body of the switch itself, if possible.

What I'm trying to get around to telling you, gentle reader, is that I tore away half of the important little electrical traces during this step.

Here are some photos of the damage:

Removing the microswitches has wounded their host.
There should be no bare circuit board visible, this is where the electrical traces were torn away.

It's similar to discovering that bits of a placenta are missing after birth: inspect everything that came out, if it's intact then you're probably good. If something is missing then assume it's going be a serious problem and don't continue without finding out exactly what went wrong.

Internal schematic for a microswitch

Nonetheless, I thought I would try to finish the replacement as planned.

After all, the internal wiring for these switches has the left and right pads tied together internally so it's possible that we only needed one pad conducting the signal and the other had no traces anyway, it's purely there for mechanical attachment. This could also explain why the same pads tore away on both switches?

The new switches went in without too much fuss.

I should mention at this point that I'm a complete hack—an unlicensed hobbyist. I was let go from a summer job working for a hardware video artist at which I made 10,000 solder connections, decades ago. Honestly, flashbacks from this experience came to me against my wishes, singeing my conscience with a cloud of lead smoke as I sweat over the two small switches.

Okay but it went uneventfully and here is the result, notice the handsome new slate-gray nubs.

New mouse same as the old mouse

There was a slight height difference between the old and new switches, so I prepared to shave down the plastic step which does the internal pressing. The mechanical clickiness felt great.

Side view of old (left) and new (right) switches

However, this is where the story takes a sad turn: there was no signal sent from either button. They are dead to the computer, and a multimeter confirms nothing is happening on the board.

This is the point at which my photographer suddenly gets distracted by the pretty trees outside of our window and mercifully snaps a few photos of that, instead of zooming in on my fallen expression and the tears running down my cheeks, as a more seasoned journalist might have done.

All is not lost—hey, look at these trees!

Nothing to lose but our chains[edit | edit source]

So many screws

Time to go deep. Take apart the everything and find out what I broke. I'd rather leave the switches in place, they seem good enough mechanically and I'll probably just tear away the remaining traces if I touch them again. Instead, there's got to be a way of rerouting the signals that went to the missing surface-mount pads. A continuity tester confirms that the other working buttons do what we might expect: one side has a positive voltage and the other side causes a wire in the board connector to toggle between high-impedance and positive reference. The broken buttons don't cause a similar signal anywhere on the board connector, and it's hard to follow the traces because of the high-security board layout and black solder mask.

Oh, hold everything! The middle board is clearly marked "confidential", we'll have to stop here because it's simply not allowed. (I jest.)

Two-layer board edge

Looking at the edge of the PCB shows that it's only two layers so everything that happens is on the front and back. Electrical networks can only cross through the board via a via, go sideways along a trace of foil, or through a component. Nonetheless, I can't quite follow the signal. Now we're going to have fun: I make a test jumper ending with a small resistor to avoid a high-current short, clip it to the positive reference voltage on a working switch, and poke this into each conductor of the board connector one at a time with the mouse powered on. Xev begins to reveal the confidential secrets.

Luckily for me, this is successful! It becomes clear which of the switch pads should carry positive voltage and which board connector wires relay the outgoing button signals.

Top jumper
Bottom jumper

In the end it only takes two additional wires to make the mouse fully functional. Photos are included for your amusement. The top jumper looks especially scary since it attaches to an unusual hole cut in a ribbon cable, but both wires make me slightly queasy.

I would file this hack under the "I'll jam the satellite uplink with my hair clip while you break into the broadcast station with a chainsaw" school of electrical engineering, and the resulting monstrosity is a fire hazard without a doubt. I wouldn't feel comfortable letting anyone else use it. But it's good enough for me!

Empiricism rules.

Here's a close-up of the most absurd detail, where I scraped away at the ribbon cable insulation to more easily patch in—kids, please don't try this at home.

Notes[edit | edit source]

  1. I don't own a car nor do I condone their use but did I grow up in California, USA so everything comes with a car metaphor.
  2. https://www.x.org/releases/X11R7.7/doc/man/man1/xev.1.xhtml