The Master Key: An Electrical Fairy Tale, Founded Upon the Mysteries of Electricity and the Optimism of Its Devotees is a novel by L. Frank Baum, author of The Wonderful Wizard of Oz. The protagonist is a boy named Rob Joslyn. His age is not specified. Baum dedicated the book "To My Son, Robert Stanton Baum," who was born in 1886 and would thus have been about fifteen at the time it was published.
Rob is an electrical experimenter whose father encourages him and sees that he "never lacked batteries, motors or supplies of any sort." A "network of wires soon ran throughout the house". He loses track of the elaborately interconnected wires, and trying to get a cardboard house to light up, he "experimented in a rather haphazard fashion, connecting this and that wire blindly and by guesswork, in the hope that he would strike the right combination." There is a bright flash, and a being who calls himself the Demon of Electricity appears. He tells Rob that he has accidentally "touched the Master Key of Electricity" and is entitled to "to demand from me three gifts each week for three successive weeks." Rob protests that he does not know what to ask for, and the Demon agrees to select the gifts himself. Over the next two weeks, Rob experiences adventures exploring the use of the Demon's gifts, but eventually concludes that neither he nor the world is ready for them. On the third week, Rob rejects the Demon's gifts and tells him to bide his time until humankind knows how to use them. The Demon leaves. With a light heart, Rob concludes that he made the right decision.