Arduino analog input causing problems

I am using an Arduino to control the torch height on my home build CNC plasma table. The Arduino receives 1/50th of the raw voltage of the plasma cutter though the analog pins and adjusts the Z-Axis based on that value. The plasma cutter is running on 240v so the max voltage going to the Arduino would be 4.8v. The problem is that whenever the plasma cutter is sending power to the Arduino, everything goes haywire. Sometimes the Z-Axis just homes itself over and over again which tells me that the setup method in the code is running over and over again. Other times the Arduino will send out false high and low signals through the digital pins that control other parts of the CNC machine. If I unplug the wires for the plasma cutters raw voltage and run at a fixed torch height, everything works fine. Also when the plasma cutter is running and sending power to the Arduino, the Arduino will stay on even if all other power sources are unplugged from it. How can I fix this issue?

AC I think. AC goes both positive and negative, and negative voltages might/will destroy the controller.
We need schematics. Hopeless to give reliable replies based on Your words,

I would guess that a plasma cutter generates a ton of EMI, plus a lot of noise on the power line.

Digital electronics are highly immune to electrical noise, but analog can be sensitive to it, especially with high impedances.

If you rectify & filter the AC to DC you should be able to smooth the voltage with a capacitor filter. (With a rectifier diode, you need a high-resistance to ground on the analog input to keep it from floating.)

You probably also need a "good" (well filtered & regulated) power supply for the Arduino. Since Vcc is the default analog reference, any variations in the power supply show-up as variations in the analog reading.

Besides the negative voltage issue... 240VAC is 240V RMS which has positive and negative peaks of 336V.

The plasma cutter converts the AC voltage to DC so the Arduino is only receiving DC voltage. I tested the voltage while it was cutting and the plasma cutter was only putting out about 1.7 volts to the Arduino. I tried grounding the Arduino to the plasma cutter but that did not seem to help. I don't think EMI is a big factor in the problem because I have another Arduino running right next to it and that one isn't being effected. I don't have a wiring diagram for everything but here is what how the plasma cutter is hooked up. I also included a screenshot of the manual.
ArduinoWiring

@DVDdoug is quite correct you are drowning in a mass of RFI.

You are not the first person to have such problems, we see quite a few of these. Unfortunately I have never seen one with a successful conclusion. I think because this is a very difficult thing to cure, it requires knowledge of wiring technique beyond that of a normal normal hobbyists and there is no guaranteed cure. All cases are different.

You need a mixture of good layout skills as well as suppression of the emissions caused by the plasma cutter and RFI protection of the Arduino

Sorry not too helpful but that is the situation.

I think you might have got the polarity of the "1/50 Divided Arc Voltage" signal wrong.

Pin 6 says (+), so that implies that pin 4 is going negative.

image

Do you have a multimeter that you can use to check the polarity of the "1/50 Divided Arc Voltage" ?

I found pin 4 to be possitive and 6 to be negative when I tested with a multimeter. Pin 3 in that diagram also has a "+" but is a ground pin.

I am using an Arduino for torch height control on my CNC plasma cutter. The plasma cutter sends out 1/50th(0v - 4.8v) raw voltage and converts it to DC. The problem I am having is that the Arduino does not seem to like having another power source being sent into it and starts to continuously restart itself. My thought to fix the problem is to use something like a relay but instead of just on and off, have the relay provide a certain amount of resistance based on the input voltage. For example, if the plasma cutter sends out 1v, the relay would have 1000 ohms of resistance. If the plasma cutter puts out 2v, the relay would have 2000 ohms of resistance. The Arduino would then send 5v to one side of the relay and read the voltage coming out the other side and be able to calculate the plasma cutter voltage based on that. This would separate the Arduino from the plasma and hopefully eliminate my problem. I have done some google searching and have not been able to find anything that would work. The closed thing I have found has been a digital potentiometer but I'm not sure what I am really looking for. Does anyone have any suggestions on what I could use?

EMI is killing you. Shield everthing. Put the Arduino & all low voltage parts in shielded, grounded, metal box. Use metal housing lamps & switches. Shileded cables. Solid external power supply with .1uF on every device an 470uF or bigger for the board.
Ferrite beads on all leads in & out of case.
EMI filtered powersupply with high noise rejection.
Cross your fingers & hold your tongue like this: :crazy_face:
Use a step fown with heavy filtering to try and both isolate and filter the plasma signal.
Does not the plasma power supply have a current/ voltage monitor output?

The plasma cutter is meant to be used for CNC so it does have a voltage monitor output and that is what I am using. I don't think EMI is the root cause of this problem since the Arduino only has issues when the voltage monitoring wires are hooked up. If I unplug the voltage monitoring wires and run the torch at a constant height, everything works great. I am only having issues when sending another power source into the Arduino.

Maybe this is a grounding or ground loop issue. In general, you need to post a lot more technical details in order for people here to help effectively.

The relay idea is a non-starter. Forget about that.

In order to fix the problem, you need to understand the problem. Multiply that by 10 or 100 for someone that hasn't seen your device or environment.

"the Arduino only has issues when the voltage monitoring wires are hooked up."
Where do you think the EMI is coming from? Are you using shielded wire?
What is this "other" power source? You should only be hooking up a pair of signal wires, no?
Got a hand drawing of how everything is supposed to be wired, please?

I have something that I think could work. I taped a 5v laser to a photo resistor. The plasma cutter will power the laser with its voltage monitoring wires which will vary the brightness of the laser. The Arduino will send 5v to the photo resistor and measure the voltage coming out. The brightness of the laser will change the resistance of the photo resistor therefore varying the output voltage. I haven't tried it on the CNC yet but it worked with another Arduino. This idea will isolate the Arduino from the plasma cutter and eliminate any issues unless EMI travels through light. I was really hoping someone knew of a module that did the same thing but was more professional and permanent.

Hi, @trevor7045

Can you please post some images of your project?
So we can see your component layout.

Can you please post your code?

Can you please post a schematic of your project?
Have you got bypass capacitors on all the inputs you use and the supply to the 5V controller?

That is when the voltage wires are close to and connected to the EMI source.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

An optocoupler - it's an LED (on one end) that illuminates a photocell (on the other end).

VTL5C3 Vactrol / Optocoupler (synthrotek.com)

Is your arduino earth connected to your CNC earth?
As others have said diagrams really help, otherwise we are just guessing.
G

Where do you get the Voltage (that you want to read) that is fed into the Arduino is this AC or DC ?

@trevor7045,

Your two or more topics on the same or similar subject have been merged.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

Lasers don't work like LEDs, they are not variable. At least, if you want them to last very long.

PWM integrated.