Go Down

Topic: How to use this 12V Relay with Optocoupler? (Read 635 times) previous topic - next topic

flokada

Hey guys, I really appreciate your help! (and sorry for the very late reply, I was kinda busy)

Since I am very newbie in electronics, those schematics are way too confusing for me. I'll try to explain what I am trying to do, so you guys can tell me if something is wrong.

I want to activate the relay (that will active a solenoid valve) using an external 12V power supply and the arduino's 5V from a digital pin, in other words: connecting 12V (from power supply) on the relay VCC, Ground (from power supply) on relay GND and 5V (from Arduino's digital pin) on relay Signal.

Is that correct or I am going to explode something? (I'll leave a 'very nice' schematic that I made, to make things easier to understand).



Thanks!

edgemoron

I think you need a connection from Arduino GND to 12V ground, there has to be a return path for the signal.

flokada

I think you need a connection from Arduino GND to 12V ground, there has to be a return path for the signal.
I see... I think I might power the arduino using the 12V power supply (this way connecting Arduino GND to 12V ground).

But my main concern is whether using the 5V signal is 'safe' for the arduino or not, since the VCC is 12V from a different power source.

Hopefully you guys can understand my questioning, haha.

edgemoron

You could put a 1N4148 diode between the Arduino output pin and the relay signal pin, (cathode (end with stripe)) toward relay, that would prevent 12V from feeding back to Arduino if module circuitry failed.

flokada

You could put a 1N4148 diode between the Arduino output pin and the relay signal pin, (cathode (end with stripe)) toward relay, that would prevent 12V from feeding back to Arduino if module circuitry failed.
Oh, that's actually a nice solution! That what I was worried about...

I'll keep that in mind.

Thanks!

promacjoe

Is the relay signal active high, or active low. In other words does the really turn on when the Arduino Outputs 5V to it, or does it turn on when the Arduino Outputs 0V. Most relay boards are active low, in that case the diode will not work. Besides there are two diodes that are there already. One for the optocoupler, And one LED. If your signal is active high, or if it is bidirectional set it up for active high, and there will be no chance of 12V getting into it. otherwise, the diodes and current limit resistor will prevent high current from getting to the Arduino. The clamping diodes within the Arduino should reduce the voltage to a safe level.

flokada

Is the relay signal active high, or active low. In other words does the really turn on when the Arduino Outputs 5V to it, or does it turn on when the Arduino Outputs 0V. Most relay boards are active low, in that case the diode will not work. Besides there are two diodes that are there already. One for the optocoupler, And one LED. If your signal is active high, or if it is bidirectional set it up for active high, and there will be no chance of 12V getting into it. otherwise, the diodes and current limit resistor will prevent high current from getting to the Arduino. The clamping diodes within the Arduino should reduce the voltage to a safe level.
It is possible to choose between active high or low, but I'll be using active high.

So, you are saying that it is not necessary to put a diode?

Thanks

Go Up