Mechanical Keyboard Switch to Toggle a 120V LED Lamp

Thread Starter

Ballgraff

Joined Dec 6, 2026
1
I’m currently designing a small desktop lamp and would love to incorporate a mechanical keyboard switch (MX-style) as the on/off button because of its satisfying tactile feedback.

I’m relatively inexperienced with electronics and am having trouble figuring out how to use a momentary keyboard switch to control a standard 120V AC, non dimmable LED bulb. Ideally, pressing the switch once would turn the lamp on, and pressing it again would turn it off.

Ideally, I’m looking for a compact solution that can be powered directly from the existing lamp cord, without requiring a separate external power supply or programming, while keeping the keyboard switch electrically isolated from the mains voltage.

Does anyone have any suggestions on how to achieve this or recommendations for specific components?

Any help would be greatly appreciated!
 

Jerry-Hat-Trick

Joined Aug 31, 2022
868
Sorry if this sounds a bit harsh, but if you have to ask I’d suggest you don’t know enough about electronics and electricity to be messing around with 120V AC. There are mains push button switches available but I recommend a mains voltage rocker switch as the safest and most tactile solution

Maybe consider a low voltage LED solution powered by a 12V supply?
 
Top