Imagine a lab in Bologna, Italy, in the early 1780s. On the table, a professor is dissecting a frog; there is also a generator of static electricity, the rage in laboratories of the day. His metal scalpel touches a nerve. A spark flies nearby. The frog's leg kicks, even though the frog is already dead.According to a landmark history of the discovery titled ‘Animal electricity and the birth of electrophysiology: the legacy of Luigi Galvani,’ published in Brain Research Bulletin, that odd moment kicked off one of science’s most consequential accidents and reshaped how we think about the electrical wiring inside our bodies.Meet the anatomy professor who stumbled into physicsLuigi Galvani was born in Bologna, Italy, on 9 September 1737 and died there on 4 December 1798. He studied medicine at the University of Bologna, and after the death of his mentor and father-in-law, Domenico Gusmano Galeazzi, in 1775, succeeded Galeazzi as professor of anatomy at the Bologna Academy of Sciences, according to a biography profile published in the journal Resuscitation. Galvani was not looking for electricity.He was an anatomist who worked on kidneys, ears, and noses and who was particularly interested in muscles and what made them move, which is what attracted him to frogs in the first place.An 18th-century illustration of Galvani's sciatic nerve experiments on frogs. Image Credits: Wikimedia CommonsFrog legs, a scalpel, and a spark that changed everythingThe key episode happened when a visitor to Galvani's lab touched a scalpel to a nerve in a dissected, skinned frog's leg at the exact moment a nearby electrical machine was activated, and the leg kicked. Galvani later showed that the twitching didn’t need a spark at all: pressing a brass hook into a frog’s spinal cord, then touching the hook to an iron railing, produced the same contraction, suggesting that it was the metal-to-metal contact that was key to the effect, not just the electrical spark. He followed that clue for years, eventually applying small currents directly to the spinal cords of dead frogs and other animals and watching their muscles contract as they had when the animals were alive.A body with its own electrical currentGalvani reasoned that muscles and nerves had their own inherent electrical charge, a force he termed "animal electricity," which he believed could make a muscle move without any external spark machine. He presented this theory formally to the Bologna Academy of Sciences in his 1791 treatise, De viribus electricitatis in motu musculari (“On the forces of electricity in muscular motion”), a publication that sparked one of the era’s fiercest scientific debates.The rivalry that basically invented the batteryNot everyone agreed. Fellow Italian scientist Alessandro Volta argued that Galvani was detecting electricity generated by the contact between two different metals, rather than electricity stored within the frog itself. The two debated for years. Around 1800, Volta eventually built a stack of metal discs separated by brine-soaked cloth to make his point, inventing the first electric battery in the process. Today, they are both considered right about different things: Galvani had found real bioelectricity, and Volta had discovered metallic contact electricity.Luigi Galvani, whose frog experiments reshaped science. Image Credits: Wikimedia CommonsYes, this is the science behind FrankensteinGalvani’s ideas also reached beyond academic journals. His nephew, Giovanni Aldini, pushed the research further by running electrical currents through the bodies of dead humans and animals in public demonstrations, part science, part spectacle, to see if electricity could bring the dead back to life. Those exhibitions were part of the cultural backdrop when Mary Shelley wrote Frankenstein in 1818, and historians widely credit galvanism as a direct influence on her story of a scientist reanimating tissue with electricity.The real legacy: your nervous system runs on thisTake away the gothic novel and the sideshow theatrics, and what you have is foundational science. Galvani’s discovery that living tissue generates and transmits its own electrical signals was the seed of modern electrophysiology, the science that underlies heartbeat regulation and the electrical activity of your body as measured by an EKG or EEG. Galvani’s frog experiments mark the beginning of a scientific line that eventually led to the discovery of ion channels, the microscopic gates in cell membranes that make everything from muscle contraction to brain signaling possible, according to a 2024 study in the journal Membranes.The line extends even beyond the doctor's office. The Membranes review points out that the electrophysiological principles Galvani first stumbled upon are at work in technologies like pacemakers and deep brain stimulation, all of which are based on the same basic premise he discovered by accident: the body operates, in part, on electricity.So next time you see an EKG readout or hear about a nerve conduction test at the doctor's office, you can trace it back to a curious anatomy professor, a dead frog, and a spark he wasn't even trying to make.