Interior car lighting, 3w LEDs (pwr requirements)

First off I'll start off by saying I'm pretty noobish when it comes to electronics. I'm a computer programmer by trade which is what got me interested in arduino in the first place because of the easy to understand coding. I've made guitar pedals and an electronic drum kit and know quite a bit about the components but really building them just following instructions and soldering... which I'm pretty good at.

I have used arduino to do some simple things, most of them directly out of the "playground" on the main page but nothing as complicated as I'm planning with my very basic understanding of electronics.

With that said I think I finally found a project I'd like to try make happen but I need a little guidance if possible.

What I'm trying to do is make controllable interior floor lighting using 3w leds. I want it to turn on and off with the dome light (requires a relay and tapping into the car wiring for the dome light) and I also want a switch to override and turn it on and off independent of the dome lighting. I've also been toying around with the idea of effects, like flickering or such but really those can be added later, just getting it working is my main priority.

Coding is not my issue just so everyone is aware so I need no code... just theory on hooking it up.

My car has a 12v DC cigarette lighter with I believe 8amps(I could be completely wrong, this is based off a page I just read about car cigarette lighters and powering laptops) or so, so it seems I do have plenty of power to work with and shouldn't require a power suppy. From my understanding with that type of amperage I should have no issues powering both the Arduino and the Led's, I do figure I'll likely need 6 or better for decent light coverage over the drivers and passenger side of the car. The LEDs with only be one color as well, no need for RGB's. The one issue I can possible see with this way is that the lights will only be powered when the car is turned on (I might be incorrect). I just read another article that suggested wiring directly to the car battery which I would be willing to do if it meant I could get power when the car was turned off. Appearently there aren't many power options when the car is off and I would like them to turn on when I use the unlock button on my key which turns on the dome light.

I also plan on using The ULN2003 based on the Arduino Mood Light project as it seems like a reasonable driver to use (open to other suggestions).

Where the problem comes in is power requirements. Do i need to take the 12V down to 5V (or 9v based off another tutorial I just read that used a 9v adapter) to power the arduino or can I just give it 12v? or it the amperage thats more important? Do I need to lower the amperage for the arduino and the ULN2003?? and can anymore see any reason I can't use the cigarette lighter to power this like I'm planning?

Basically I need to know how to power the LED's and the arduino properly from the cigarette lighter without hurting the arduino or the LED's.

The thing is I know just enough about amperage and voltage to be dangerous.. but surely not enough to understand what it all means or even how they relate. I've read about it many times but it might as well be in german because I have a hard time understanding it and know no one locally to explain it to me.

Hopefully someone here can give me a little guidance so I can get this project completed without destroying my arduino!

Well, you have a couple of options.

First, let me state that I have 3 LEDs installed in my jeep to light up a dead spot on the console at night. They dim with the interior lights and come on w/ the interior lights. This did not require any arduino. I just purchased some LEDs for about $8 down at the local auto parts store, spliced the anodes into a line that was run off a dimmed light in the console, and ran the cathode to the GND on the cigarette lighter socket.

If you just wanted to add a switch, then run an SPST in line w/ the anodes.

Now, if you absolutely must use an arduino (and heck, who wouldn't? you can then do fun "light with music" and such =) - remember that your car battery, when fully charged, is not putting out 12V, but closer to 14V. The arduino is designed to accept from 7v-12v on Vin. You can probably run the battery to the Vin on the arduino, and the extra voltage should just be heat on the voltage regulator. (I may be wrong on this one, can always use your own voltage regulator.) Remember to put a fuse very close to the battery if you intend to run directly off of the battery, but you shouldn't need to because there are lots of fused lines already. Check your fuse box, and you should find multiple points where the power is sent when the ignition is off. (Your dome light comes on somehow, no? =) Amperage? Well, that a thing you take not get. Your battery can probably produce about 500 amps when cranking, that doesn't mean everything uses the 500 amp, just the starter does. Your LEDs will be doing the vast majority of the power draw here, and you already know you need some sort of driver or transistor setup (as indicated in your msg) because the 250ma draw of each LED is higher than the 40ma rating of your I/O pins on the arduino.

!c

Thanks for the reply!

And your totally right, who wouldn't want to use the arduino do to fun things with the lights once there in! :slight_smile: I like complicated tasks and being unique.. and I'm sure I'll be the first, or one of the first to have an arduino running lights in a car ;D

I've been researching into this a bunch more and actually came to a few conclusions that you mentioned. Like the variance in voltage between 11v-15v depending on the load and the car. Haven't hooked a multimeter up to my car to actually see yet but you are defiantly correct about the variance of voltage.

I also had one of my mechanic friends explain to me how the power systems in the car works, on a very basic level of course. It seems simple now but at the time I was baffled.. but for the dome light to come on before the car does there has to always be 12v (or whatever the light is rated for, 12v in my case) ready and waiting. I for some reason assumed there was no power anywhere until you hit the unlock button or the battery would be dead but that isn't the case. I failed to connect just because there is power running doesn't mean its being used. The ECU always stays powered albeit in a reduced fashion, just enough to keep memory and there needs to be power to the actual receiver of the door unlocker just off the top of my head when I really thought about it. Needless to say I came to the conclusion I didn't know anything about cars going into this :slight_smile: thankfully now I'm on what seems like the right path.

My mechanic friend suggest straight tapping into lines that power the dome light directly and at worse putting a higher value fuse to allow for the amperage draw increase but I'm having trouble visualizing how I can make the arduino only turn on when I open/unlock the door or when the car is on... and using a switch to give the arduino power kills the auto lighting concept! I don't want it on all the time or I would be draining power from the battery, and from my understanding there would be constant power on that line. I'm thinking it might require 2 relays, one to determine when the dome light comes on and another to determine when the car comes on through another wire.. but again, I'm not really sure about this. Any suggestions as to how to hook it up so it turns on with the dome light and stays on when I start the car so its avilable? but in an ideal world it would still dim when the dome light dims even if the car is on and the arduino is still powered, obviouslly overridable with a switch which I see no reason like you said couldn't be wired inline with the LED's.

As for regulating the voltage... I was thinking after you explained that it accepts 7v-12v of putting an inline 9v voltage regulator which would insure even in the case of power drops it would still get enough power. Im pretty confident there are times where it drops below 12v, so from what I understand (although I am grasping at straws here) a 12v regulator would stop working with less then 12v's, comments?? For the price of a regulator I'd be silly not to use one to be sure not to damage the arduino. I'll just put it on a nice chunk of aluminum to cool it.

I got a pretty good handle on it I think I'm just missing one or two key pieces of the puzzle.

I ordered some superflux LED's which have a 80mA draw but I'll likely run them a little low for longevity.. so I should be able to start testing very soon.