3.3V uC vs 5V relay

Thread Starter

Lucky-Luka

Joined Mar 28, 2019
181
hi,
What is the purpose of using opto isolators, when the resistor and transistor would be suitable.?

E
you should ask to Elegoo...
Btw there on that board there is a jumper that allows to completely separate the circuit of the input from the circuit of the relay.
 

Thread Starter

Lucky-Luka

Joined Mar 28, 2019
181
I have bought this standard relay module and now I am trying to use it with a 3.3V board.
It's buildt like this. Why do you ask me why it's built like this?
An octocoupler is meant to separate input from output. There is a jumper on the board to allow this possibility.
I could just use a power mosfet for the load and a mosfet to drive it.
Maybe there is a reason if billions of these modules were sold though...
I cannot understand what is the meaning of your questions and why you don't just address the original question...
 

dendad

Joined Feb 20, 2016
4,472
One reason to use an Opto is to allow an active low output to drive the relay.
And if the board had both ends of the opto input available, then it is easy to swap to an active high.
Another advantage is to keep relay switching noise out of the micro as the relay supply can be fully isolated from the micro.
Like, a 24V power supply for the relays and have the relays switching mains.
Often, in industrial control, the 24V supply can have many devices on it so full isolation is a very good idea.

And on the transistor driver shown above, it is always wise to add a B-E pull down resistor, maybe a 10K just to make sure the transistor is off.
 
Last edited:

Thread Starter

Lucky-Luka

Joined Mar 28, 2019
181
And on the transistor driver shown above, it is always wise to add a B-E pull down resistor, maybe a 10K just to make sure the transistor is off.
In the module mentioned above it's not possible though...
Is IRL510 ok for that purpose, right? Can I drive it directly with the GPIO pin?
btw I still have not received an answer to my original question...
 

BobTPH

Joined Jun 5, 2013
8,939
No, not with the relay module input connected to +5V always, as in your circuit.

Just connect the output pin to the relay board input, it will probably work.

Bob
 

sagor

Joined Mar 10, 2019
909
Hi all
Given the 5V relay in the schematic I think I can use a 3.3v GPIO pin to control it. Right?
What it the minimum voltage to give it the HIGH state having Vcc=5V?
The schematic shows 2 leds and a 1k res in series.
It's a curiosity.
Thanks
https://www.elegoo.com/products/elegoo-8-channel-relay-module-kit
It should work. As one person (dendad) said, short out the indicator LED, as voltage drop may be too large across 2 LEDs for 3.3V to trigger the opto.
VCC connects to your 3.3V VCC. JD-VCC should be connected to a 5V supply (if possible). Remove any VCC to JD-VCC jumper to do this. This assumes the relay needs that full 5V to trigger.
 

Thread Starter

Lucky-Luka

Joined Mar 28, 2019
181
It should work. As one person (dendad) said, short out the indicator LED, as voltage drop may be too large across 2 LEDs for 3.3V to trigger the opto.
VCC connects to your 3.3V VCC. JD-VCC should be connected to a 5V supply (if possible). Remove any VCC to JD-VCC jumper to do this. This assumes the relay needs that full 5V to trigger.
Why do I have to separate the Vcc if I have same ground in my circuit?
 

Thread Starter

Lucky-Luka

Joined Mar 28, 2019
181
It should work. As one person (dendad) said, short out the indicator LED, as voltage drop may be too large across 2 LEDs for 3.3V to trigger the opto.
VCC connects to your 3.3V VCC. JD-VCC should be connected to a 5V supply (if possible). Remove any VCC to JD-VCC jumper to do this. This assumes the relay needs that full 5V to trigger.
I would like to know if the relay is active: that LED would be appreciated...
btw today I have tried the board and 3.3V GPIO pin can activate the relay and the LED.
photocoupler
relay
 
Last edited:

sagor

Joined Mar 10, 2019
909
A 5VDC relay you mention says minimum pull in voltage is 75% of rated voltage. So, a 5V relay would require 3.75V to ensure pull in. Anything less may work, but maybe for a while. Then it may fail to work.
Don't mess with specifications. If the relay requires 5V, use 5V. If you need a LED indicator, maybe look at other options for indicators.
Otherwise, use a different circuit, one where a 3,3V level can trigger a relay directly via a driver like a transistor. You could also use a transistor driver to trigger that relay board's opto circuit if everything on the board is wired to +5V.
Final option is to use a level converter for 3.3V to 5V logic levels. There are several on places like Ebay or Amazon. The circuit is basically a MOSFET wired up to convert the voltage levels, and is very compact. They are often called I2C level converters, but are basically just logic level converters (but may be limited in current capacity, may not have enough current sinking to trigger opto):
https://www.ebay.com/itm/134086962144?hash=item1f3834abe0:g:3yYAAOSw5CddN5bm
 
Last edited:

Thread Starter

Lucky-Luka

Joined Mar 28, 2019
181
Otherwise, use a different circuit, one where a 3,3V level can trigger a relay directly via a driver like a transistor. You could also use a transistor driver to trigger that relay board's opto circuit if everything on the board is wired to +5V.
Final option is to use a level converter for 3.3V to 5V logic levels. There are several on places like Ebay or Amazon. The circuit is basically a MOSFET wired up to convert the voltage levels, and is very compact. They are often called I2C level converters, but are basically just logic level converters (but may be limited in current capacity, may not have enough current sinking to trigger opto):
https://www.ebay.com/itm/134086962144?hash=item1f3834abe0:g:3yYAAOSw5CddN5bm
level_shifter
0.22A right? If that's the case it's enough.
 
Top