0
\$\begingroup\$

I am more of a software guy, and I want to make sure my design works before sending it off to fabrication.
I need to interface with 24V PLC I/Os. I want a simple design for now, as I can add refinements/improvements in later stages.

In the following schematic I added numbers corresponding to my questions below.
Here are links to the datasheets:
PCF8574
TLP291-4
TBD62783A
LEDs

Schematic

1)
I went with the simplest solution of just limiting the LED's current of the opto. I've seen designs with a resistor to GNDS (between pin 1 and 2 of the opto). What use/advantage would that have?
I just noticed the LED's max. reverse voltage is 5V. So putting a diode from GNDS to pin 1 of the opto would make it safe against reversed polarity, right?
What about long cables? Could voltage spikes damage my inputs?

2)
It felt weird putting the inputs' indicator LED next to the pull-up resistor. But I guess that getting the signal to the PCF8574 and getting the indicator LED on works like this?

3)
I want an indicator LED at the output as well, but I was not really sure how to place it. This is what I found and I calculated the needed series resistance at around 47R. I was aiming for a current of around 5mA. According to the LED's and opto's datasheet the voltage drop is 1.8V (LED) and 1.25V (opto), so 0.25V for the resistor. At 47R that would be 5mA.
The numbers feel weird, but with the PCF8574's output set low, I should get the opto and indicator LED activated. I hope that this design is robust enough, and not prone to tolerances. If I'm not wrong, the PCF8574's outputs are standard high, so the opto is not activated at default/startup.

4)
Here, I am not sure if I can wire the opto's transistor to the pull-down resistor like this. Shouldn't the emitter be directly at GND?
Also, the TBD62783A has a maximum gate voltage of 30V. Do I need to put a resistor between 24V and pin 16 of the opto to be safe? What about current limiting of current going into the gate?

Bonus
Do you have any more tips for me on a design like this? Or any helpful resources I could study?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I went with the simplest solution of just limiting the LED's current of the opto.

This will work as long as the digital output attached to DI_O_24V can drive >= ~10.4mA. When you don't know what is attached to DI_O_24V it's maybe better to add a buffer between DI_O_24V and R1.

I've seen designs with a resistor to GNDS (between pin 1 and 2 of the opto). What use/advantage would that have?

For use cases where you need a current in both directions that could make sense (e.g. bipolar circuits) to have a resistor in parallel to the diode. I don't think it's necessary in your case.

I just noticed the LED's max. reverse voltage is 5V. So putting a diode from GNDS to pin 1 of the opto would make it safe against reversed polarity, right?

Yes, but be aware that the diode must withstand the power dissipation in the reverse polarity case. Choose a diode which allows a certain margin to the worst case.

What about long cables? Could voltage spikes damage my inputs?

I think the answer here is simple. If you exceed the absolute maximum ratings given by the components specs, yes. I guess this circuit will be used in an industrial environment, I would always expect the worst. Not only critical voltage spikes, but all types of radiated and conducted emissions.

Some countermeasures would be:

  • shielded cables
  • neutral earthing
  • differential signaling
  • galvanic isolation

It felt weird putting the inputs' indicator LED next to the pull-up resistor. But I guess that getting the signal to the PCF8574 and getting the indicator LED on works like this?

This will work, but don't expect that you reach the maximum speed ratings from the optocouplers specs with your solution. Here you find the why.

I want an indicator LED at the output as well, but I was not really sure how to place it. This is what I found and I calculated the needed series resistance at around 47R. I was aiming for a current of around 5mA. According to the LED's and opto's datasheet the voltage drop is 1.8V (LED) and 1.25V (opto), so 0.25V for the resistor. At 47R that would be 5mA. The numbers feel weird, but with the PCF8574's output set low, I should get the opto and indicator LED activated.

This will work as well. Don't know what LED you use, but don't drive it at its limits.

If I'm not wrong, the PCF8574's outputs are standard high, so the opto is not activated at default/startup.

I didn't find the answer to the default states in the specs. But if you say so, I would agree.

Here, I am not sure if I can wire the opto's transistor to the pull-down resistor like this. Shouldn't the emitter be directly at GND?

No, it doesn't matter on which potential the emitter of the optocoupler is. Important is, that the collector potential is higher than the emitter potential. You could swap the optocouplers detector with R2, that would work as well, but you would get an inverted signal at I1.

Do you have any more tips for me on a design like this? Or any helpful resources I could study?

Your schematics doesn't look complete:

  • If it's not explicitly allowed by the specs, don't leave unused inputs in undefined states. Pull them to an appropriate potential.
  • Use bypass capacitors for every IC. Keep them as close to the IC as possible.

For further design recommendations follow Analog Devices Linear Circuit Design Handbook

Particularly chapter 12 covers a lot of best practices for PCB design.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.