Here are the materials and tools that you will need for this project:
3 Prong Power Cord
Insulated Plastic Housing
Light Dimmer Circuit
Insulated Twist-On Connectors
Black and White Large Gauge Wire (optional)
Knife or Rotary Cutting Tool
The AC electricity from an outlet is basically a sine wave. Most modern dimming circuits work by chopping off part of the sine wave. Above is a simple schematic of this kind of dimmer circuit. These circuits use a semiconductor called a TRIAC. A TRIAC conducts electricity only after the voltage at the gate pin has reached a certain threshold. It is often combined with a DIAC to increase this threshold voltage. The DIAC/TRIAC is connected to a resistor and a capacitor. The resistor sets how quickly the capacitor reaches the threshold voltage. By adjusting the resistor, you determine how much of the sine wave gets chopped off.
At the first part of each cycle, the TRIAC is off. The capacitor begins to charge through the variable resistor. When the voltage of the capacitor is high enough the DIAC/TRIAC is activated and it conducts electricity to the lamp. This process happens at the first of both the positive and negative parts of the sine wave.
You can purchase a lamp dimmer at most hardware stores for a few dollars. There are a variety of types available. The most common type is a dimmer light switch. This is typically mounted to a wall in place of a standard light switch.
The type that I am using in this project is a "500 Watt Torchier Lamp Dimmer." It is normally used to retrofit a regular lamp to add the dimming feature.
If you would rather build a dimming circuit from scratch, you can find a number of designs online. Here is one example:
White and Black Wire
500Kohm Variable Resistor
0.047 µF Capacitor