I'm considering picking up a Mega (if required) to drive the lighting on a costume I'm building. This costume will have a minimum of 24 lights, which I'd like to be able to program individually.
I have a stack of 7-LED flashlights, which I've modified to run on external power. I measured with my multimeter, and when I hook up my 4.5v battery pack they are 150mA each.
Questions:
is it possible for the Mega to drive each of these lights on its own? (I suspect not, as the manual says 40mA on each output)
I understand there's a way to increase the juice, but I don't understand it clearly, and I fear damage to the board.
if not, what is the best way to do this? are we talking about relays? and if so, what would be the most cost effective way to do THAT?
or, alternatively, am I missing something super easy and dumb? I learned how to make my own LEDs light up for costuming, but I have little knowledge of the practical aspects of this stuff. My soldering skills are ludicrously bad as well.
I can substitute a little money for knowledge if there is something I can purchase at a reasonable price.
Thanks for any information, I know newbie junk can be ridiculous.
Easy way: Get yourself some ULN2803's, and use those to switch the ground of the relay on/off to turn the flashlights on/off.
Arduino can drive inputs directly.
Thanks for the advice, I bought some and breadboarded it up, and the arduino is blipping the correct pin, and it IS making the flashlight light up, but it's super dim, I checked the voltage, and although I am using a 5v source, it's apparenlty only ~2.5 for some reason.
I don't know a lot of the terms you guys use in electronics, as I am a rank newbie.
I've got the arduino powering pin2 on the array, ground is pin 9. on the other side, I've got 5v incoming, which is grounded on the pin 9 as well.
It's definitely blinking, but there's not enough juice to light up the flashlight more than a very dim light, just enough that I can tell it's on, but not remotely bright.
I'm hoping against hope that someone here has experienced this and knows what the issue is, or that google will once again save my bacon.
I have a stack of 7-LED flashlights, which I've modified to run on external power. I measured with my multimeter, and when I hook up my 4.5v battery pack they are 150mA each.
Are you saying your LED packs draw 150mA?
If so, you are seeing dim LEDs because you are (massively) overdriving the I/O pins of the Arduino. I/O pins can not provide more than 40mA before damage occurs. You should not drive them more than 20-25mA.
Also, the ATmega chip itself can only handle about 200mA of total current. This means you need to use external drives, like the ULN2803.
Can you confirm you've got your 4.5v LED module connected between +5v and pin 17 of the ULN2803? And that you've only got one of them connected at present? If not, how do you have your LED module(s) connected?
You're wired up something like this (substuting your Arduino/wiring);
You need the ULN2003/2803 to sink the flashlight current (represented by the LEDs here).
And you said the 5V Gnd was connected to the Arduino Gnd, so I didn't show anything special there.
Many thanks for the replies. First, mea culpa, I had to set the pins to OUTPUT. Newbie stuff.
This made everything work at full bright. I'm running the lights off a separate power source (well, the same source, but different circuitry, so I'm not powering them via arduino).
This works well for patterns and chasers, but we'll have to see, I calculate about 1.2 amps draw for all 24 lights, and that's the max my car adapter says it can draw, so I'm going to try to split them over 2 adapters, so as to stay well within the parameters of the bits and pieces of electricity.
It looks like everything is functional, but if I suspect some of you have actually pre-answered some questions I may have once I start writing scripts to light up half or more lights at once.
Currently powering it all off a 7Ah 12v battery. As long as I can get 5 hours plus some wiggle room at full draw, I am golden.