About this 3D model
Using a HiTech hs-81 servo, a rack will slide back and forth into a block. My inspiration....I needed a latch for a reverse geocaching box Attach the servo assembly to the lid, the block to box. Write code to sweep the servo one direction to lock and sweep the other direction to unlock. The slots allow for adjust ability. I found it worked best to assemble all the parts, align the gear down the middle of the rack and then just let the servo housing float to whatever position it wanted. Then I super glued it together.