Watch this video from a fellow model railroader
I completed the HO Wig-Wag crossing using an actual 3mm magnetic actuator on the pole made from a modified coreless motor inside a brass shim-stock enclosure. The 3-phases windings are driven by an Arduino. The wig-wag crossing was made from a kit from Showcase Miniatures and tools from the Small Shop. Yes, this was wired under a microscope using 45 gage wire.