I'm trying to use de IC ULN2003 to logically drive the current of different LEDs from a logic input. I have searched for the data sheet but i don't understand how the IC works. I know that there is a Darlington pair for each Input-Output set but I don't understand what should be connected in the COM input of the IC. Can somebody explain me this?
Take a look at this firstly: -
It shows the common pin connected to all the individual outputs via individual diodes. Now see this diagram - they have used common but also they've used external 1N4004 diodes: -
Don't ask why they did it this way - it seems to me that the internal diode should be as good as the 1N4004. Anyway the diodes catch the "back emf" from the inductance of the motor or relay or solenoid or electromagnet when the transistor is turned off.
If you are just driving LEDs or non-inductive loads you can use it with common tied to the highest voltage or leave it open.
COM is a COMmon rail for flyback voltages from inductive loads or for input protection, if you are driving LED's you can leave it disconnected.
If there is any inductance on wire leads to LEDs , it can result in a dangerous reverse voltage on LED, thus the common clamp diodes are tied to V+. LED's can only handle -5V, or Vcc +5V, which can be exceeded when L di/dt exceeds this during rapid shut-off such as if L is > 1 uH and di/dt>5*10^-6. Although load capacitance can also limit this rise time, so not a big issue. Circuit cable determines this characteristic.