Nano 33 ble -> seeking opto coupler to suit digital inputs and outputs

Hi All,

Need to wire field digital inputs (12 VDC when ON) and outputs (inter posing relays, coil voltage 12 VDC) to a nano 33 ble.
From the spec
DC Current per I/O Pin
15 mA

Digital Input / Output Pins
14

Since we are wiring digital inputs and outputs to field devices, and current per pin is 15 mA, we intend to install an opto coupler between the nano 33 ble digital ports and and field devices.

May I ask you please to advise suitable opto coupler, that we can use for both digital inputs and outputs.

Thanks in advance for any help
Trajano

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.

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.

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.

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.

A 4N35 opto coupler is quite standard in Arduino projects.
However, not all applications are suitable for opto couplers. For example, if fast switching speed is required to drive a mosfet, then other solutions should be considered.

Edit
Post crossed with Paul__B

Paul__B:
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
pinMode(pin, mode)
INPUT_PULLUP

3.2/ external
pinMode(pin, mode)

mode: INPUT
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.
source:
https://www.arduino.cc/reference/en/language/functions/digital-io/pinmode/

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.

source:
https://store.arduino.cc/usa/nano-33-ble-with-headers

Point is that a common relay ("Songle") requires 90 mA to actuate, not 5, so you require a transistor to switch it. Nowadays, "transistor" generally means FET.

The optocoupler has a transistor on the output side, hence should be able to hand the 12 VDC coil load current for the inter posing relay.

Max current produced by nano 33 ble is 15 mA

Any suggestion for a chip fitted with 4 channel optocoupler, similar to 4N35, etc.?

Thanks
Trajano

That 15mA is likely the absolute max pin current rating, and should therefore be avoided.

Common opto relay modules work with ~2mA LED current, and the opto transistor is followed by a second transistor that drives the relay coil.
Leo..

traja47:
The optocoupler has a transistor on the output side, hence should be able to hand the 12 VDC coil load current for the inter posing relay.

Sorry but - complete nonsense! :roll_eyes:

The optocoupler uses a transistor indeed, but it is rated for far less than the relay coil current, and even then, limited by the CTR of the device.

I believe you do not understand optocouplers as such - please study the link I have just given. While transistor β (gain) commonly lies in the high tens to low hundreds, CTR is generally expressed in percent and better devices may still be as low as 50% requiring double the current through the LED for the transistor to pass in consequence.

Wawa:
1/ That 15mA is likely the absolute max pin current rating, and should therefore be avoided.

2/ Common opto relay modules work with ~2mA LED current, and the opto transistor is followed by a second transistor that drives the relay coil.
Leo..

1/ correct as per spec
2/ sounds fine to me
have seen 10mA for the forward current for the LED fitted to the optocoupler
since I am constructing a prototype, required a chip fitted with 4 x optocouplers with pin (not surface mount).
Any suggestions?
thanks
Trajano

The common single "817" is US$0.10 shipped on ebay, so four next to each other could be the cheapest option.
If you want quads, then use the search engine of the big parts providers in your country (RS components here).
There are no special requirements for a relay opto.
Leo..

Wawa:
That 15mA is likely the absolute max pin current rating, and should therefore be avoided.

Common opto relay modules work with ~2mA LED current, and the opto transistor is followed by a second transistor that drives the relay coil.
Leo..

aware max current for nano 33 ble is 15mA, hence will calculate circuit to support max current 10mA
thanks

hi Paul
thanks for the reply

I might study following material:
PC817XNNSZ0F

and compare to 4N35

as stated before, my preference is for a chip supporting 4 optocouplers, since I do require 8 channels for the applications

thanks
Trajano

"817" (PC817, HCPL817, K817 etc.) is a single package.

"847" ..... is a quad package of the same opto coupler.

Any basic opto coupler is fine if speed is not a requirement (relay driver).
Leo..

traja47:
I might study following material:
PC817XNNSZ0F
and compare to 4N35

You will find the PC817 is a much improved device.

traja47:
as stated before, my preference is for a chip supporting 4 optocouplers, since I do require 8 channels for the applications

And indeed there are "quad" versions of the PC817 but never were for the antique 4N35. You may however be slightly disappointed to find there are no DIL versions of the quads. It makes no difference in board space as four (SMD) 817s fit in the same space as a quad, they each have only four pins.

Paul__B:
You may however be slightly disappointed to find there are no DIL versions of the quads.

Wawa:
http://www.farnell.com/datasheets/2050707.pdf

Thanks, I might consider following chip fitted with 4 optocoupler channels
Vishay, K847PH DC Input Transistor Output Quad Optocoupler, Through Hole, 16-Pin DIP

Source:
https://au.rs-online.com/web/p/optocoupler-ics/7085437

Paul__B:
You will find the PC817 is a much improved device.
And indeed there are "quad" versions of the PC817 but never were for the antique 4N35. You may however be slightly disappointed to find there are no DIL versions of the quads. It makes no difference in board space as four (SMD) 817s fit in the same space as a quad, they each have only four pins.

Paul__B:
You will find the PC817 is a much improved device.
And indeed there are "quad" versions of the PC817 but never were for the antique 4N35. You may however be slightly disappointed to find there are no DIL versions of the quads. It makes no difference in board space as four (SMD) 817s fit in the same space as a quad, they each have only four pins.

Hi Paul,
Appreciate your time and effort.
Leo suggested following PC847 variant chip that I might proceed with the resistors calculation:
Vishay, K847PH DC Input Transistor Output Quad Optocoupler, Through Hole, 16-Pin DIP

https://au.rs-online.com/web/p/optocoupler-ics/7085437

Wawa:
http://www.farnell.com/datasheets/2050707.pdf

Thanks for the information
Will select material supporting 4 channels:
K847PH
Manufactured by Vishay
Thanks Leo

I am developing an application note explaining the connectivity between nano 33 ble and K847PH.
I will use the pull up internal resistor as suggested by Paul.

Thanks