Necessary to opto-isolate a darlington array output?

Hello, I've got the following circuit going:

A Vishay opto-isolator (CNY74-4) that takes input from buttons that work on 24V, and outputs to microcontroller pins (an ESP32 in my case).

A ULN2803 darlington array connected to the microcontroller, +24V and GND, driving LEDs.

Initially I had designed the circuit so that the 24V of the buttons had its own separated GND. But to use the ULN2803, I need to connect the GND of the microcontroller to the GND of the 24V power supply, or it won't work.

This entire setup works perfectly, but I'm wondering if I should also put an opto-isolator between the microcontroller and the ULN2803. It might be overkill, but then the 24V power supply is completely separated electrically from the microcontroller.

I discovered the Vishay ILQ30, an opto-isolator with darlington output. It could take care of this in one DIP. Or the Toshiba TLP627-4, that one is in my KiCad library :slight_smile:

Hi,
Welcome to the forum.

What is the application?
The mention of 24V rings of an industrial use.
Most PLCs use opto isolation on their digital inputs like you have, it is a very good move in an environment that could have all sorts of noise and voltage spikes.
Most PLCs also opto-isolate their outputs for the same reason.

So if you have the room and hardware and need that level of protection, go ahead, it is a regular practice.

There are circuits to isolate analog inputs and outputs, but they get very complicated and expensive.

Tom... :slight_smile:

I wouldn't bother with the opto-isolator.

It could protect the microcontroller from 24V if the ULN2803 burns-up and shorts-out but that's unlikely to happen just driving LEDs and the microcontroller might survive anyway because the current-limiting resistors for the LEDs will limit the current into the microcontroller.

If you had a "user connection" where something is likely to be mis-wired an opto-isolator might be a good idea.

I've attached a schematic. It is possible that there's user error in the wiring! The button connector is a 4-pin JST connector.

It's to wire an arcade button with a 12V LED inside.

Your circuit is fine without the proposed isolator. I do question using a ULN2808 for only 1 input / output. A MOSFET would have done the job, only 3 connections and no connections spare to worry about.

Hi,
Ops circuit;


It would be preferable if you draw a schematic with everything connected rather than have a search-a- word schematic.
Also including the LEDs and buttons and power supply.
The circuit you have supplied is okay for PCB production, but not good for any signal tracing and troubleshooting.

Tom... :slight_smile:

Yeah I just quickly had to adapt the much bigger schematic that I had, sorry for the label shortcuts :smiley: next time i'll connect them.

I'm not just using the array for 1 LED, in total the PCB will drive 12 LEDs.

Thanks for the help guys!

You are interfacing buttons and LEDs in the same assembly.

The first question is - why do you feel opto-isolation is in any way necessary?

What are these LEDs and why are you proposing to use 24 V? What is their current requirement?

For multiple output driving, a TPIC6B595 would be a better choice up to 150 mA each, requiring only three control pins for multiple devices.