This section is from the book "The Boy Mechanic Vol. 2 1000 Things for Boys to Do", by Popular Mechanics Co.. Also available from Amazon: The Boy Mechanic, Vol2: 1000 Things for Boys to Do.
A device for automatically turning an electric light on and off when entering and leaving the room is illustrated in the sketch. A pull-chain lamp socket is placed upon the wall or ceiling, and is connected to a screw hook in the door by a cord and several rubber bands, as shown.
When the door is opened, the lamp is lit, and when leaving the room the opening of the door again turns it out. The hook should be placed quite close to the edge of the door, to reduce the length of the movement, and even then it is too much for the length of the pull required to operate the switch, hence the need of the rubber bands.
Ill: Operating the Electric Lamp Switch or Key by the Opening of the Door
The lamp chain pulls out just 1 in., and consequently the lamp is lit when the door is opened part way; and swinging the door farther only stretches the rubber. This is an advantage, however, because the lamp is sure to light regardless of the swing of the door. If no rubber were used, the door would have to open just a certain distance each time.
If the cord is connected to the hook with a loop or a ring, it may be easily disconnected during the day when not needed. A light coil spring may be used in place of the rubbers. - Contributed by C. M. Rogers, Ann Arbor, Michigan.