Here, we will look at getting our LEDs to work without a transformer and build a simple light that is integrated into an expansion bar.
WARNING: For countries with 110v mains, we'd be working with voltages of 150 volts! For Europe and other countries, we are talking about 300 volts or more! At these levels, electricity is lethal! Do not continue unless you are comfortable with working with high voltages and are aware of the precautions to take!
AC supplies are quoted in rms (root-mean-square) values. The PEAK voltage is sqrt(2) * Vrms, which is about 1.4 * Vrms
Step 1: Some background
150 / 20mA = 7500-ohms (we should subtract the voltage of the LED from 150v first, but the difference is minor)
7500-ohms? Not too bad... But then let's consider the power rating of this resistor, using the Power rule: P = (V2) / R, we get:
150 * 150 / 7500 = 3 watts, and that's a pretty hefty resistor. Brits with 240v mains will need a 17000-ohm resistor rated for almost 7-watts. And these will be running HOT!
Fortunately, by substituting a capacitor for the resistor, we can get the same reduction on voltage without the (or as much) heat. Capacitors delay the phase angle of AC which we can use to oppose itself, much like receding waves on the shore cancelling out some of the force of incoming ones.