The file 'Parametric Magnetic Switch 3D Printer Model' is (scad,stl) file type, size is 474.4KB.
I saw Andrew Klein video, https://www.youtube.com/watch?v=n9tZIFfM14o
and was inspired but being from Europe I needed metric, so I generalized his design from looking at it, using OpenScad. He sells some tested stl on his website, so don't forget to reward him accordingly.
Here are not tested yet (you will need to specify your dimensions and add tolerances) design files to help explore the design space of magnetic switches, with various number of magnets. The hex nut design was successfully printed and tested.
If the scad doesn't render properly (it's bugging on thingiverse thumbnail) increase Preferences->Advanced->Turn of rendering at … elements .
There are some not needed height in the half with round attachments so that the rods are of the same length for the top and bottom, but if you are willing to cut them of different length, you may get a little extra strength, by setting hatt=0 for this half.
Read the comments in the OpenScad for more information on the various parameters.
For assembly see Andrew Klein video, but take extra precaution if you use an even number of magnets/2 (i.e. 4 or 8) as the rotate 180° trick won't work.
Hex Nut design :
There is also a second design fully from me this time, for cheap and fast assembly using hex nuts and square magnets instead of rods and cylinder magnets, and without center core. Without attachment i.e. 30° position it can lift around 500g, when manually constrained to stay at 60° position, it can lift more than 1kg).
Assembly : slide magnets so that the same pole points towards the nut. (i.e alternating orientation)
Then slide the first row of nuts, by opposite side pairs, it should be tight.
Then slide the second row of nuts.
Usage :
Plastic is outside, nuts from both parts are touching, magnets shouldn't touch
when nuts are aligned 0° little no magnetic strength.
when nuts are half-aligned : 30° mid magnetic strength, but the assembly is still magnetically stable
when nuts are aligned 60° : max magnetic strength, but the assembly must be constrain to remain together, you can use attachment from the other magswitch for this purpose
hexmagswitch.scad | 2.0KB | |
hexmagswitch.stl | 166.8KB | |
magneticswitch.scad | 4.3KB | |
magneticswitch10.stl | 3.0MB | |
magneticswitch4.stl | 2.1MB |