The Silver Crown by Robert C. O’Brien
Ellen discovers a mysterious silver crown in her bedroom on her tenth birthday. By pure luck she is not in her house when a vandal attacks the building with a Molotov cocktail and the house burns down, but while she is out at the park and she witnesses a murder, which at the time appears to be unrelated. With the terrible loss of her family, and feeling she has nowhere to turn, she decides to hitchhike to her Aunt Sarah in Kentucky.On the way, she escapes from a disturbing kidnapper, is chased though the woods, and eventually finds an ally in 8-year-old Otto, a strange orphan boy living with an old lady he wrongly believes to be his mother. With Otto, she treks through the mountains, all the while being hunted by sinister men. After many mishaps, Ellen discovers a disquieting black castle in the forest where she encounters a medieval device called “the Hieronymus Machine” which is mind-controlling people used for turning children into arsonists and assassins for an unknown purpose.
Having hidden the silver crown, Ellen discovers that the machine can be operated by two crowns, one black and one silver, yet whilst the wearer of the silver crown takes control of the machine, the wearer of the black crown is controlled by the machine. One of the few people able to resist the machine, Ellen escapes from the cell in which she is being kept, collects the silver crown, then quickly returns to the castle in order to take control of the machine. After cunningly entering the castle and taking control of the machine, Ellen ultimately decides the machine is too dangerous and, despite the temptation of becoming a queen, has it destroyed.