IN 1958 a priest named Gerardo Flórez, then 70 years old, was blessed with the world’s first artificial pacemaker. The device kept his heart ticking in good order for another 18 years. It connected to the heart externally, weighed 45kg (100lb) and was powered by a 12-volt battery that had to be lugged around on a cart and recharged every 72 hours.

Since the 1950s pacemakers, which use electrical impulses to regulate a beating heart, have shrunk substantially, as have their power packs. But scientists would dearly love to get rid of the batteries altogether. Even the best modern ones run out every 7-10 years and patients must undergo surgery to have replacements installed. The process can be painful, expensive and can lead to infection.

One approach, being pursued by some researchers, is to deliver the necessary energy wirelessly. Some designs beam energy to a receiving coil in an implanted device, and others use an external pacemaker that wirelessly stimulates an electrode implanted in the heart.

Another possibility is to scavenge energy from the natural processes occurring in the patient’s body. In 2011 a group of Swiss engineers installed a tiny turbine inside a simulated artery which was propelled by a bloodlike fluid flowing through it. And now Amin Karami and his colleagues at the University of Michigan have figured out a way to power a pacemaker by harvesting energy produced by the very heart it is nudging along.

This is not a new idea, and Dr Karami’s approach, like previous attempts, relies on so-called piezoelectric materials, which produce a current when subjected to mechanical stress—in this case the vibrations caused by a beating heart. Those earlier efforts stumbled, however, because the piezoelectric components were only able to harvest enough energy to power a pacemaker if the vibrations fell within a narrow frequency range. As a result, they worked for a limited range of heart rates, typically between 58 and 63 beats per minute. Any lower (as when sleeping) or higher (during physical exertion, say) and the piezoelectric elements did not produce enough oomph. Dr Karami’s “non-linear harvester”, by contrast, still works at heart rates of 20 to 600 beats per minute.

It does this using a combination of a piezoelectric material and a magnet, arranged so that the magnetic field amplifies the piezoelectric material’s response to the vibrations. The result is that the magnet causes the sensor to vibrate more strongly when the vibrations within the chest cavity veer away from the sweet spot. The magnet’s shape also boosts the piezoelectric component’s vibrations, and thus the current, by varying amounts at different frequencies. This, in turn, ensures that the current remains more or less the same, regardless of how quickly or slowly the heart is beating.

Dr Karami’s piezoelectric generator produced more than 20 times the power needed to keep the pacemaker ticking at normal heart rates. It also has the advantage that it is smaller than a battery pack. Some of the extra energy produced is stored in a capacitor embedded inside the device. If the patient suffers a cardiac arrest and the heart stops beating entirely, the capacitor kicks in. Its aim is not to shock the heart to restore its normal rhythm, as an implantable cardioverter-defibrillator would do, but to hold enough charge to keep the pacemaker running while doctors try to revive the patient using an external defibrillator.

Tests in pigs and sheep look promising. The next step is to build an interface to connect the new power pack to standard pacemakers, over 400,000 of which are installed annually in America alone. More than three-quarters go to patients aged 65 or older. Anything that saves them from going under the knife every few years would surely bring a hearty cheer.