

There are many different ways to build tilt switches, both in the factory and in the garage, but I like this idea from Instructables user fjordcarver to use unpainted metal craft beads (e.g. leftmost, above) like liquid mercury in a mercury switch. His tutorial shows how to assemble two such vials to give an SPDT changeover tilt-switch.
More:


























I’d rather just buy one of these from Mouser.
633-DS-BA1P
633-DS-BA1H
633-DSA01