An implantable device for measuring mechanical heart function of selected heart chambers using a heart contraction detection system that includes a magnetic field sensor. The system may be used for monitoring signs of acute or chronic cardiac heart failure, to enable diagnosis of the condition of the heart, to prescribe appropriate therapies, and to assess delivered pacing therapies. Distance measurements within the heart are made using the magnetic field sensor which is implanted at a sensor site in or on one of the right or left ventricle. A magnet implanted at a site relative to the other of the left or right heart ventricle is sufficiently spaced at a distance that fluctuates with expansion and contraction of the ventricles. The magnetic field sensor provides a sensor output signal having a signal magnitude proportional to the magnetic field strength of the magnet, and which is indicative of changing cardiac dimensions.