1

I am designing a PLC board using ESP32. This board will contain 30 relays. I want to design the protection circuit for these relays as shown in the upper left corner of the photo. Due to the high number of relays, I need to use ULN2803 and PS2801-04 integrated circuits. I have designed the schematic as seen in the photo, but since I am new to electronics, I need to verify myself. Is my design correct, or are there any additional electronic components I need to add?Can I use 74HCT14 instead of an optocoupler?enter image description here enter image description here

3 Answers3

1

You don't need the 1N5819s if you tie COM on the Darlington array to +24.

The 1kΩ resistors seem wastefully low, you only need 500uA to drive the Darlington arrays, so 30kΩ would be fine.

I don't think you have the voltage to reliably drive the series combination of two LEDs from 3.3V. The 20Ω resistors you've come up with is an indication of this- the internal resistance of the GPIO is more than that, so you've essentially got no control over the current. You could perhaps drive the LEDs in parallel with the relay coils (with series resistors, of course) or in series (if the current is appropriate). Or just in parallel with the optocoupler LEDs + resistors (with additional series resistors, of course).

As mentioned in another answer, you're losing much of the advantage of optocouplers if you tie the grounds together. It would be better to have galvanic isolation between the two power supplies. Especially for a general-purpose output such as a PLC there can be a lot of noise coupled back through the coil-contact capacitive coupling to your digital ground when inductive loads are switched, which can cause the shift-registers to do undesired things. If you decide to leave out the optocouplers or join grounds I strongly suggest getting relays with the best coil-contact isolation practical (coil-contact voltage breakdown rating is a reasonably proxy, then testing) and paying particular attention to your PCB layout.

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • Thank you, I will remove the 1N5819 diodes. Those are not 20Ω resistors, they are actually 220Ω resistors. I apologize for the unclear visibility in the photograph. – Mehmet Emin ARSLAN Jun 04 '23 at 15:01
1

In the "logic circuit" schematic, the optocoupler is shorting out the relay coil.

In the "designed state" schematic, resistors R35 to R42 can be eliminated. The ULN2803 sections have input resistors built-in.

Note that while each individual 2803 output is rated for 500 mA, there is a total GND current spec for the entire package which is much less than 4 A. IOW you cannot have all 8 outputs sinking maximum current simultaneously.

You show the same GND symbol on both sides of the optocouplers, so the optical isolation is not doing anything and can be eliminated. This is a significant reduction in circuit complexity and cost. If the indicator LEDs are connected across the relay coils, then the HC165 does not have to supply the LED current, something it was not designed to do.

If the 24 V source for the relays and the 5 V source for the 74HC165 actually have separate grounds, this needs to be shown in the schematic with two different symbols, each with a different net name attribute.

AnalogKid
  • 16,865
  • 1
  • 13
  • 25
  • Are you saying that I cannot drive 8 relays with ULN2803? Shouldn't I use optocouplers because there is only one common ground in the circuit? – Mehmet Emin ARSLAN Jun 04 '23 at 14:48
  • The number of relays that you can activate *at the same time* depends on the operating current of the relay. What is it? Please add a link to the relay datasheet to your post. – AnalogKid Jun 04 '23 at 18:40
  • Whether or not you use isolated grounds is entirely up to you. Why do you think you need them? – AnalogKid Jun 04 '23 at 18:40
  • At my workplace, they asked me to use isolated optocouplers. So, I wanted to design a circuit based on a relay logic diagram that I found, specifically for 30 relays. – Mehmet Emin ARSLAN Jun 04 '23 at 21:42
0

I got 4 of these. enter link description here I think I got them from Alie for less money. enter image description here Many relay boards look much like what you show. There is a opto isolator and a relay that also isolates. I do not see the need for two layers of isolation.

ronsimpson
  • 866
  • 1
  • 7