Just to demonstrate something, I wanted to connect a light socket to a switch, that is connected to an electrical cord that gets plugged into a wall outlet. The switch is a standard single-pole light switch.

The way I have it wired does work. The breaker doesn't trip and nothing seems to be getting hot (tested with thermal imaging camera).

I'm guessing this isn't up to code, but is this configuration relatively safe? The neutrals that are connected together are part of the same circuit.

Here's the actual wiring configuration...

  • The neutral from the electrical cord and neutral from the light socket are connected together with a wire nut.

  • The hot from the electrical cord and hot from the light socket are connected to the terminals on the switch.

  • The ground from the electrical cord is connected to the ground nut on the switch.

  • All wires are 14 AWG.

Thanks for the help!


2 Answers 2


If you were doing in-wall wiring, the connections you describe would be absolutely correct and to code.

For out-of-wall wiring, you'd be better, as @PeterFrey described, to use a proper cord switch to avoid exposed switch terminals, but if you're trying to demonstrate in-wall wiring, you did it right.


This is probably fine, as long as all accessible electrical connections are adequately insulated. However, I would instead recommend that you get the type of switch that is intended to go on a power cord. They come with an enclosure that hides all of the electrical connections. Much safer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.