To add to the existing post. The attached is a rough idea of what you may want, it is just an example.
Looking at the data sheet the maximum collector emitter forward current is 20 mA, so you need to keep that in mind. If you look at the example circuit from the data sheet they use Vcc = 5 Volts but that is just an example. However, the 20 mA is important as to the output side.
When you mention:
I simply want to use it to turn a group of LEDs on and off, the power supply will be AA batteries.
A group is a rather hard number to work with.
The specifications for the LEDs needs to be known. In the attached circuit I used 4 LEDs and each has a forward voltage drop of 1.6 volts and a forward current of 10 mA. I used Vsupply = 12 volts. So what I have there is:
1.6 * 4 = 6.4 volts forward drop for the LEDs. Now we figure roughly .6 volt forward drop for the NPN output so we get 6.4 volts + 0.6 volts = 7 volts. Since Vsupply is 12 volts and I am using 10 mA LEDs I want to limit the current to 10 mA. Therefore I can say:
12 Volts - 7 Volts = 5 volts / .015 amp = 500 Ohms. You won't find a common 500 Ohm resistor off the shelf so we can drop it to 470 Ohms and do just fine. Here we see how important it is to know the data for our LEDs. A common generic everyday red LED would be about right for my attached cartoon, however if we get into other colors or super bright everything will change. Again, in the circuit we are keeping the current of 10 mA well below the max rating of 20 mA for the coupler.
On the input side they tell us in the example that the Vfwd of the coupler is a maximum of 1.3 volts. They also use a forward current of 19 mA. I used 15 mA in my example and a fwd voltage of 1.2 volts. So on the input side we now have:
12 Vsupply - 1.2 Vled = 10.8 / .015 = 720 Ohms for R1 limiting the input side current to about 15mA.
Remember the output side of the coupler has a max rating of 20 mA! Generally you want to remain well below the max rating for a long life. Exceed 20 mA and bad things will happen.
The R2 in the example is used because the circuit is designed to provide a TTL level output at Vout right off the collector. As pointed out it would not work for your intended application. The circuit I posted here is merely an example of what is involved.
In real life I would use the R2 = 100K and use Vout to drive a transistor and let the added transistor drive my LEDs.
Hope That Helps
Ron