Yes, if you're installing a new light switch, the National Electrical Code (NEC) requires that it be grounded. When changing a switch, however, a ground is not necessary. A new switch can replace an old one without being connected to anything else. The old switch will then function as long as it's within reaching distance of another functional switch.
If your home was built before 1990, there's a good chance that none of the switches are properly protected by outlets. If you want to make sure people don't accidently turn off the power by touching these switches, you'll have to connect them to a ground. There are two ways to do this: You can install metal wire nuts or metal screw-cap connectors on each of the wires leading to the switch, or you can use flexible metal conduit to run all the way back to the main panel and plug those ends together.
Either way, you should put a label on each conductor indicating that it is supposed to be connected to the ground. This is important because if any of these wires were to get pinched between the sliding contacts of the switch, they would be unable to carry current and could eventually cause a fire.
Switch boxes are available in various sizes for different numbers of switches. The box should be rated for the load it will be required to handle.
As mentioned above, a ground is not necessary when replacing a switch. If you put a switch, replacement or otherwise, inside a grounded metal box, the switch will be grounded via the device yoke and mounting screws. As a result, if the metal box is grounded, so is the switch.
However, if you do not install the switch yokes into metal boxes, then you should ground them separately. This prevents any other devices that are connected to the switch loop from receiving power if you're not careful about how you connect up wires at the back of the panel.
For example, if you were to use tape to join three wires together before putting them into a hole in the wall, this would be incorrect. The only way to prevent electricity from flowing through your body if something goes wrong is to ground all parts of the circuit.
Taping wires together does not prevent electricity from moving if you get water on the tape or if one of the wires later needs to be replaced. To do this safely, you need to cut each wire in half and strip away their outer covering before inserting them into holes in the wall. Then, when you're finished, fill any gaps with drywall mud or plaster.
This process ensures that there are no exposed ends inside the wall and also grounds everything automatically if you follow this method. No need for extra equipment or time-consuming workarounds.
The ground is a safety element for a standard light switch and is not required for functioning. If you don't have a ground wire, or if you have the wire but no screw on the switch, you can ground the switch in another method. Wrap the metal shaft of the switch two or three times with tape. This will serve as a ground.
Taping the ground wire to the switch prevents electricity from flowing through your body if you're not using the switch. It also ensures that if there is an electrical problem with the house wiring, the flow of current will be interrupted rather than being allowed to continue down your arm or into some other part of your body.
The National Electrical Code requires that all household switches be bonded - that is, that they must have a conductive path attached to each terminal inside the box. This path may be a copper wire that connects to the exterior of the box, or it may be the tape that we mentioned earlier. If there is no conductive path connected to at least one terminal, then the switch cannot function properly and should be replaced.
Switches are available in replacement boxes marked "grounded". This means that the metal parts of the switch contact within the box are actually connected together. So, when you turn the knob or pushbutton on such a switch, you are completing a circuit that allows electricity to flow through it.
If the light switch includes a screw for a bare ground wire but your electrical box does not, you may leave that screw empty and connect your other wires to the hot screws. In many circumstances, particularly in older homes with metal boxes, the metal box may be grounded even if the wire is not there. In this case, any conductor that is connected to the hot side of the box can serve as a ground.
But if you are working on an electric panel or circuit board, it is important to provide a direct path from each power line to every part of that path. This path is called the ground plane and it provides a physical connection (through air) for any current that might otherwise find its way into the panel or circuit board.
The presence of a ground wire at a light fixture means that someone actually wanted electricity going to that light fixture and through that person's body when they turned the switch. Unless you are sure that the house was built with metal boxes and a ground wire attached to all outlets, try not to disturb the ground wiring at places other than where it enters and leaves the wall box. It's possible that by doing so you could create a short that would start a fire or cause other damage.
Light switches without grounds usually exist only because the original builder missed that part of the box when she/he was installing them. If you're lucky enough to have proper boxes, you should still connect a ground lead to each of them.