A camera module includes a lens, a first magnet and a second magnet mounted on a mobile body including the lens, a coil portion arranged near the first magnet and configured to move the first magnet in a first direction, and the magnetic sensor arranged near the second magnet and configured to detect the position of the second magnet in the first direction as a detection direction.