5V relay module with 3v3 logic level signal - help needed in review

Thread Starter

TyphoonBeard

Joined Mar 10, 2023
6
Hello,

I am trying to design a circuit for a 5V relay module, which is using 3V3 logic level. I am not 100% sure about the calculations I made, even though I put lot of time and effort in search and study of similar circuits. I've found only generic schematics without actual values or defined components. I am not experienced in electronics design, so please take that into account. Any help in review is highly appreciated.

I want to be sure, that the components are correct, before I order some prototype from this circuit. I want to have the controlling signal to be separate from the relay side, in order to avoid any interference between the relay and the controlling circuit. I have added two LEDs in order to have feedback about the presence of the power supply voltage, and to see when the relay has been activated. I needed an active-high module. I hope I have provided all necessary information.

Datasheets of the components are attached. Thanks to anybody who is willing to help.

Relay module.png
 

Attachments

crutschow

Joined Mar 14, 2008
34,855
Why are you using an opto isolator to drive a relay?
The relay also provides isolation, so you have redundant isolation.
Just drive transistor Q1 directly from the 3.3V signal to activate the relay.
 

Thread Starter

TyphoonBeard

Joined Mar 10, 2023
6
Why are you using an opto isolator to drive a relay?
The relay also provides isolation, so you have redundant isolation.
Just drive transistor Q1 directly from the 3.3V signal to activate the relay.
Thank you crutschow for your notes.
Well, to be honest I do not have a really good reason other than - to be able to completely isolate the two circuits from each other. Using only a transistor would result in sharing the ground between the microcontroller and relay GND. Studying other similar purpose circuits, I saw that nearly all of them are using opto couplers to separate the two circuits. I would like to use these relays to control mains voltage, and planning to use more of them in one circuit, so I guess I can only say that try to make it as safe as it could be.

Link to a description about using the opto coupler:

https://lastminuteengineers.com/two-channel-relay-module-arduino-tutorial/

" Optocouplers offer complete electrical isolation between the logic control input and the relay power as an extra layer of protection in the event of a major failure on the relay’s AC load, such as a lightning strike. "
 

crutschow

Joined Mar 14, 2008
34,855
Okay.
But to have isolation, the 5V relay power must be completely isolated from the control power (no common ground).
Is that what you are planning?
What are the sources for your control circuit power and the relay power?
 

Thread Starter

TyphoonBeard

Joined Mar 10, 2023
6
Okay.
But to have isolation, the 5V relay power must be completely isolated from the control power (no common ground).
Is that what you are planning?
What are the sources for your control circuit power and the relay power?
Sorry, that I wasn't clear on the beginning. I will use two separate power sources. One to power the microcontroller and one to power the relay. The main reason is, I am having issues with some appliances, when the power supply is common with the relay and the microcontroller. I have an issue that the microcontroller sometimes suddenly reset itself during deactivation of the relay. This is what I am trying to avoid, and I think the common power supply causes the issue as I have multiple same circuits, but most of them work nicely, few of them are not.
 

Thread Starter

TyphoonBeard

Joined Mar 10, 2023
6
Hi TB,
Do you have a suppression diode across the relay coil.?
E
Hi ericgibbs,

Yes they are equipped with flyback diodes in reverse polarity of the relay coil. I am not sure about their complete schematic, since these are cheap relay modules, without proper documentation. That is why I want to use my own design, to be sure about the circuit.

They look like the picture attached.
 

Attachments

With a quick look at the datasheet, I couldn't see the voltage drop across the LTV-814 diode but if it's around 1.5V then you'd be pushing around 8.5mA through it - in case your 3.3V logic can't manage that? For example, a Seeeduino XIAO can only manage about 2mA. Otherwise, my view is that it would probably work, best thing is to try it! No guarantee given....
 

Thread Starter

TyphoonBeard

Joined Mar 10, 2023
6
With a quick look at the datasheet, I couldn't see the voltage drop across the LTV-814 diode but if it's around 1.5V then you'd be pushing around 8.5mA through it - in case your 3.3V logic can't manage that? For example, a Seeeduino XIAO can only manage about 2mA. Otherwise, my view is that it would probably work, best thing is to try it! No guarantee given....
As I know, the microcontroller (ESP32-WROOM-32) I am using, is capable to provide up to 40mA per GPIO. I have calculated 10mA, with 1.2V voltage drop on the diode of the optocoupler (typical value according to its datasheet). Are my calculations not accurate?
 
Top