A motion sensor capable of detecting the direction of motion in three dimensions is disclosed. The motion sensor can be built into a printed circuit board allowing for simple and cost effective manufacturing. The motions sensor is designed to utilize a through hole in a printed circuit board, which is capped by on each side by housings creating a cavity where a spherical metal ball can move in three dimensions. This interior surface of the through hole and the housings have conductive element that when in contact with the spherical metal ball close a circuit creating an electrical signal indicative of direction.