wvmarle:
Base current is limited by the resistor you put between the base and the Arduino pin, not by the collector-emitter current. ICE itself however is limited by Ib (and whatever is in the collector circuit). You can look at a BJT as if it were two diodes linked at either the anode (NPN) or cathode (PNP).
It is good practice to saturate the transistor - then you have a gain of 10-20, so for 15 mA that'd be a 0.75-1.5 mA current. For a 5V signal that means a 1k resistor will do great. This current limiting resistor is a requirement as without it you will probably blow up your transistor, the Arduino pin, or both.
Letting the base of a BJT transistor float won't do any harm, there's no current so it's simply switched off - it's purely current driven. This in contrast to MOSFET transistors, where leaving the gate float is a very bad idea, as they're voltage driven.
Optocouplers are for connecting signals, not for driving LEDs.
Thanks for the explanations! The term "gain" is what confused me, as well as the Ic = gain * Ib in all the tutorials as if Ic and Ib had a causal relationship... I was reading this as give me 0,5mA and I will give you back 50mA.
In fact it seems it's more "give me 0.5mA on base and I will send them right to ground (through E), but for that price I can close a circuit of up to 50mA; and you'll have to supply those 50mA yourself separately".
In my measurements I always have Ib = 0.5 mA = (3.3V - 0.7V) / 5K, no matter what the load or what Ic happen to be (up to 3-4 mA)... so I find the tutorials confusing in that respect.
Franck