A pacemaker is a small, battery-operated device implanted in the chest or abdomen to help control abnormal heart rhythms. It sends electrical impulses to the heart to ensure it beats at a normal rate. The device comprises a pulse generator and leads that connect to the heart.