The invention relates to electrodes of a novel type in a heart stimulator functioning on energy produced by a piezoelectric effect. A variant of the electrodes is formed by the presence of a ferromagnetic material. The device constituting the heart stimulator has a small overall volume, weighs less than traditional stimulators, poses less risk of infection and clotting and much less risk of mechanical failure. Use of the device containing electrodes composed of materials capable of producing a piezoelectric effect and, if appropriate, also containing a ferromagnetic material, and also a directional probe comprising an electromagnet.