1
\$\begingroup\$

For a microcontroller generating a 20mA industrial digital output. What kind of setup is best? I'm considering:

  • Microcontroller pin driving a low current N-FET to pull a 24V signal to ground. But this is probably not good as EMF on the line could damage the microcontroller.
  • Using a high/low side N-FET driver to drive an output. Does this offer any added protection compared to the above method? It's still galvanically connected, but is it any better?
  • If the output speed can be slow: microcontroller driving an N-FET, which drives an optoisolator (since I dont want to pull a lot of current from the micro).

What are your guys go to setups? #3 seems best if the slow switching of an optoisolator is fine. But if you want a more responsive 24V signal, is #2 good enough protection wise?

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Why not reverse engineer? Here, I guess normal 8DO ++ fast 4DO : s7detali.narod.ru/S7_1200/S7_1215C_DC/S7_1215C_V4_10.jpg , s7detali.narod.ru/S7_1200/S7_1215C_DC/S7_1215C_V4_12.jpg, , s7detali.narod.ru/S7_1200/S7_1215C_DC/S7_1215C_V4_11.jpg \$\endgroup\$ Commented Dec 9, 2021 at 6:28
  • \$\begingroup\$ @MarkoBuršič great photos! where did you find those? They seem to be quad channel comparators going to optocouplers. What do you think those diodes are for? I guess if you ever need a faster signal you can always just use a faster optocoupler huh. \$\endgroup\$
    – mosfeta
    Commented Dec 9, 2021 at 6:35
  • \$\begingroup\$ Optos give you galvanic isolation. As for ESD and EMI, they might be just as vulnerable as the microcontroller. \$\endgroup\$
    – Kartman
    Commented Dec 9, 2021 at 6:55
  • \$\begingroup\$ My bad, they are 6DO + fast 4DO the other two ICs are 7905 and 7912: -5V & -12V LDO supply for the gate driving. \$\endgroup\$ Commented Dec 9, 2021 at 6:59
  • \$\begingroup\$ @Kartman Im guessing since PLC manufacturers use them, I shouldn't worry about it? \$\endgroup\$
    – mosfeta
    Commented Dec 9, 2021 at 7:08

4 Answers 4

2
\$\begingroup\$

Using a high/low side N-FET driver to drive an output.

Highside N-FET is what I use.

Does this offer any added protection compared to the above method?

You can pick a "smart" high side driver which comes with a lot of extra built-in protection. Infineon has great parts for this, examples. The down side is that you have to "marry" Infineon and they are a very fickle and unreliable partner.

For analog outputs use a diff amp to convert a PWM from the MCU.

It's still galvanically connected, but is it any better?

No, but in the average industrial settings that's not needed either. If you power the MOSFET from external 24V you can optionally put a digital isolator between the MCU and the MOSFET. I'd avoid optocouplers since they aren't very reliable over time.

In terms of ruggedness it's probably a better investment to place TVS where appropriate: on the 24V supply and on the output.

\$\endgroup\$
3
  • \$\begingroup\$ Ahahaha Infineon is red flag? I've never heard of a digital isolator, I will take a look! What is your go to for sinking outputs? \$\endgroup\$
    – mosfeta
    Commented Dec 9, 2021 at 7:50
  • 1
    \$\begingroup\$ @mosfeta Infineon products are great, but their organization is horrible. They like to frequently give their customers the 52 weeks delivery time middle finger on regular basis even before the current component shortage crisis. Unfortunately after the merger with IR, they now pretty much have monopoly on these kind of parts. ST and Renesas have a few similar parts but nowhere near the same product range. Regarding digital isolators, check for example analog.com/en/products/interface-isolation/isolation/…. \$\endgroup\$
    – Lundin
    Commented Dec 9, 2021 at 8:43
  • \$\begingroup\$ Infineon also (IMO) inherited from Siemens the habit of maximal complexity, in contrast to STmicro for example. But top notch performance and feature set. \$\endgroup\$
    – Pete W
    Commented Dec 9, 2021 at 19:22
0
\$\begingroup\$

Think what 24V signal amplitude in combination with slew rate will do to maximum communication speed. The point is, 24V digital output will probably be something high-speed optocouplers can easily deal with.

And if that is not enough you can always use digital isolators and place your switching FETs on the other side.

\$\endgroup\$
1
  • \$\begingroup\$ Thats a good point \$\endgroup\$
    – mosfeta
    Commented Dec 9, 2021 at 7:38
0
\$\begingroup\$

After finding more PLC PCB images I found two methods for NPN outputs.

  • Small N-FET driving an optocoupler, driving a large N-FET
  • Comparator driving an optocoupler

After looking at the comparators used. I found that the comparators had a minimum guaranteed sink current of 6mA. Looking at minimum CTR's of various optocouplers, I found that with 6mA of current, you can only really sink around 12mA, which is not enough for some digital inputs I've found (20mA). So I'm going to stick with small n-fet driving optocoupler. With the optocoupler driving a power n-fet if I want to sink even larger amounts of current.

\$\endgroup\$
1
  • \$\begingroup\$ IEC "Type 1" and "Type 3" PLC 24V inputs are 15mA max. "Type 2", which you might not need to support, is 30mA max. So 12mA would indeed be not compliant. Besides, with bulk capacitance of e.g. a 10m cable, it limits your data rate for some uses, often a non issue. \$\endgroup\$
    – Pete W
    Commented Dec 9, 2021 at 19:46
0
\$\begingroup\$

Some options for the non-isolated case:

  • You could look at drivers made for IO-Link, which has a similar 24V single ended physical signal format. These are attractively compact but might have a bunch of features you may not need.
  • STmicro has a somewhat dated but robust and super simple 4channel push-pull/tristate driver, L6374, but sadly long lead time with the parts shortage at the moment.
  • A discrete dual PNP (or dual NPN) current limited circuit, possibly driven with a logic gate, is effective if you know for sure whether you are sourcing (or sinking). Plus series diode, maybe termination, protection network, and layout for thermal dissipation in short circuit. No issues with component sourcing, but a bit clumsy and high part count.
\$\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.