Inside the Omron D2FC-F-7N microswitch

When my ancient Logitech G500 mouse stopped working properly, I followed these helpful instructions to bring it back to life. Now I know more than I ever wanted to know about the mechanics inside the Omron D2FC-F-7N microswitch.

Here’s a short video I made showing how it should work:

Inside the Omron D2FC-F-7N Microswitch
“10M” stands for 10 million operations. There’s apparently also a 20M version.

This is a photo of a working switch:

Working Omron D2FC-F-7N microswitch
The purple arrow points at the contact area that may require cleaning (opposite side as well). You do not necessarily have to remove the leaf spring to do this (I recommend leaving it in place). The green arrows point at the notches mentioned in the article linked above.

The following switches will not work as the leaf spring is not positioned correctly in one of the notches:

Omron DSFC-F-7N defective microswitch
Omron DSFC-F-7N defective microswitch
This one is particularly tricky as it is impossible to see the problem with the naked eye (it looks fine but should be in the notch above).

I recommend opening the switch from this side (compare label on your switch for orientation):

Opening Omron DSFC-F-7N microswitch
Just like me, you will most likely bend and dislocate the spring if you open the switch from the other end.

Finally, a photo with my finger shows why these are called microswitches (actually Omron uses the term “Ultra Sub Miniature Basic Switch”):

Omron DSFC-F-7N microswitch size
If you don’t like working with tiny parts you might be better off getting a new mouse.

Disclaimer: If your mouse has been in use for several years, you should seriously consider buying a replacement switch. I believe you could desolder the switch from the top by cutting it into pieces first (the plastic is rather soft). Replacements don’t seem to be available from electronic components distributors but are sold on Amazon.com (affiliate link).

I was only able to repair my mouse because I had another broken one from which I stole a leaf spring (from the less-used right switch). The original spring of the left switch in my mouse was badly deformed. Unfortunately I can’t show you any pictures because it flew away when I tried to bend it.

Connecting a scale or balance to a Raspberry Pi: project ideas

On digitalscalesblog.com, I showed how easy it can be to send the weight from a scale to a Python script running on a Raspberry Pi (if you choose the right scale). As I had never used Python before, all the script did was print the weight data. That doesn’t mean you have to stop there. Here a some ideas and links to get you going.

  • Use the Raspberry Pi as a serial device server (from RS-232 to TCP/IP over Ethernet or WiFi). Code examples can be found in the pySerial documentation.
  • Build a protocol converter. Most scales use proprietary protocols, but you can convert the data to MQTT or other protocols as shown here. Do not say that you have developed a protocol converter, call it an IoT gateway to get more attention.
  • Use speech synthesis to output the weight as spoken words for visually impaired users.
  • Use speech recognition to send commands to the scale (e.g. the tare command).
  • Install a Pi Camera Module and take a picture of the user every time the scale is overloaded.
  • Turn the scale into a checkweigher by comparing the weight with preset values and making under/accept/over LEDs light up.
  • Transform the weight into a proportional analog signal (voltage) because… I have no idea! Why do people keep asking for weighing scales with an analog output? Seriously, if you know the answer, please tell me.
  • Trigger an alarm or something worse when an object is removed from the scale:
Raiders of the Lost Ark IMAX Movie CLIP - Throw Me the Idol (2012) - Harrison Ford Movie