Introduction: Countdown Timer or Automatic Shutoff Switch for Electric Blanket or Other Electric Device

I wanted to be able to turn my electric blanket on for a limited amount of time without having to turn it off manually, in case I either lack the willpower to turn it off or fall asleep.   The result works beautifully.  The blanket turns itself off after a selected amount of time with a quiet click, and I have no fear of wasting electricity and overheating myself while I am asleep.

Step 1:

These are the parts I used:
Polarized extension cord (meaning one slot and one prong is bigger than the other one).  I did not use a grounded extension cord (no third prong) because there is no ground on my electric blanket.  Make sure to select an extension cord that will be able to reach from the wall outlet to where you want to place the timer switch (probably bedside) with at least a few feet extra.  I simply cut a 12 foot extension cord in half.
In-wall Intermatic EI210 electronic countdown timer with 10, 20, 30, 60 minute and "hold" settings, purchased for about $20 (I would not recommend spring-wound timers because the ticking is too loud)
Plastic receptacle box
Decora style cover plate
Cable clamp that can fit both cut ends of extension cord
Wire nuts
Homemade mounting box made out of scrap solid wood to fit the receptacle box and electric blanket controller

Step 2:

Decide where you want the power cord to enter the completed device.  Mark that spot on the receptacle box.
Design and build the wooden mounting box.  Make sure it is big enough to fit the receptacle box with the cable clamp attached and small enough that the cover plate will completely cover the hole. 
I extended the back and top of the mounting box to one side so I could mount my electric blanket controller on it next to the switch.  The top provides a back stop for the electric blanket controller and includes a slot for the controller wires.  I primed and painted the completed wood mounting box.
Drill a hole in the receptacle box for the cable clamp.  Install the cable clamp, making sure the screws used to tighten the clamp remain accessible.
Drill a corresponding hole in mounting box for extension cord wires.  Make this hole only as big as is necessary to fit both cut ends of the extension cord.
I sanded, primed, and painted the completed wood mounting box after drilling the hole.

Step 3:

Mount the receptacle box into the mounting box by screwing through the back of the receptacle box and into the wood of the mounting box.  I used three 5/8 inch wood screws.

Step 4:

Cut the extension cord in half, or at whatever distance you need to reach from the wall outlet to the bedside plus about a foot.
At the cut ends, carefully cut the two wires apart from one another for a length of about six inches, keeping the sheathing intact around the copper wires. 
Strip about half an inch or so of the sheathing off the ends of the wires, exposing the copper.

Labeling the wires:
Examine the polarized extension cord and determine which wires come from the narrow prong and narrow slot sides of the extension cord- these are the "hot" wires.  Wrap the ends of the hot wires with black electrical tape to identify them as hot. 
The wires that come from the wide prong and wide hole are "neutral".  Leave them unlabeled.
If I had used an extension cord with a ground, I would have marked those wires with something green. 
Also label the sheathing of the extension cord to identify which end has the prongs and which end has the slots.
Feed both ends of the extension cord through the hole, just past the end of the cut that splits the wires apart.
Tighten the cable clamp to secure the extension cord in the box.

Now it is time to connect the switch.  
Wire it according the the directions that come with the timer switch.
Treat the end of the extension cord with the prongs as the house wiring; connect that (taped) black wire to the black wire from the switch with wire nuts. 
Treat the end of the extension cord with the slots as the fixture wire.  Wire nut that (taped) black wire to the appropriate wire from the switch (for this switch, it is the red wire). 
Wire nut all three neutrals (white or unlabeled) wires together.  
Ignore the switch's ground (green) wire, unless you use an extension cord with a ground- if you did, then wire nut all three grounds together. 

Step 5:

Carefully fold the wires into the receptacle box and screw the switch into the box.
Install the cover plate.
Plug the electric blanket into the extension cord and the other end of the extension cord into the wall outlet.
Mount the blanket controller to the mounting box if desired.  I used a zip tie threaded through a small hole I drilled in the back of the mounting box to keep the controller firmly in place. 
To turn the blanket on, first push the button to select an amount of time on the timer switch, then wait a second for the power to register at the blanket controller and turn the blanket on.  The blanket turns itself off after the selected amount of time with a quiet click.