Remember: It is a Really Bad Idea for hobbyists to work with household electricity, i.e. 110v in the USA, 240v in many other places. There is the chance that you will kill yourself or others. Also consider that if you only have a "little" problem, for instance you start a fire, you may find that your insurance is void; you may be sued for the damage you've caused. You may be prosecuted for illegal wiring.
I've created a page for you about less dangerous ways to control 110v or 230v devices, if you want to go ahead anyway. This page is about the plugs and sockets used with household electricity. If that's not what you wanted, at least check out the little diversion at the bottom of the page?
But if you are going to connect, you need to know a bit about the sockets you will plug things into.
There are other sources for other information. The lesson I want to get across here is that there is a difference between the two wires carrying the AC (alternating current) voltage.
In the following, you can see a US plug and socket, and notice that one blade of the plug is wider than the other. The plug will only go into the socket one way....
... so that the correct wires go to the relevant parts of whatever you are plugging in.
This, of course, relies on correct wiring in the sockets you are drawing the voltage from.
There is a neat little test tool which you can buy. You can test the sockets you use. If you ignore my advice, and create things with plugs and sockets for household voltages, you can catch at least some of the mistakes you could make, using one of these test tools...
You simply plug it into a socket (see the pins in the shadow at the back?) and the LEDs on the front tell you if all is well. One of these tools has frequently shown me problems in supposedly "good" household wiring
A simple view of AC might lead you to believe that there isn't a difference. Not so. Mistakes based on that assumption can wreck what you connect, and can be lethal.
One wire is called "hot" (USA) or "live" (Europe), and the other "neutral".. which is different from the third, "ground" or "earth" wire.
The following is, hypothetically speaking, how I might, for the US wire up an extension cord, or "box" with a relay in it, etc.... I THINK... NO PROMISES THAT IT IS RIGHT!!
IF the above is right, then, and this is the point of these two diagrams, the following is wrong...
The point I am trying to underline is that there is a difference between the two non-ground wires. You can't reverse them, and still have things working as they should.
What is the problem, if the wires are reversed? Among other things, if certain, not unlikely, fault conditions arise, then if you were to touch the box your circuit is in, it would be like sticking your finger in the "live" socket on the wall.
Leave the design and building of stuff to carry household electricity to people with the right training and experience.
There is more information at http://www.stpats.com about a number of things touched on above, and other things. It gives thoughts on wiring in the US and Europe, including pin assignments and wiring colors (colours!). To get to that information, you will have to drill down into the site using the menu at the left on it's home page. First select "Information (Links)", and from there "Wiring Information".
Let's hear it for Mr. Hubbell! Not Edwin Hubble, the astronomer, but Harvey Hubbell, the inventor.
"In the beginning..." (of powerful electricity in the workplace and home), everything was permanently wired into the fabric of the building. Like the light in the center of your ceiling, which is turned on and off by the switch on the wall.
In the early days, nothing was portable. Nothing could be taken from place to place, and just plugged in when it had been carried to where you wanted to use it.
Plugs and sockets had not yet been invented.
For that brilliant idea, we can thank Harvey Hubbell II (1857 - 1927). He was, in Wikipedia's words, "a U.S. inventor, entrepreneur and industrialist."
Not only do we owe him thanks for thinking of plugs and sockets, but he also had the bright (!) idea of creating the pull-chain light socket.
Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org
....... P a g e . . . E n d s .....