LED trouble

I have 19 LEDs and 1 servo and 1 bluetooth module which I need to attach to an arduino duemilanove
I powered the servo of a seperate 5 V power supply (And I connected the grounds together(And the Servo works just fine))
But I just wanted to know if my arduino duemilanove can handle 19 (at least 15) LEDs when I connect the arduino to a 9V battery as it communicated wirelessly with the computer with a bluetooth module that needs 5 V power which will be powered of the arduino.
I will connect 3 LEDs to pin13 and 3 LEDs to pin12 and 3 LEDs to pin11 and 3 LEDs to pin10 and 4 LEDs to pin9 and 1 LED to pin8 and 2 LEDs to pin7 and a servo to pin6 and the bluetooth module to RX and TX.
Please reply

Assuming you're not using external drivers (you didn't mention any), and as long as you don't approach the absolute maximum per port current of 150mA and the package limit of 200mA, and you can accept that some LEDs will be dimmer than others, I don't see any problems.

Plus the individual pin limit of 40mA

So everything would be just fine but maybe some will be dimmer

With that many LEDs and a 9V source available, you should connect the LEDs in series with a current limit resistor from the 9V supply, with an NPN transistor (2N2222 for example) on the bottom cathode that the arduino will control. Then you can get full brightness by having the same 20mA current flow thru a 'string' of diodes and have longer battery life, versus having the LEDs powered from 5V and having to split the arduino's 20mA/pin among the three LEDs and their seperate current limit resistors.

So everything would be just fine but maybe some will be dimmer

No if you exceed the maximum ratings you don't get less current out so it's dim but fine. You get the current out you asked for and your arduino is damaged and perhaps bricked.

Thanks CrossRoads Could you give me some more detail on how to do what you are saying because I cannot understand what you mean , as you know I'm still sort of a beginner in arduino so please help.

Sure, I'll draw you a picture tomorrow. PM me if I forget, I have a few other things to take care of first tomorrow.

Basically the 2 pictures on the right tho:

But how will adding a transistor help the LEDs and the +5 V is it from the arduino

But how will adding a transistor help the LEDs

It won't help them at all, but it will help prevent damage to your AVR.

If you have many LEDs in parallel, each drawing 20mA to be nice & bright, that can be driven from the 5V you have for the servo and not damage the 20mA recommended max current sink of the ATMega chip. 3 LEDs could draw 60mA.

If you have the LEDs in a string, they could all share the same 20mA to turn on; however you need a higher voltage as each LED will have ~2V across it. So you need a transistor that can handle the higher voltage when the LEDs are off and not conducting; the ATMega is not recommeded to go past 5.5V.

You might be able to put 2 LEDs in a string from 5V, depends on the forward voltage of each LED. Blue LEDs need higher voltage, while Red LEDs need less.

There are 4 sets of 3 LEDs and the rest are single LEDs
The LEDs in the sets are white coloured LEDs and the there are 4 other independant red LEDs and 1 independant orange LED and 1 independant blue LED.

So do I need to use a transistor for the sets of white LEDs
If I do, then do I need to use 4 transistors, 1 for each set(NPN transistors)

And does each and every LED in the set need to have a resistor or is it okay if you use 1 resistor for 1 set( the set of white LEDs(3 white LEDs))

And does each and every LED in the set need to have a resistor

Unless the LEDs are in series (in line) then yes they do.

Yes, transistor (or an open collector driver like ULN2003, ULN2803, provide same functionality but all nicely packaged up) for the sets of 3.
One-LEDs can be driven directly from Arduino.
String of LEDs needs a current limit resistor.
Single LEDs need a current limit resistor.

But a few days ago I connected the LEDs without a resistor and without a transistor(I connected the set LEDs), and everything worked fine, so do you still advice me to use a transistor and a resistor.

I connected the LEDs without a resistor and without a transistor(I connected the set LEDs), and everything worked fine,

What you should say is "there was no immediate, visible damage to my AV microcontroller".

Ok then I will use resistors, but I cannot use any transistors because I do not have any right now

Ok, wire up your sets of resistors in parallel then with a resistor each, being sure the total current draw stays under 20ma.

This is what I did, I used four transistors, for the 4 sets of LEDs and I added a resistor from the middle pin of each trasistor to the arduino.
And this works absolutely fine, no problems, and the current is about 18 on my ammeter.