This was an experiment done by Luigi Galvani in 1781, discussed in this article:
On January 26, 1781, while dissecting a frog near a static electricity
machine, Galvani's assistant touched a scalpel to a nerve in its leg,
and the frog's leg jumped. Galvani repeated this and several other
experiments, observing the same violent muscle spasms. He also noticed
that frog legs occasionally twitched when they were hung from a brass
hook and allowed to touch an iron trellis, so Galvani joined a length
of each metal together to form a brass and iron arc that made the leg
muscles contract when touched.
But where did the electricity come from?
Galvani, who called it "animal electricity," believed it resided in
the frog itself.
One of Galvani's earliest readers was Italian physicist Alessandro
Volta. Volta already had earned an imposing reputation as the
discoverer of electrical capacitance, potential, and charge, and also
discovered and was the first to isolate methane gas. He replicated
Galvani's experiments and helped popularize his work.
Yet Volta reached very different conclusions. He believed the
electricity came from the two metals used in the arc, and that the
frog was acting as the conductor. Within the year, he replaced the
frog's leg with brine-soaked paper, detected a current, and challenged
The scientific world divided into two camps, animal electricity versus
So how did this influence a young Mary Shelly and lead her to compose
one of the most widely read novels of all time, "Frankenstein; or, The
Galvani's nephew, Giovanni Aldini, was a fierce partisan of animal
electricity, yet he did not ignore Volta's pile. Aldini used it to
tour the capitals of Europe and demonstrate the medical benefits of
electricity -- or not. His demonstrations involved jolting corpses
with electricity and making decapitated criminals sit upright.
Aldini's most famous exhibition took place in 1803 at the Newgate
Prison in London, U.K. He inserted metal rods into the mouth and ear
of the recently executed corpse of murderer George Foster. "The
Newgate Calendar," a book about the criminals of Newgate Prison,
described what happened next: "On the first application of the process
to the face, the jaws of the deceased criminal began to quiver, and
the adjoining muscles were horribly contorted, and one eye was
actually opened. In the subsequent part of the process the right hand
was raised and clenched, and the legs and thighs were set in motion."
Not surprisingly, some observers thought Aldini was bringing Foster
back to life.
Mary Shelley knew all about Galvani, Volta and Aldini. Humphry Davy
and William Nicholson -- the era's leading electrical researchers --
were friends of her father. In 1816, at age 19, she spent the summer
in Geneva, Switzerland with Lord Byron and her future husband, Percy
Shelley. The season was cold and rainy, and they spent many evenings
around the fire, reading German ghost stories and discussing
electricity's potential to reanimate corpses.
It must have seemed like she was merely peering into the near future
to imagine that one day, a Victor Frankenstein might succeed in
reanimating an assembly of body parts.
As mentioned on p. 72 of Shocking Frogs: Galvani, Volta, and the Electric Origins of Neuroscience, the laboratory was in his home in Bologna:
The possibility of carrying out the experiments at any time he could
spare from his professional duties may have played a role in his
decision to establish a laboratory in his house, instead of using the
facilities offered by the equipment hosted in the rooms of the
Institute. ... A home laboratory was not infrequent in
There's a contemporary illustration of his laboratory on p. 73 (likewise viewable in the google books link above), and another schematic illustration can be found on this page: