I have already mentioned, the sensor wires are shielded.You may not have RFI as a problem .......
Other possibilities .........
When a big powerful 3-Phase-Motor Starts,
it puts out a massive magnetic Pulse from the heavy start-up Current Spike.
This is enough to temporarily turn any metallic-objects near by into temporary Magnets.
It may also cause Electrical Currents to temporarily flow in large heavy metal structures,
enough to actually cause arcing or galvanic corrosion weirdness.
Running your Sensor-Wiring in Metallic Conduit may be the solution.
.
.
.
Okay, got it."Shielded" is not the same as Shielded plus being run inside of a Steel, EMT-Electrical-Conduit-Pipe.
Not even comparable.
Some Industrial installations require EMT-Conduit for Low-Voltage-Controls,
even when the NEC-Code says it's "Class-II" Wiring, which can be run exposed.
.
.
.
Yes, I was also thinking on the same track.How long is the pulse you are expecting from the proximity sensor? And how long are the spurious pulses?
Is your opto-isolator near the sensor, or near the nano. The output of the opto is much more sensitive to interference than the input.The sensor is installed separately on the press, quite far from the console box containing the contactors.
The pedal is not connected to Nano.
I have mentioned earlier, the press operation is controlled separately by 3-Phase 400VAC supply.
The Nano just controls the Stepper Motor when the sensor gets ON.
In the present scenario, when the pedal activates the contactor to run the press, the opto coupler gets a false pulse when the pedal is pressed (when the contactor activates) and when the pedal is released (when the contactor deactives).
Interestingly, even if the sensor wires are removed from the circuit, still the opto coupler gets those false pulses.
One thing I have experienced with contactors is the coil is usually the culprit as the source of 'noise', if of the AC variety.One important thing, I have noticed is that the sparking contactor interferes only when the common wire of the push buttons is connected to the 5V line. When the wire is disconnected (buttons disabled) there is no disturbance.
First of all, welcome to AAC !!!The problem is most likely that you are not showing us your ground wiring. I suspect that the sensor "ground" and the Nano "ground" are actually quite far apart electrically and you are getting significant ground "bounce" in the sensor when the press actuates. You may need a well shielded ground running from the Nano to the optocoupler and you should disconnect the sensor ground from the optocoupler output. That way the press noise on the sensor ground will not get to the Nano. The shielding of the ground from the Nano is to protect it from picking inductive noise. Ground symbols are the worst thing ever invented there is no such thing as ground. It is just another power supply and so can have voltage fluctuations, pickup noise, and needs filtering / isolation too.
It near the Nano.Is your opto-isolator near the sensor, or near the nano. The output of the opto is much more sensitive to interference than the input.
Earth Ground is just a reference point and not intended to be a conductor.Ground symbols are the worst thing ever invented there is no such thing as ground. It is just another power supply and so can have voltage fluctuations, pickup noise, and needs filtering / isolation too.
That's the best place for it.It near the Nano.
10k will require about 500uA through the opto to get a signal at the other side that reads as a logic zero.What value of the pull-up resistor would be suitable at the output of the opto?
I would say there is some power common that is not referenced to earth GND.Next, just for the sake of learning, would someone help me understand:
i) Why the opto gets the false pulse, even when the sensor wires are disconnected?
ii) Why the opto gets the false pulse only if the common of the 2 push buttons are connected to 5V. I have tried removing the buttons from the press but nothing changed.
The issue has been resolved.The conclusions from the discussions so far are:
a) Add RC snubber across the contactor coil. (I will do it).
b) The sensor wires to be shielded, particularly in metallic conduit. I think the original wires connected with the sensor are not shielded. However, the additional length attached is shielded. (I will do it).
c) The 24V and 5V should have separate 0V line, though I was using a 24V SMPS and a buck converter to get 5V. (I will use a totally separate 24V SMPS only for opto. Should I enclose the new 24V supply in the same metallic cabinet?)
d) Connect an inverse diode across the opto's diode. (I will use a 1N4007).
e) Should I connect a 4.7K pull-up to the output of the sensor?
f) Should I connect a 4.7K pull-up to the output of the opto?
You have to be careful making that into a blanket statement,If using an Arduino or any microprocessor, there should always be snubbers across all AC inductive devices and Diode rectifier across any DC inductive devices.
Just for the sake of knowledge, how?there are many situations where Snubbers/Diodes can "slow-down" mechanical action