Ow, don't click so hard..
November 3, 2006 6:20 PM   Subscribe

How can I make a computer mouse detect the pressure used to click?

I want to be able to get a value of the force used to click on the mouse button. Just the left-button is fine. I can take care of the software part if there is hardware to do this. Does anyone know,

1) Is there is an existing computer mouse that can report the click force?
2) If not, how I can modify the mouse to do this?
3) Any other creative sugestions to achieve what I want?
posted by tasty to Computers & Internet (18 answers total)
The average computer mouse simply has a couple of spring loaded microswitches underneath the buttons. The force required to "click" the button is constant, and fairly repeatedable. You measure it by a simple deflection of a calibrated torque bar. or alternatively, with a force plunger, which is an opposed spring loaded device, which shows force on a linear scale, as its main spring is compressed.
posted by paulsc at 6:35 PM on November 3, 2006

What you want is a graphics tablet. Those do detect pressure; many drawing programs use that information in controlling the kind of changes they make to the image being edited.

As PaulSC says, you won't be doing that with any mouse I've ever heard of.
posted by Steven C. Den Beste at 6:39 PM on November 3, 2006

Note: Not all graphics tablets sense pressure. You need to look for "pressure sensitive pen" or some comparable phrase.
posted by Steven C. Den Beste at 6:41 PM on November 3, 2006

Wacom's pressure sensitive tablets can use the pen tip as a clicking device. Since the pen tip is pressure sensitive, it's probably capable of measuring the click's pressure. I have no idea if the mouse they sell has any comparable ability, but check with them for ideas.
posted by nakedcodemonkey at 6:45 PM on November 3, 2006

I don't think a standard mouse could give you this kind of information. But I bet you dollars to donuts that a short duration click would be of less pressure than a longer duration click. Unless of course someone was intentionally trying to make hard short-duration clicks and soft long-duration clicks. You may be able to approximate by duration.
posted by dgeiser13 at 7:18 PM on November 3, 2006

A graphics tablet may be best depending on your application, but it's always fun to take apart electronics. What force do you want to measure, impact or continuous? Either way, significant modification to a standard mouse would be necessary. Getting that information to the computer would require wiring whatever sensor you use into the serial channel.

You could use a force plunger, but another solution (again, depending on your application) could be to measure the deflection of the button. This would be best for a continuous force measurement. You could do this with a potentiometer; move the button switch further back (towards the palm) on the button, and this (along with some cutting on the plastic body) will allow the tip of the mouse button to flex a little more, which you can measure.
posted by backseatpilot at 7:46 PM on November 3, 2006

The cheapest/easiest source of pressure-sensitive analoque push-button switches is 3rd-party video console controllers (eg playstation or xbox-compatible controllers). You could either use the controller directly with the computer via a USB->PS2 adaptor (they're about $14, but make sure you get one that supports analogue - not all of them do), or desolder a buttons from the circuit board and install it inside a mouse, replace the cord with one that has an extra couple of wires, and then add a parallel port plug to the end of the cord, in addition to the mouse USB (or other) plug. I think they just offer a resistance value that corresponds to the pressure.

If you want to MacGyver up an analogue pressure sensor, grab some of that conductive/anti-static foam that IC chips sometimes ship in, put foil on each side, and the resistance changes with how much you press the foam sandwich.
posted by -harlequin- at 8:27 PM on November 3, 2006

The sensor is the easy part. The hard part is getting that information back to the computer. If, for instance, you used some sort of analog measuring device (and there are several possibilities) then you'd have to have an A/D converter -- and a microprocessor attached to it which knew how to read the value, and which had an interface back to the computer. You'd have to invent a new communications protocol.

And you'd have to write a driver for the OS which could read it. Got a few months to spare?

Much better to use an existing solution, for which drivers already exist. So get a graphics tablet, and forget about modifying a mouse.
posted by Steven C. Den Beste at 8:45 PM on November 3, 2006

However, the mouse that comes with a tablet is *NOT* pressure sensitive. Only the pen.
posted by mphuie at 9:54 PM on November 3, 2006

Steven C. Den Beste:

Hobbyists build parallel port A/D interfaces all the time, for all manner of projects, there is screeds of stuff online - schematics and tutorials and software and so on, spanning a wide range of levels of difficulty and features. It's not as big an undertaking you're making it out to be - most of the work has already been done for you. But a soldering iron will be involved ;-)
posted by -harlequin- at 11:54 PM on November 3, 2006

Another thought - you could look into using a mouse with a scroll wheel, and use the rotation sensor of the scroll wheel as your ready-made means to send pressure data from the left-click, since the scroll wheel outputs data that is very simple for any software to read. Turning a rotation sensor into a pressure sensor then becomes the trick. This probably means either interesting mechanics (such as using a mechanism like that of a gas-pressure guage, to turn the slight lateral movement of plastic flexing slightly under pressure into a pronounced rotational movement), or depending on how the sensor works, an electrical pressure sensor might be feasible too.

If you don't need the computer to be able to read the pressure data, you just want to be able to see the reading yourself each time (you didn't specify), then everything becomes very simple, but I'm assuming you meant you want your software to be able to take the reading.

posted by -harlequin- at 12:12 AM on November 4, 2006

OR... wandering even further afield... use a usb mouse, put the circuit board of a small usb hub inside it, spliced between the mouse circuit board and the mouse cord, and add the circuit board of a usb volume controller that uses a knob or dial (ie a potentiometer). Then you can replace the potentiometer (which is a kind of variable resistor) with an analogue pressure switch (which is likewise a kind of variable resistor), and the computer can read button pressure as the volume setting of the USB volume controller. Making the resistance values of the pressure sensor in the same ballpark is best done in your selection or construction of the sensor, but can also be done with some circuit modification, and is probably also possible via software if they're not miles apart.
posted by -harlequin- at 12:20 AM on November 4, 2006

Another idea, will five detectable levels of pressure be sufficient? As you could get those mouses with five extra buttons, and... you can see where I'm going with this :-)
posted by -harlequin- at 12:23 AM on November 4, 2006

Random note: PS2 controller buttons (X O Triangle Square, and possibly others, though I don't remember) are actually pressure sensitive. Since they 'feel' like ordinary buttons, you wouldn't guess it, but the controller can detect how hard you are hitting them.

Given how common these are, and how easy it is to get a PS2->USB adapter, if you could appropriate the guts somehow, it might be useful...
posted by blenderfish at 12:39 AM on November 4, 2006

Another approach - Write a cheque. Getting a pro outfit to make one would be prohibitive, but some hobbyiest might be enlistable with a hunded dollars or so to implement the necessary scroll-wheel mod or something - especially if your software was going to do something of interest to them. You could go to a few computer/elecronics/modding sites with forums and see if there is any interest.
posted by -harlequin- at 1:29 AM on November 4, 2006

The actual kinds of direct pressure transducers suitable for consideration in a reworked mouse that would be pressure sensitive are the various kinds of low range strain guage load cells, particularly optical types, and the piezoelectric transducer. Various minature types are available which would seem to offer possibilities for integration into a fairly standard mouse body, and there are all kinds of ready made interface products available. Some custom machining would be required to make something accurate, repeatable, and decently functional, but it is not a particularly difficult project, for even moderately skilled hobbyists.

But I think the OP's question was simply how to measure the force required to click a mouse button. That is easily answered by something as simple as a low range force plunger.
posted by paulsc at 1:57 AM on November 4, 2006

For reference, you would have to be able to build and program something like this. Substitute your analog pressure level for the barometer sensor.

Even if you go the route of the pressure sensing pen you would still need some way to interface (API) with the driver to get the pressure values. I dont think this is a doable task for a non-programmer. At least this method kinda removes the need for custom hardware and driver programing, but I have no idea how you can fit one of those electric pens into a mouse without serious modification to both devices.
posted by damn dirty ape at 12:53 PM on November 4, 2006

FWIW, I've played with some basic robotics toys and think this is a doable beginners project. I'd go the route of the pressure pen because the hardware and sofware are already there for you. I'd probably hire/ask someone about programming the Wacom API and how I could get the value into a usable format. The gigs section on craigslist, USENET, etc are all good sources.

You could start the project at freshmeat as open source and find some smart and free labor! I'm sure there are other people who could use such an app.

Now hardware is still going to be a problem. If the wacom pen could easily fit into a mouse you'd be set. But it probably wont.

I do know that IBM used to sell a scroll mouse with its pentium4 desktops that had no scroll wheel. It was a pressure sensitive blue button. There might be an easily modified open source driver for this. Or you could hire someone for this. For your experiment you could map this middle button as your left button. That requires zero hardware modification. I dont know the model number, sorry, but I found it on ebay for you here. Good luck!
posted by damn dirty ape at 1:13 PM on November 4, 2006

« Older Which IRA/broker/funds to get when facing...   |   Powergrab 2.6 has been acting kinda funny on me... Newer »
This thread is closed to new comments.