heres a schematic to share a lightswitch between 120vac (mains) and 3vdc (2xAA cell) using a dpdt relay, well schematical diagram, I haven't built it so it might not work. Actually thats why I'm posting it. I ordered some LEDs off of LSDiodes and am going to make sure the leds work with the decora light switch before I worry about relays.
Looks like it should work, be careful with the mains wiring, always try to keep it on a separate board.
looks fine to me, but you may wish to incorperate a battery charger, just use a prebought unit and somw wires trailing from the battery terminals
if you use a standard radio shack relay for that, you will either melt the relay, or keep flipping the breaker. First off, most relays are DC, the coil gets a constant current, which produces a magnetic field and pulls the contact in one direction. AC will just give you a noisemaker instead of a switch. I'm not a EE or anything, but you may be able to get an AC relay that wont do that, i'm not sure. The other thing is that wall adapter transformers are big for a reason - they need to have enough reactance so that at 50-60Hz they don't draw much current, and a small coil like on a DC relay will just look like a short circuit, and draw a very large current. If the whole relay is smaller than a wall transformer you'll probably have problems. Also, that circuit will blow all your LEDs. LEDs need to have a current limiting resistor in series with them, and you never put individual LEDs in parallel with each other - they don't have much resistance, they have a pure voltage drop, and small manufacturing differences make them draw fairly different currents, either being different brightnesses and being ugly, or drawing way too much current through one, and blowing it, probably then blowing the other. If your battery voltage is V, LED forward voltage is Vled, LED forward current is I, then find V/Vled. Let the integer part be N. N will be the number of LEDs to use in series, and the size of the resistor should be (V-(Vled*N))/I. If you want more LEDs you need a separate string of N with their own current limiting resistor, and if you want less, just decrease N in the previous expression and find the new value for the resistor. Resistor values should be about 50-500 ohms, depending on the size of the voltage drop across them, just use the next higher standard value and you should be good.
http://www.rpelectronics.com/English/Content/Items/R14-11A10-120.asp Relay triggered by 120vac Well, page isn't super clear on that, so http://www.nteinc.com/relay_web/R14.html For the LEDs i was planning on using two AA batteries, similar result to cramming a 3mm led into a 2AA maglite. Right now I have two blue leds and when I hook one up and touch the other one on, theres no noticable difference in first LED. But then I'm only going to be using like, matching white leds, not a mix of colors. So with the dual AA batteries i don't think I need to worry about overvoltage
still shove a resistor in there somewhere... just a 5ohm will do... anything will do really, just to reduce the current.
And more to the point, no white LED will die on 3V, the problem is rather to get a decent light source you need around 3.6-3.8V. Check the LSDiodes site for their LED specs, 3.0V min means they're just on, 4.0V max means they'll soon blow on 4.1V.
Hmm I guess with a minimum of 3v an LED would only light at peak voltage of the batteries and be very dim after that? hopefully it doesn't sharply drop or just die like, but I guess if it does I found this: http://72.41.86.92/dproj/ledpage/leddrv.htm Not really sure if 2aa LED flashlights have similar circuitry to raise the voltage, but they could as my first LED flashlight took 3AAA's for a mere pair of white leds. I'll do more research and try to learn more on this, prefering 2aa's vs 4 aa's as when I change one flash lights batteries I can cycle out this units batteries.
On the 2-cell (3V) flashlights; Terralux TLE-3 Quad Star a 4 (white) LED screw base, drop-in replacement bulb for Petzl, Mega and other headlamps with screw-in sockets. Works with 2, 3 or 4 alkaline batteries. Clever stuff. But not cheap.
A Joule Thief is very similar to one in the link Doctor posted. Note the circuit won't work with 3V-worth of batteries AFAICS. The LED needs to be totally off with battery alone to give the high-frequency switching. Though I guess you could run 2 white LEDs in series on 3V.
Or you could put the batteries in parallel, and get the same effect. At the site the doctor posted, This:http://72.41.86.92/dproj/PulseBoostLED/Pulse_Boost_White_LED.html pace has a 3V led driver.
http://www.emanator.demon.co.uk/bigclive/joule.htm http://www.solarbug.com/whiteled.html http://www.joulethief.com/kit.php I was looking into joulethiefs and was gunna say I have no idea how they work so I can't really adjust the components so it's good that Wolfe looked harder at that one site than I did