The heart has specialized cells that generate electrical pulses to control heartbeats. There are three main parts to the heart's electrical system - the sinoatrial node, atrioventricular node, and His-Purkinje system. The sinoatrial node acts as the natural pacemaker to create electricity for heartbeats, which is then passed through the atrioventricular node to the ventricles via the His-Purkinje system. The brain and hormones can also influence heart rate through the sympathetic and parasympathetic nerves as well as hormones released by the thyroid gland and adrenal gland.