Powering LED array from mains

focalist:
So, one thing I've been mulling over is halloween, and persuant to that, as usual I am messing with LED's.

Here's the question... assuming I am using "typical" LED's (I am using UV, but that isn't important) in an array, is there any good reason (other than the potentially dangerous voltage) to NOT rectify and filter AC wall current directly into DC and use it?

3.2-3.4v @ 25ma is the rating for the LED's, if I were to string 36 of them in series, that makes 118v give or take. Unless I misunderstand, all I would need then is a current limiting resistor (56 ohms by my calculator) per string of 36 LED's. This also works out conveniently to just about three watts exactly per string, including the dissipation from the resistor.

I'm thinking a bridge rectifier and nice sized electrolytic cap ought to do the job. I'd probably toss in an NPN power transistor or an N-Channel MOSFET so that I could dim and control via logic switching the ground side. Since each string only draws 25ma, the required transistor shouldn't need to be very beefy either, other than being able to handle the voltage itself. I'd be fine with anything rated over 150v I would think. Thoughts?

Your basic theory is correct as best as I can tell. However the biggest concern is safety if you insist on direct connection the the AC hot and neutral lines. Especially when you require (or want) to pwm modulate the leds via an arduino analogWrite output pin, because that requires that you have a 'ground' connection wired from a arduino ground pin and the neutral side of the AC power bus. That means your AC connection requires to be properly 'polarized' or you run the risk of applying 120AC hot to your arduino ground pin, which if you were to plug in your arduino USB cable would probably ruin your day and a lot of hardware. I think as a minimum you would want to use small AC transformer to isolate the AC hot and nuetural from your LED voltage. This could either be a small wattage (wattage as needed for the number of strings you will be using) 1:1 transformer (120vac to 120vac) or two small 'filament transformers wired back to back, 120vac input to 12.6vac to 12.6vac to 120vac output.

Lefty