Electronic – use a MOSFET switching circuit to trigger a digital input (that reads +24 V as high) with an Arduino Mega 2560 R3

digital-logicmosfetswitching

Its my first time posting.

I need to trigger a digital input pin on an industrial KUKA robot with an arduino. The pin reads +24 V as high. I'm using the circuit below. It consists of an IRL520 N-channel MOSFET and a 1K resistor. I'm using an Arduino Mega 2560 R3, however I'm aware the arduino digital pins output max 40 mA and +5 V. So my idea was to use the +24 V power supply (located in the electrical cabinet of the KUKA robot controller) and connect that to the drain of the MOSFET, then use my arduino's 0-5 V digital signal (from pin D11) to "switch" the MOSFET on/off and, subsequently, "switch" the digital input on/off on the robots IO module. So technically, I'm using the robots own power to trigger its own input. My questions are: 1. Is this a viable way to do it? 2. Is the resistor necessary to draw the current towards the pin? 3. Besides a relay is there any other way to do it with a MOSFET, specifically?
Thanks enter image description here

Best Answer

  1. Is this a viable way to do it?

Yes. The KUKA digital input is, most likely, an opto-isolate type so it will require about 5 to 10 mA to drive the opto-LED. Your R1, 1k resistor will drop 5 to 10 V when powering the input so check the KUKA input specifications for that. When Q1 is on R1 will dissipate P = I^2R so check that you've got a comfortable resistor rating for that.

Note that the logic is inverted with this configuration. GPIO on = KUKA input off.

  1. Is the resistor necessary to draw the current towards the pin?

The KUKA input requires current to operate. R1 provides it. (The input draws current from the supply via R1. The resistor doesn't "draw current".)

  1. Besides a relay is there any other way to do it with a MOSFET, specifically?

Yes.

  1. Use a high-side switch. That will get rid of R1 and give full 24 V to the KUKA input.
  2. Use an opto-isolator but then there is no need for the MOSFET.

KUKA robots are expensive. KUKA robots are industrial. The right way to do this is use an industrial opto-isolator between your microcontroller and the robot. This keeps the supplies isolated and makes it very unlikely that one will damage the other.

enter image description here

Photo 1. A selection of DIN rail opto-isolators.

You'll be looking for one with 5 V input. The outputs are usually transistors and, since they are floating, can be used for PNP or NPN inputs. These are also DIN rail mounting which will suit most control panels.

Using a cheap microcontroller to control an expensive robot seems a bit strange. Using a PLC would give a more robust and industrially hardened solution with the benefit that it would have much longer term support than your microcontroller code.