The diagram below shows the power entering the circuit at the grounded outlet box location then sending power up to the switch and a switched leg back down to the outlet.
Light switch and receptacle in same box.
Because the electrical code as of the 2011 nec update requires a neutral wire in most new switch boxes a 3 wire cable runs between the light and switch.
They often run wires from the switch to a remote outlet but there s no reason why the switch and outlet can t be in the same electrical box.
The first thing you need to do is distinguish the line cable coming from the panel from the load cable which is the one going to the light fixture.
If power is coming into the switch box from the panel and you want to connect an outlet to the switch your first option is to wire the receptacle to always be on.
Buy a single pole switch if one switch controls the lights or a three way if you have two switches controlling the same lights.
I have a single gang box in a bathroom with a gfci outlet.
A few fluorescent lights can be dimmed with special dimmer switches but most can t.
It is connected to the wire bring power to the light box.
In this diagram a light switch and receptacle are wired in the same box.
The vanity light currently is not switched.
The outlet will have both receptacles live not switched.
Notice that these outlets have the tab removed from the hot side or brass side of the outlet which allows the top half of the plug to be controlled only from the switch.
If you want the receptacle to be powered all the time and want to use the switch to control a load other than the receptacle such as a light fixture you wire it like this.
Standard and halogen bulbs require standard incandescent dimmers.
Both devices are spliced to the same hot source.
The other wire black takes the power back to the light box and is connected to the light itself.
It depends how you want the switch and receptacle to function.
In this situation you need 3 wires between the light and the switch box to have an outlet next to the switch.
Wiring a light switch and outlet on the same circuit is something that electricians do regularly.
This is an updated version of the first arrangement.
The red and black are used for hot and the white neutral wire at the switch box allows for powering a timer remote control or other programmable switch.
The neutral is spliced with a pigtail to the neutral terminal on the receptacle and to the white wire running through to the neutral at the light fixture located in a separate box.
Jul 30 2017 easy to read diagrams for two outlets in one box 2 switches in one box switch and outlet in same box and other 2 gang wiring.
It is controlled by a pull chain on the light itself.