Using optocoupler in the circuit.

Hello,
I have a single 24 V power supply which is going to run a motor. I am using a regulator that regulates the 24 V down to 5 V to power up the Arduino. The Arduino then sends a signal that controls the motor, which is operating directly from the 24 V supply. So, my question is, does putting an opto-isolator between the Arduino and the motor control circuit serve any purpose or is it pointless because, ultimately, the two power supplies are connected anyway? Looking forward to the important advices.
Thank you!

Opto-isolation is beneficial if the two sides of the opto-isolator are separately powered back to the power supply. So you have one pair of wires - and I do mean a pair, travelling together in the one cable - from the power supply to the regulator which powers the Arduino and similarly as a pair from that regulator to the Arduino, and another pair from the power supply to the motor controller (and also as a pair to the motor).

Again, a pair of wires goes from Arduino to the opto-isolator which is presumably mounted with the motor controller so the connections are very short. The only complication with this process of strict isolation is if you need to use the 5 V for the motor controller as well.

The specific problem with which the isolator deals, is impulses superposed on the power lines, for which having the separate lines back to the output capacitor of the power supply means that capacitor decouples such impulses. But another critical factor is open loops formed in the two sides of a circuit; power and ground or signal and ground, which would cause inductive coupling of impulses. This is why keeping both sides of each such circuit together is so important.

I would suggest using a buck converter from the 24 volts to about 8V and use the Arduino power supply for itself, you get more filtering and some additional isolation that way for free. Be sure the buck converter passes the ground wire through, some do not and use the + side as common. What does the signal look like that powers the motor control circuit, is it logic or 24V??? That will have a big impact on the interface. Quick and inexpensive if it is only on and off is use a relay board.

And I would suggest that using a "buck" regulator to derive 5 V is the proper way to do it as the Arduino actually operates on 5 V. You do not need "more filtering" (unless perhaps you are using the ADC to digitise audio) and "additional isolation" is quite nonsensical. :roll_eyes:

The particular problem with the regulator on the UNO/ Nano/ Mega 2560/ Leonardo is that it has very little heatsinking and can only cope with the microcontroller itself and perhaps a few LEDs at 20 mA each. If you connect anything that draws more than perhaps 100 mA - either from output pins in total or the "5V" pin, you risk the regulator shutting down after however long it takes to overheat. :astonished:

Thank you Paul and gilshultz for the input. Attached is the schematic of my circuit. The motor could run in both directions so I have to make +24 and -24 volts using a two channel optocoupler relay by connected NC of both relays and NO of both relays and connecting them to + and - terminal of PS. The common is then given to the motor. Relay is connected to Arduino via digital pin 12 and 13. Furthermore, from 24 VDC source, I have a connected a convertor, which outputs around 6.3 volts, therefore, I am feeding it to the RAW pin of Pro Mini.

So, generally, if I had another power source, then I could have connected the JD-VCC and GND pins to that source and IN1 and IN2 and VCC pins to the Arduino to make isolation. But as I don't have another power source, therefore, I connected VCC and GND directly to the Arduino. I wanted to connected JD-VCC and GND to the Arduino but I thought it won't make any sense. Therefore, that was my question that if we don't have another power source then how can we take advantage of using opto-isolators?

I am also working on another project, where, I have AC voltage reader sensor, AC current reading sensor, and a battery management system BMS that is connected via UART to the Arduino. For the sake of safety, I wanted to make some isolation among all peripherals. But I have only one Power Source that will be powering Arduino and I don't know if the circuit would be safe if I connected the VCC and GND pins of all the devices to the Arduino directly? If needed I can draw a schematic and share. Your handy suggestions would be highly appreciated. Thank you!

Hi,
Is the ProMini 3v3 or 5V?

If 5V you will need more than 6.5V on Vraw to get a properly regulated 5V for the controller.
You would be best to adjust the DC-DC converter to 5V and feed the 5V into the 5V pin on the ProMini..

The relay board is probably 5V also.
Can you post a link to specs/data of your relay board, some have optocouplers on them already.

The relays are providing isolation from the 24V motor circuit anyway.

Thanks.. Tom... :slight_smile:

In this case (as you’re using relays) I don’t see a point of using optoisolators as they don’t provide much if anything extra in isolation: the relays take care of that already.

It also makes the advice of #2 the totally wrong way to go. Those relays are no doubt designed to operate at 5V (the next higher common voltage is 12V), so they need 5V. The Arduino also needs 5V. If you want to use the Arduino’s regulator 6.5V is the bare minimum, 7V is recommended - however feeding 7V to your relay coils overdrives them seriously possibly leading to overheating (you almost double the power dissipation in the coils!), and you can’t use the Arduino’s 5V pin (which goes through the regulator!) to power the relays as the regulator is bound to overheat.

