A pacemaker uses electrical impulses delivered via electrodes to regulate an inadequate heart rate. It has miniaturized over time. During insertion, the pacemaker is implanted in the shoulder and leads are fed into the heart. It is programmed and replaced as batteries deplete. Modern pacemakers sense cardiac activity and adapt rate accordingly using microprocessor control. It consists of encasement, electronics, battery, sensor, and leads which are implanted into the heart to deliver electrical pulses.