Electronic – arduino – How to build a programmable sticky button

arduinobuttonsolenoid

I'm trying to build a button that can exist in two modes. Either it springs back after being pressed, or it stays pressed. I want to switch between these two modes using some complex logic, controlled by an Arduino or a RaspberryPi. The dimensions should be around 1'-by-1', and I'll have a 5-by-6 grid of these buttons to make a puzzle. I'm struggling to come up with a simple design for one such button.

I thought of using a solenoid, but they have a duty cycle and use a lot of power in one of the two modes. Ideally, I would only need power to switch between the two states. That way, a player can play with the puzzle for a while, then leave it alone overnight and come back to playing the day after. I'd rather not keep the solenoids powered overnight.

Another idea I had was to use two electromagnets to pull some kind of a latch back and forth, to jam the button in its pressed state. But that seems complicated and finicky.

Best Answer

There are solenoids that can pull in instead of push out. Ones with springs on them so that they default to out.

Taking one of these, and you can build a simple latch. When the button is pressed down, the solenoid arm is pushed into a hole on the side of the button, locking it in place. You can then just pulse the solenoid to unlatch and the button pops back up. So no need to power it all the time. For this you would need to fabricate a button cover and spring setup (hello 3d printers). Or you could modify an arcade button type switch with a drill. How you do it would depend on the solenoid you use.

Alternatively you could make it electronic. Instead of keeping the switch pressed in physically, have it light up an led. You could get button switches with LEDs built in that you can control. This would mean you need to power it, but it will be much less current than a solenoid.