On a spring morning in 1892, 19-year-old Hans Berger was hauling artillery during a military exercise in Würzburg, Germany when his horse stumbled, throwing him to the ground. Berger was nearly crushed by the artillery battery, a brush with death that would lead him to invent the electroencephalogram 80 years ago, in 1924.

That night, Berger received a telegram from his father after Berger’s sister had been overwhelmed by a sense that something grave had befallen her brother. “This is a case of spontaneous telepathy in which…as I contemplated certain death, I transmitted my thoughts, while my sister who was particularly close to me, acted as the receiver,” he wrote in his diary.

Obsessed by the coincidence, Berger devoted his life to exploring the link between physiological processes and psychic phenomena. In 1897, he earned a medical degree at the University of Jena, where he became a clinician and later director of the University Neurology and Psychiatry Clinic. He began an attempt to measure “psychic energy,” which Berger hoped might explain telepathy.

Berger decided that electrical activity was the most likely source. One day in 1924, Berger attached electrodes near the head scars of a teenage boy with a hole in his skull from having a tumor removed, thinking the gap would allow for clearer signals. He connected the electrodes to an Edelmann string galvanometer, a device that measures electricity. This technique triggered oscillations in the device’s quartz string; Berger captured the wavy lines on moving photographic paper.

Berger then measured the brain waves of people with epilepsy, dementia and other disorders, as well as healthy subjects. Plagued by doubts, he waited until 1929 to publish his findings, which were met with skepticism. Interest in EEGs flourished only after the noted British physiologist Lord Edgar Adrian replicated Berger’s work in 1934. Berger’s legacy, however, was marred by his willing collaboration with the Nazis, which included reviewing appeals for the sterilization of psychiatric patients.

Today, EEGs are used to monitor head injuries, tumors and Alzheimer’s disease, and are the gold standard for detecting seizures and evaluating brain malfunction in newborns. Last summer, the U.S. Food and Drug Administration approved the first EEG-based test to help diagnose attention deficit hyperactivity disorder in children and teens.