Long story short: get a buck converter with 5V output, use it to power the Arduino (through the 5V pin) and the relay coils.

TomGeorge:
Is the ProMini 3v3 or 5V?

If 5V you will need more than 6.5V on Vraw to get a properly regulated 5V for the controller.
You would be best to adjust the DC-DC converter to 5V and feed the 5V into the 5V pin on the ProMini..

Thank you Tom for the assistance. I am using 5V Pro Mini version. Furthermore, I am using the L7805CV regulator IC. The output of the regulator I measure is 6.36 volts that's why I feed it on the RAW pin. I think I can't reduce the output voltage to fixed 5V, I might be wrong.
And you are right, the voltage when I measure on the VCC pin of Arduino is 4.7 V. I don't if it would make problem in the long run as currently, the microcontroller is working fine. However, the voltage on the RAW pin is 5V.
The relay I am using is 2PH63091A 2 relay module.

On a side note, the schematic designator for relays is “K” (ie: K1,K2), NOT “R” (ie; ‘R1,R2’).

Longer answer
There are standardised “Letter codes for the designation of kind of item”.
In Australia, we use letter codes based on AS 3702, “Item designation in electrotechnology”. AS 3702 is essentially IEC 60750 with some extra information in the appendices.
AS 3702-1989: TABLE 1: LETTER CODES FOR THE DESIGNATION OF KIND OF ITEM

Letter code
Kind of item
A
B
C
D
E
F
G
H
J
K
L
M
N
P
Q
R
S
T
U
V
W
X
Y
Z

raschemmel:
On a side note, the schematic designator for relays is "K" (ie: K1,K2), NOT "R" (ie; 'R1,R2').

Thanks for the correction. Appreciated :slight_smile:

bilal40:
I am using the L7805CV regulator IC. The output of the regulator I measure is 6.36 volts

Something is badly wrong. :astonished:

bilal40:
I am using the L7805CV regulator IC. The output of the regulator I measure is 6.36 volts that's why I feed it on the RAW pin. I think I can't reduce the output voltage to fixed 5V, I might be wrong.

Do you have the bypass capacitors needed on the voltage input and output pins of the LM7805 as per the datasheet??
What package is the 7805 in, TO-220 or TO-92.
The TO-92 package will be too small.

Can you post a circuit diagram please?
Can you post a picture of your project so we can see your component layout?
Tom... :slight_smile:

TomGeorge:
Do you have the bypass capacitors needed on the voltage input and output pins of the LM7805 as per the datasheet??
What package is the 7805 in, TO-220 or TO-92.

Yes, I have 0.33uF capacitor on INPUT and 0.1uF on OUTPUT side of the IC. And I am using the TO-220 package.
In comment #4, I have shared the schematic of my project. Do you need to see something else in specific?

Paul__B:
Something is badly wrong. :astonished:

And what's that? :confused:

Hi,
You should not have 6.3V out of a LM7805, it is a fixed regulator.

Can you post a picture of your project so we can see your component layout?
Can you please post a more accurate circuit diagram?
Please show how you have wired the regulator.

The one you posted does not even show that the "converter" is not really a converter but a linear voltage regulator LM7805.

Thanks.. Tom.. :slight_smile:

Here is the schematic and the way I wired power supply to the regulator, arduino, and the relay. Sorry, if it is not looking so organized.

That 7805 (that unmarked part is a 7805, right?) should have 5V as output even without load connected, and should be connected to the Arduino's 5V pin, not the Vin.

Those resistor values are the minimum, more is allowed. Check datasheet on details, old regulators (like the7805) may not be stable with ceramic type.

Let’s see the wiring.

Raw needs ~7v.

Vcc is 5v

Maybe there's nothing wrong with your regulator ... just not enough capacitance on the output. Yeah, the 0.1µF is shown in the datasheet, but its likely a minimum requirement under ideal conditions (everything on a PCB). When you connect the Arduino, it adds extra capacitance. On your Pro Mini, the RAW terminal will add 10µF.

Got a 4.7µF to 100µF capacitor handy? Just connect it across the output of the regulator and the 6.4V will probably drop to 5.0V.

Hi,
Can you please post images of your project so we can see your component layout?
What is your 24V power supply?

6.4V unloaded and 5.05V loaded is not what you should see, I have set a 7805 up on my bench and the output does not change from loaded to loaded.

Thanks.. Tom... :slight_smile: