Go Down

Topic: EXTREMELY Simple Questions (Read 750 times) previous topic - next topic

jackrae

Hi Mike,

I can't blame my calculator,   it 119 and I also added on 20mA plus a bit for tolerance so rounded up to 150mA but somehow put it in as 250mA  (0.25)   Doh!


Shuko

#6
Apr 07, 2011, 10:39 pm Last Edit: Apr 08, 2011, 03:36 am by Shuko Reason: 1
Wow! Thanks for all the great advice and corrections to my mistakes! I will definitely be taking all this into account! But now I have new questions. :x

1. Let's say I used two AA batteries instead (or even three of them). Would doing that affect anything other than the effective lifespan of my voltage? Would it also affect the amount of current going into the microcontroller, and potentially damage it?
Ignore this question. -_-... After doing some digging, I realize now how silly it was.

2. I thought I had 14 pins to work with... I suppose I don't really understand the difference between the digital I/O and the analog pins. But let's just assume for now that I'll be using the six analog pins for my LEDs, and that I'll use three AAs to power the setup. I could attach two of the LEDs to one pin and, if I don't mind both LEDs acting in unison with each other, I'd still have enough current to run them, so it should be fine, right? It would change the value of the resistance I'll have to wire in, but the increased voltage would have done that anyway.

3. And what's to stop me from attaching two LEDs to each of three of the pins and one LED to a fourth? Can I do that, as long as I allow for the appropriate resistance for each pin? Let's say that multiplexing won't be an issue, because I can verify that I want each pair of LEDs to turn on and off at the same time as each other, so I won't have to control them independently. I can do that, right?
Being an adult shouldn't be about maturity; it should be about being old enough to go out and do bigger and better things with your time.

Grumpy_Mike

Quote
I suppose I don't really understand the difference between the digital I/O and the analog pins.

There is no difference when talking about digital I/O the analogue inputs can also be used as digital inputs or outputs. Not sure where you get 14 from as there are 20 I/O on the arduino.

Quote
I could attach two of the LEDs to one pin

You would need to limit the current of each LED to about 15mA to stay withing the current limit of an output pin. In addition there is an absolute limit of 200mA for the whole arduino (this is best kept to 150mA in practice).
Each LED would need it's own resistor. It's value should be calculated using the output voltage of the processor.

Quote
And what's to stop me from attaching two LEDs to each of three of the pins and one LED to a fourth?

the current limit on the individual pins and that on the processor as a whole.

Shuko


- helpful input -

Thanks! Since I last posted all those questions, I did a little research and testing on my own, and I came to the same conclusions. At first I didn't understand why Jacrae said I only had six pins, but after thinking about it for a bit, I realized that those six pins are the analog ones, and it was assumed that I'd only be using them. Since I planned to make use of the IDE to provide the instructions for the LEDs, I realized that all twenty pins were available to me (so long as I didn't exceed 200mA overall ^_^). With that knowledge, I pretty much had all that I needed. I've currently got seven LEDs hooked up to seven of the pins, and I've put 68 Ohm resistors in place on all of the LED input leads. I figure I should be safe with 68. Even with the 5% tolerance on them, there's no way I'll need more than that amount of resistance for 3V.

I've got all the bare connections made. Now I need to write my program and test it and all my connections out. Once I'm sure everything works the way I want it, I'll reinforce the connections with solder. :)

I appreciate everyone's help! The only thing that could make this idea even better is if I could find some way to drive some sort of beep-producing device along with the LEDs. But all of the sound devices I've found require more voltage than what I can get from two AA batteries. :p
Being an adult shouldn't be about maturity; it should be about being old enough to go out and do bigger and better things with your time.

Go Up