Hi. I'm low on time. I have wasted the majority of this week on making the resin for my project. I'm using it for a company party and I think I am in over my head.
I would GREATLY appreciate any advice, even a how-to. If it's real descriptive, I do want to donate if it makes it easy for me.
QUESTION:
How can I make 10 LEDs light up in sequence with the least wires on my Arduino? If I recall correctly, there are only a limited number of pins on the arduino that can have LED's plug into them. I want to have the 10 LED's (all in a circle) turn on in sequence then fade off. (So that it looks like the LEDs are spinning). How can I wire the Arduino and my LEDs to do this correctly?
GOALS:
-It's extremely messy and super long wires. I want to cut down the number of wires as I have to tuck everything in my shirt. (Have a total of 20 wires running right now. Pos/Neg for each LED)
-Make Lights light in sequence (spinning), Make Lights Flicker Off (Like a TV turning off), Make Lights Pulse On (When turning on the Device). Hopefully my wiring can accomplish all of this.
-I also want to plug in a Bluetooth Module in a XBEE Shield to control it through my phone. (This is later though. Hope it doesn't require the pins my LEDs go in). I have to get the wiring done in 24 hours though. The debut is this weekend for it at work.
I HAVE:
-Arduino Uno
-Lots of Wires for Wiring
-Lots of resistors
-XBee Shield
-Bluetooth Module
-About 30 LEDs - 10 White - 10 RGB - 10 ORANGE
-Rectangular Battery (9V) and lots of AA's. Debating on choice.
You have enough pins to run 10 LEDs as long as you are careful not to pull too much current.
10 LEDs, 10 pins (you have 14 pins capable of digital output) and 1 common ground.
That's 11 wires and you can do tricks without any really complex code.
OTOH I see you can get away with 7 wires, a wire matrix of 5 rows x 2 columns (the lights don't have to be in a grid pattern) and by flashing them real fast light up any combination and they still look steady, just not full whammo bright.
No; you have 20 pins capable of digital output. D0-D13, and A0-A5, which are also D14-D19.
Keep D0, D1 free for downloading sketches & for bluetooth or xbee. So 18 digital I/0.
10 to drive LEDs, 1 of 2 for buttons to select pattern, maybe a pot or two on an analog pin for speed control, brightness.
thank you guys a lot for the advice. i am getting off work soon and just wanted to say thanks. the next 48 hours are going to have a lot of work involved! Hopefully I can complete it by then.
My XBee Shield just arrived today and they shipped me the wrong one. They sent me the red one instead of the blue one. the red one requires soldering I think as it doesn't have the pins that can just plug into the Arduino. So I hope I can manage that. Maybe just strip some wire and plug them into the arduino and Shield together? (to act like pins?). I really would like to avoid soldering on my Arduino lol.
Quick question befor eI get heavy into it. Are only pins 9,10,and 11 capable of fading LEDs? Just a quick guide I read on the internet said that other pins will just turn the LED on and off, while those can run this code below to fade it easily:
void loop(){
//Beat
for(i = 0; i < pmw; i++)
{
for (int l=0;l<(sizeof(leds));l++)
analogWrite(leds[l],i);
delay(((60000/rate)*.1)/pmw);
}
I'm still decyphering what was posted here for me to attempt, as I don't think I can make it look like it's flowing 10 LEDs with only 3 pins and an arduino. lol. excuse my amateur level on this. my skill is mostly in 3d modeling lol
You should have 6 pins capable of PWM. But you can fade LEDs without using PWM at all by flickering them faster than eyes can tell which you'd have to do to multiplex or charlieplex anyway. Remember the speed of ATmegas even at 8MHz is pretty incredible. You can pulse 1 LED each for 2 millisecs and be done a whole cycle of 10 in slightly over 1/50th of a second. That's enough to fool the eye into seeing them all evenly lit and it will save power. Just use enough resistor to limit them to 20mA.
thanks for the softPWM suggestion. I actually found a library called SoftPWM that makes it extremely easy! I'm glad there's progress being made.
I'm planning on using 10 pins as previously suggested and one ground for all of them. I'm having bluetooth trouble, but I created another thread for that.
Question though: If I haven't been using resistors, and the LEDs have been working, is that still wrong? I have been hooking "testing" the LEDs one per pin and they have worked fine. Another type of LED (my orange ones), looks liked they burnt out (so i only tried one to be safe), but my white ones work fine. Do you think it's okay to not use resistors for the white LED's?
As for the orange ones, hopefully googling will help me find out what kind of resistor I need. I Will most likely end up using a RGB LED for the center of the chest piece, as that has the most color options. The ones around are all blue/white.
My RGB Specs: Full Spectrum | 2000-3000mcd | 2.1-3.3V | 20mA (30mA max)
My Orange LED Specs: 1.8-2.2v | 24mA max | 5000 mcd
My White LED Specs: 3.0-3.4v | 24mA max | 20,000mcd
My Blue LED Specs: 3.0-3.4v | 24mA max | 5000mcd
I've seen a fake laser project that used a TI-555 to drive a standard red led at 100mA x 9V for very short intervals with time between to cool down a bit. The led would run very bright for longer than you might at first believe but still have a rather short life. I can't remember if there was a heat sink involved.
All the datasheets I've seen on leds tell me that it's heat that kills them at least if you run forward bias. How long that may take, well it does take some amount of time though it often may approach zero.
My dirty amateur way is to find out how many mA the led can take and match a resistor to my voltage to make that. The led will further reduce the voltage and current but IME the sucker will still light up just fine. Hey, isn't that why God made trim pots? XD
Properly you subtract led voltage from supply voltage to use in Ohm's Law with your target current to get your resistor value.