How to run a single LED from AC current?

I've been reading up on a lot of existing posts and projects about people wanting to power LED(s) off of 120VAC. Most of the suggestions I see refer to the use of a wall wart DC power adapter to accomplish this task. In many cases, it would probably suffice. However, due to a very limited amount of space I have to work with, I need to make this project as thin as possible. I really don't have the room to accommodate a big wall wart adapter. Can anyone direct me towards being able ot make a single LED run off AC? I'd also like the ability if possible, to run it with a photo sensor to turn on/off night/day.



sort by: active | newest | oldest
Re-design4 years ago
There is not excuse not to use a wall wart then a cord to the tiny light.

Well, in my case, there certainly is. I have an older custom lightsaber designed to operate am EL blade that I am attempting to create a "blade plug" to install when the blade is not connected. Illuminating the plug with EL film or wire isn't really feasible, but as EL operates at around 100-120VAC, I would need to craft *something* to make an LED function without instantly burning out. And since a lightsaber is a portable device designed to convert 9VDC into roughly 110VAC, it's a pretty damn good excuse not to use a wall wart.

djc311 (author)  Re-design4 years ago
Actually there is - that's exactly what I DON'T WANT!

There's no reason I should need to run a transformer or external power supply to a tiny night light, especially when the technology exists to avoid it.
kelseymh djc3114 years ago
Building a circuit to directly off of wall current, when you demonstrably don't know how to do it safely (you talk about copying a properly designed circuit without understanding it), is foolish. If you don't injure or kill yourself, then someone close to you will do so because you failed to build a safe enough system.
djc311 (author)  kelseymh4 years ago
Being critical and judgemental of one's capabilities and knowledge of certain things does not make you a better person than I or anyone else on here for that matter. Although you may have the knowledge and expertise to fabricate certain components into functioning electronics, being disrespectful in your comments doesn't display such character.
Running DIRECTLY off mains is not something I can recommend at all. If you absolutely have to, the best way is to use a capacitor to drop the voltage to the LED, then you don]'t have a big, not resistor to deal with.

For a typical 20mA forward current LED, you need a 470nF capacitor. IT MUST BE AN X2 class capacitor, the only components safe to use direct-on-line. Put THAT in series with the LED, you don't need a resistor.

You also HAVE to put a 1N4007 diode in ANTI-parallel with the LED, if you drive it with 120V. The diode stops the reverse voltage exceeding 1V, or you will destroy your LED.

djc311 (author)  steveastrouk4 years ago
Based upon a night light made commercially for this type of use, obviously they've made the system work at a level of safety for most consumers to use (when they don't take them apart as I have.) I guess I'm trying to figure out how to copy this type of setup in as small of footprint possible, so that I can cram the components into a very, very small space...

Any more input would be greatly appreciated!
Its safe, if its properly housed, in a case which can't be opened when the power is on.
470 nF? Ah....Darn you, two-pi, you get me every time :-( Impedance = 1/(wC) not 1/(fC).
For a single LED, a single resistor will do, but will cause the LED to flicker at the 50/60Hz main frequency, although this is not normally a problem.

For an LED with some basic circuitry, the supply will need to be rectified (using a diode or four), and some form of voltage regulator added. With just a few LEDs, a simple potential divider should get it down to an RMS voltage a bit above what you need, and a zenner diode and smoothing capacitor will give you a reasonably well regulated low-current DC supply.
djc311 (author)  The Skinnerz4 years ago
Ok - thank you for the input. I dissected an LED night light which contains a photo sensor, which is a feature I'd like to include in this application.

Given the description you have provided, is there a wiring schematic I could use to layout the setup?
For a zenner based voltage regulator, a search for "zenner voltage regulator" will provide simple circuits and an explaination. A potential divider can be made by joining two resistors together. The voltage at the junction between these will be proportional to the values of the resistors used.

Example: A 2.2KOhm and a 100Ohm resistor have a 22:1 rato, so the output voltage will be about 1/23 of the input voltage, so 230V goes in, and 10V comes out. 

This circuit will do, but may dissipate a lot of heat. The high heat output is unavoidable without getting a transformer or relatively complex switching circuits involved, as the regulator has to "burn off" the excess voltage.