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!
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!

