Problems driving a solenoid

Hello,
I am trying to drive a solenoid to control air in a diy cnc laser engraver and I am running into, what appears to be EMI.
My setup

  1. I am upgrading a chinese 40w laser, so I have their 24v/5v power supply
  2. I am using Arduino Mega 2560 and CNC Shield
  3. I am driving v110 VAC Electric Solenoid (https://www.amazon.com/gp/product/B018WRJYSG/ref=ask_ql_qh_dp_hza) using a HL-52S opto-isolated relay module (https://howtomechatronics.com/tutorials/arduino/control-high-voltage-devices-arduino-relay-tutorial/).
  4. I am powering the relay module independently from arduino (although i have common ground)

Symptoms:
After several on-off cycles arduino reboots or freezes up.

Troubleshooting so far:

  1. The problem occurs only when solenoid is attached (powered). If not, the HL-25S relay will click off and on many times without any issues.
  2. Suspecting airborne EMI I connected solenoid directly to power via a simple switch and cycled it many times - no affect on arduino.

So it seems that relay is not isolating me from EMI... is that possible? Any suggestiongs are much appreciated!

Show us a good schematic of your circuit.
Show us a good image of your wiring.
Give links to components.
Posting images:
https://forum.arduino.cc/index.php?topic=519037.0

aparfeno:
I am powering the relay module independently from arduino (although i have common ground)

Then you don't have opto isolation.

To opto isolate a relay module, remove the JD-VCC jumper,
and power the relay (coils) with a separate 5volt supply on the JD-VCC (not VCC) and ground pins.

Connect VCC and the INs to the Arduino, but NOT RELAY GROUND.

A snubber circuit across the relay contacts (AC power) or diode across the solenoid (DC power) might be needed to kill EMI.

As larryd said, post a full diagram, and code. There might be more wrong
Leo..

Can I please get some help designing a snubber circuit for the solenoid?
It is a 110VAC, 2watt, R=183ohm. That's all I could find about it.

Fixed:
I harvested a .47u capacitor and a beefy 53ohm resistor, connected them to solenoid and problem disappeared

Not surprising. This is exactly why insisting on optical isolation on a relay driver is poor advice. It's not the right solution.

Opto isolation is for mains power safety or to eleminate ground loops.
Snubbering is for killing EMI.
Sometimes you need one, sometimes you need the other, sometimes you need both.
Explaining why to a newbie is usually harder than to advice to use both.
Leo..

Can somebody please place the exact part need for this snubber ? I ma facing the same exact problem!! HEEELPPP