U/I = sqrt(Zc^2 + Rs^2) Where Rs is the series resistor you *WILL* use (in series with the cap) and Zc = 1/(2*PI*freq*C) with C in farads. So solving for C: C = 1 / (2 * PI * freq * sqrt( U^2/I^2 - Rs^2) ) [Farads,Hertz,Volts,Amps,Ohms] For 30mA 220V 50Hz: C = 1 / (2 * 3.14 * 50 * 7333 ) ~= 0.44 uF (Rs taken 10 ohms). Put another resistor in parallel with the cap (say 220K 1W) to discharge it when the device is unplugged. The cap must be X2 rated. This supply is very dangerous. Use at your own risk. Rs limits the inrush. Rs=10R limits it to 31 amps (220Vac). Whatever is in series with the capacitor must be able to take this current. Peter -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu