1/ Well, using optocouplers is clearly a good idea, as long as you do not need to interface fast data streams such as in the high kiloHertz range where design becomes more critical.
2/ Note that the older optocouplers - the "4N25" series and such are basically obsolete with poor CTR. You will be looking at modern devices such as the PC817 with absolute minimum 50% CTR.
3/ Now if you mount this reasonably close to your Arduino, you connect it between an input and ground and use the internal pullup which provides only a hundred or so microamps, so you need only a milliamp or two to switch it.
4/ In the other direction, 10 milliamps drive to the LED from an Arduino output will guarantee at least 5 mA switched, so you will want a FET to control relays or other systems.
1/ thanks for responding, for this application no high speed switching is required
2/ happy to use PC817XNNSZ0F, however seeking a chip supporting 4 photocoupler channels as opposed to 1
3/ thanks for the suggestion, and will look at the value for this pull up resistor:
3.1/ fitted with the nano 33 ble or
pin: the Arduino pin number to set the mode of.
mode: INPUT, OUTPUT, or INPUT_PULLUP. See the Digital Pins page for a more complete description of the functionality.
4/ according to nano 33 ble specification
DC Current per I/O Pin 15 mA
Hence, fitting an photocoupler between nano 33 ble and the output load seems fine to me.
Output circuit described as follows:
nano 33 ble Digital Output (DO) pin wired to Photocoupler input (+)
Photocoupler output, switching 12 VDC to control an interposing relay fitted with a 12 VDC coil.