I have an idea to have a button, which houses two opposite facing magnets, so that they push apart, and provide tension for the button when you press it. I would like the button to have two steps - so press it a bit, and get more pressure from the button, and when you get past a certain threshold, it releases the pressure, allowing you to depress the button fully.

I want the sensation to be like snapping a brittle match, not like bending a soft metal rod.

So, my question is... if I can control the flow of electricity to the magnets, how quickly can the force between the magnets change? Does it change as fast as the electric input? Does it build up and slow down? Is this measurable? Is there any way to increase the speed at which the magnet can change?


Just to clarify - I don't only want to have a switch that can have two steps. I want to have a switch that can be programatically altered, so that the tension matches a profile defined on some arbitrary algorithm that regulates the current. I would like it to be able to switch profiles instantaneously, and dynamically.

  • 1
    \$\begingroup\$ It sounds like a conventional domed membrane tactile switch to me. \$\endgroup\$ – Andy aka Nov 21 '13 at 10:03
  • \$\begingroup\$ Andy is right, people like Cherry make individual switches for keys on keyboards that have a variety of pressure profiles (named MX blue, red, brown, black etc). See Force/Travel diagram in Cherry MX - these will be far less expensive and much more reliable than an electromagnetic system. See also buckling spring \$\endgroup\$ – RedGrittyBrick Nov 21 '13 at 11:09
  • \$\begingroup\$ Thanks for the tips - but mechanical just won't do. I want to adjust the pressure of the switch programatically, in response to disconnected events. \$\endgroup\$ – Billy Moon Nov 21 '13 at 11:19
  • \$\begingroup\$ Usually, an electromagnet's field will respond much faster than one is able to sense. Think for example of AC transformers switching the magnetic field 100x per second. \$\endgroup\$ – JimmyB Nov 21 '13 at 13:46

This is an interesting idea, do you want to make this threshold variable? If not I would have just gone for a mechanical switch that gives the same effect. Electromagnets/Inductors tend to not like changes in current, so the change won't be instant, it will probably so fast that you won't be able to feel it though. You could speed it up somewhat by placing a high speed diode across the terminals of the magnet reverse biased, this helps collapse the magnetic field once the current is disconnected.

  • 1
    \$\begingroup\$ Although clamping the voltage across the coil is necessary to prevent excess voltage on turn-off, adding a flyback diode by itself will actually slow-down the turn-off of the magnet as it limits the voltage opposing the current flow of the coil to one diode-drop (V = L di/dt). To speed up the current decay, add a TVS diode (similar to a zener) in series with the flyback diode; but this requires care that the voltage does not exceed the Vds-max (or Vce-max) limits of the coil driver. \$\endgroup\$ – Tut Nov 21 '13 at 12:48

The coil of the proposed electromagnet will tend to oppose any change in current through itself, as is the behavior of any inductor.

To reduce the time taken to switch between magnetization profiles, here are some points to keep in mind:

  • Use a higher voltage drive, with current limiting. This way, a higher potential difference across the ends of the coil forces the current to change more rapidly, and once the desired current (and hence the desired magnetic field) is achieved, the current limiter prevents the coil from overheating. This method is widely used in stepper motor drivers, for instance, to cause steps to be faster, while not exceeding the coil current ratings. The term "chopper driver" would yield suitable search results.
  • Use the smallest possible magnetic core (soft iron or whatever material is chosen), and use a lower resistance coil so that the bulk of the magnetic field is due to the coil. The bigger the core, the longer a magnetic field established in it will take to collapse. Equivalently, the longer it will take to build up sufficient magnetic field strength in the assembly. Think of it as magnetic "inertia", similar to how a larger mass takes longer (or more energy) to get moving, or to bring to a halt. The downside is, this will mean higher current consumption by the coil.

The problem remains, though, that there needs to be a method of sensing when the button is pushed past the inflection point, to determine when the magnetic field needs to be collapsed (a fast diode, as mentioned in another answer) or reversed. A fair bit of sensing and computing will go into each button for this purpose alone.

An innovative physical arrangement could simplify this and be used to provide the button-press experience described:

Instead of two opposing magnetic poles face to face, with the electromagnet opposing the magnet on the button, consider the following:


The rectangular magnets on two sides of the button's movement path are electromagnets, so the field strength can be controlled. The round permanent magnet fitted on the button has polarity reverse to the electromagnets, i.e. the North face is downward in this example.

The button would thus face a strong resistance even up to the point when the magnet is aligned to the electromagnets. As soon as the button pushes past that, the magnetic opposition is in the opposite direction, i.e. pushing the button downward against the spring below. When the button is released, and the electromagnet power removed, the spring pushes the button past the electromagnets, to the upper equilibrium position.

By varying the electromagnetic strength, the springiness before the inflection point can be varied, and this does not need any form of sensing of the button position relative to the electromagnets.

  • \$\begingroup\$ Indeed, to really simulate a synthetic profile, continuous position measurement may be needed. And direct force sensing would also help. Essentially, the system will need control loops for position and force and to vary them as a function of each other! \$\endgroup\$ – Chris Stratton Nov 21 '13 at 13:20
  • \$\begingroup\$ +1 Nice answer ... A couple comments: Regarding the higher voltage drive there are alternatives to the chopper drive. Perhaps the simplest is a current-limiting resistor along with the higher voltage supply. This used to be done for steppers before chopper drives came into fashion. Due to it's simplicity, it might be a better solution if there are multiple push-buttons. For turn-off speed, see my comment to s3c's answer regarding turn-off speed and the flyback diode. \$\endgroup\$ – Tut Nov 21 '13 at 21:18

One example of a small electromagnet interacting with a permanent magnet is a loudspeaker. That should give you an idea of how quickly the force on a small coil can change and what sort of power you need to drive it, and possibly you can hack a cheap speaker to create a prototype.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.