I have been interested how a magnetic switch works. To have a real live application I made this as a machne light with a E27 LED Bulb and a Tin.
Hardware needed:
Some M3 Screws
M6 Screw and Nut
Tin
Magnets (in my case 10x15mm) - you can adapt the size in the openscad-file!
Steel Rod (12x 30mm) - also adaptable
E27 LED Lamp
E27 Socket (e. g. Amazon)
Cable, Switch and Plug
For function and basic design see this video:
The author remixed this model.