How to drive a LED strip from AC power supply?
This is the same problem as any "how do I get DC from AC?" question. You rectify it:







simulate this circuit &ndash; Schematic created using CircuitLab

You can perform the rectification with four discrete diodes, as shown here, or you can purchase pre-made bridge rectifiers that are exactly this, in an integrated package.

C1 is optional, and serves to reduce the output ripple. Without it, the output bounces between 0V and some positive peak value, close to the peak-to-peak voltage of the AC input but reduced slightly by the forward voltage of the diodes in the rectifier.


from hyperphysics

If you omit C1, then your LEDs will flicker at 100Hz (twice your AC input frequency), but you probably won't be able to see this.

If you want to include C1, to calculate its value, decide how much voltage decrease is permissible between cycles. Say that we decide the output voltage can ripple between 12V and 10V: C1 must then be able to supply the current necessary to run the LEDs between each half-cycle without decreasing the voltage by more than 12V-10V=2V. We can make some simplifying assumptions: that the LEDs are a constant current sink, and that the capacitor will fully recharge at each half cycle, and must supply all the current between cycles. Start with the fundamental behavior of a capacitor:

$$ i = C\frac{dv}{dt} $$

Replace the LED current (let's say 20mA) for \$i\$. Our peaks happen 100 times per second (twice the input frequency) so the capacitor must go 0.01s between recharges (\$t_{dis}\$), and we decided the allowable voltage drop in this period was 2V. That gives us a value for \$\frac{dv}{dt}\$:

$$ \begin{align}
20mA &amp;= C \frac{2V}{0.01s} \\
\frac{20mA \cdot 0.01s}{2V} &amp;= C
\end{align}$$

We can check that a farad is equal to an ampere-second per volt:

$$ F = \frac{A\cdot s}{V} $$

and these are the units we have above, so we can conclude:

$$ C = 0.1mF $$