I am using Arduino Mega 2560 to control 16 solenoid valves by ON/OFF 16 relays.
The VI operate very well on my laptops (Samsung I5-7200U and Acer I3-2330M) but unstable on PCs (Core duo). After a few iterations, time-out error (1073807339) has appeared. I tried using both LIFA and LINX, but this error still occurs.
That problem does not occur when I disconnected loads (solenoid valves) to the circuit.
I attached the VI.
Solved! Go to Solution.
Are the solenoids DC powered? If so do they have built in snubbers or diodes to quench the back EMF voltage spike when they are turned off? I mention this because you state it works fine when the solenoids are disconnected. Also wonder if you have a ground loop since the laptop (floating from AC mains) works but the PC's do not. May be a shot in the dark but worth mentioning.
Can you supply make/model of solenoids and a sketch of how things are wired up?
Hi. Thank you for your fast reply.
My solenoids use 24 VDC power. Model: SMC 10-VQ1200Y-5.
I uploaded the circuit diagram.
The LV application works well without the solenoid attached, so there is no problem with the code.
You have to narrow down to the electrical circuit and HW connection problem.
It seems that this post is similar to your problem.
I'd try putting some reverse biased diodes (ie 1N4004) across each of the solenoid coils first.
Not sure of the spec's on your relays, they may need some also.
The problem has been solved by adding a ceramic capacitor to each relay.
Relay module has built-in capacitors, diodes, and optoisolators. But it seems that is not enough.
When the load is connected to the circuit, the arc generates at the contact each time the relay is turned on / off.
Then Arduino is reset, leading to a disconnection from the computer.
The laptop's USB port seems to filter noise better than PC.
I'm not sure about these things but my system has been working well anyway.
Thank you very much for your help.
Good detective work, I did not even consider contact arcing. Alternative is to use Solid state Relays for the solenoids.