A ceiling fixture that operates off a switch when you enter a room is a convenient way to light a room. Adding a ceiling fixture where none existed before entails bringing power to a wall switch and wiring from the wall switch to the ceiling fixture for the light. The most common method requires tapping into an existing outlet to supply power to the fixture.
Select the outlet nearest the new switch location, on the same wall, and turn off the power to it at the circuit breaker. Bring the no-contact voltage tester close to the outlet to be sure it is off. Remove the outlet cover and receptacle by removing the screws with a screwdriver, but leave the wiring attached. Remove a circular knockout from the side of the electrical box by setting a screwdriver against it and hitting the screwdriver with a hammer.
Find each stud between the outlet and the switch location with the stud finder. Cut a small hole in the drywall next to each stud with the jab saw and drill a 3/4-inch hole with a spade bit through each stud. From the attic space, drill down through the wall top plate into the wall cavity with the 1/2-inch spade bit.
Cut out openings for the switch electrical box and the fixture electrical box in the drywall the same size as the boxes. Choose the location for the ceiling fixture next to a rafter. Remove a knockout from the electrical boxes for each cable and install sheathed cable clamps in the holes. Fasten the boxes to the stud and rafter with roofing nails.
4 Feed sheathed cable from the existing wall outlet box, through the holes drilled into the studs, to the new switch box. Feed more sheathed cable from the new switch box up through the ceiling and over to the new fixture box. Leave about 10 inches of extra cable at each end. Tighten the cable clamps just enough to hold the cable firmly in place.
Strip 8 inches of sheathing from the cable at each end with the cable/wire stripper. Remove the paper wrap from the bare ground wire. Strip away 3/4 inches of insulation from each wire at all 4 ends.
Twist the bare copper ground wire with the existing bare copper ground, using the lineman's pliers at the outlet, and attach them to the green ground screw. Twist both bare copper wires together at the switch box and attach to the green ground screw on the new switch. Twist both white wires together at the new switch box and cap with a wire nut.
Turn the white and black wire ends into a clockwise loop with the long-nose pliers at the existing outlet. Attach the black and white wires to the terminals on the outlet. Match up the new white wire to the existing white wire side; the black wire goes to the same side as the existing black wire. Fold the wires behind the receptacle and push the receptacle back into the box. Fasten the receptacle to the box with the screws and replace the cover.
Turn the ends of both black wires into clockwise loops at the switch. Place the loops on the switch terminal screws so the loops are clockwise, and tighten the screws. Fold the wires behind the switch and place the switch into the box. Fasten the switch to the box with the supplied screws and add a switch cover plate.
Connect the white cable wire to the white fixture wire and the black wire to the black fixture wire. Cap the connections with wire nuts. Fasten the fixture to the new fixture box according to the manufacturer's instructions. Add bulbs and turn on the power to the circuit breaker to test the new fixture and switch.
Place a small piece of plaster lath behind each cutout in the drywall and fasten it to the drywall with drywall screws. Fill the opening with premix drywall compound and allow to harden overnight. Add a coat of Spackle and let it dry. Sand smooth, prime and paint to complete the project.