How to control a 24V external board (motor driver) with IRF520 (or any else)?

Hello!
i need help on a topic.

i have a motor Driver (3rd party) that works at 24v. it have 3 PIN of input for the start/speed (call it A B C & GND).
these pin wants 19-24V for the HIGH logic and 0V for the LOW logic.

With my Arudino 2560 i'm able to pilot 3 digital pin, and i bought some IRF520 module to connect each to A B C pins..

The problem is that i cannot find a way to connect IRF520 to A B and C pins so that each control only one pin.

as the GND is common to all 3 pins, when i try to turn-on the Pin A, also B and C will be ON (also without IRF520 of B and C are turned ON).

How to solve this?

should i change the mosfet?
should i connect it in a special way?

thanks

The IRF520 won't work with Arduino, use a logic level MOSFET or NPN bipolar transistor instead.

If you want advice that is actually useful, post a link to the motor controller data sheet, user guide or product page so that we can see the input requirements for ourselves.

Opto isolators are probably the way to go for this sort of level shifting. Pretty much everything industrial expects this anyway.

first, thanks for your reply!

jremington:
The IRF520 won't work with Arduino, use a logic level MOSFET or NPN bipolar transistor instead.

Really? i'm using it to power an electrovalve and a buzzer with 12V. (the buzzer is working fine, the electrovalve is still not connected)
Why you say it wont work with arduino?

jremington:
If you want advice that is actually useful, post a link to the motor controller data sheet, user guide or product page so that we can see the input requirements for ourselves.

this is the datasheet of the driver

https://www.interroll.it/en/products/drives-and-controls/controls/drivecontrol-2048/

https://www.interroll.it/fileadmin/user_upload/Downloads__PDF_/Drives___Controls/DC_Platform/Controls_Catalog_PDF/DriveControl2048_EN.pdf

could you tell me any specific "logic level MOSFET or NPN bipolar transistor" to use?
it would be better if i could easy find packaged in a module so i can avoid to buy additional resistors, diodes, etc to attach to it...

MarkT:
Opto isolators are probably the way to go for this sort of level shifting. Pretty much everything industrial expects this anyway.

thanks mark. could you advise any specific model?
PC 817 ? it's sold on amazon in a module of 4. i read it can have in input and in output 3,6V-24V

The IRF520 while not a logic level MOSFET does have a low threshold voltage The IRF520 is a Power Mosfet with 9.2A collector current and 100V breakdown voltage. The mosfet has a low gate threshold voltage of 4V and hence commonly used with microcontrollers like Arduino for switching high current loads. I believe while the IRF520 will work with 5 volts on the gate there are better choices. The IRL540N comes to mind as well as the FQP30N06L as far as actual logic level N channel mosfets. So it's more a matter of suggesting a better choice than it won't work. The IRF520 will work, it's just not the best choice using a 5.0 volt logic signal to the gate. This is why I also would not suggest it initially either, there are more suited choices in my opinion.

Ron

Agreed, "won't work" was overstating the problem a bit.

However, the IRF520 is a very poor choice to use with Arduino, because it is not guaranteed to be fully switched on at 5V on the gate. The threshold gate voltage (Vgs(th)) range is 2.0-4.0, which means that some examples will be just barely switched on at gate voltage 4.0V, and that will waste energy, causing the transistor to overheat and possibly fail completely under large load currents.

In general, avoid using non-logic-level MOSFETs with Arduino.

Ron_Blain:
The IRF520 while not a logic level MOSFET does have a low threshold voltage The IRF520 is a Power Mosfet with 9.2A collector current and 100V breakdown voltage. The mosfet has a low gate threshold voltage of 4V and hence commonly used with microcontrollers like Arduino for switching high current loads. I believe while the IRF520 will work with 5 volts on the gate there are better choices. The IRL540N comes to mind as well as the FQP30N06L as far as actual logic level N channel mosfets. So it’s more a matter of suggesting a better choice than it won’t work. The IRF520 will work, it’s just not the best choice using a 5.0 volt logic signal to the gate. This is why I also would not suggest it initially either, there are more suited choices in my opinion.

Ron

Thanks Ron, so you are saying my N-channel mosfet would work anyway in my case, right?

could you tell me how to connect it (or any other like IRL540N )?

actually my connection (that do not work) is:

arduino pin PL0 → IRF-gate
IRF-collector → +24V → Driver-PIN-A
IRF-drain → GND (also common to Driver)

Same for arduino pins PL1 and PL2 with Pin B and C

When PL0 is ON, all Pin A B C get +24V

(see attached schema)

so i tought i need a P-Channel, or to connect the N-channel in a way i dont know…

any help appreciated.

thanks

jremington What is a good logic-level mosfet.
Anyway current will be very low (some mA). i’m just setting digital pins of the driver, i’m not sending current to the motor.

Post #4 recommended two logic level MOSFETs.

IRF-collector -> +24V -> Driver-PIN-A

Your circuit is lacking a load or pullup resistor, and you need two gate resistors. A typical circuit is shown below. A HIGH on the Arduino output will drive Out_A LOW.
nmos.png

nmos.png

jremington:
Post #4 recommended two logic level MOSFETs.Your circuit is lacking a load or pullup resistor, and you need two gate resistors. A typical circuit is shown below. A HIGH on the Arduino output will drive Out_A LOW.
nmos.png

great! thanks much! except for the resistors this is how i intended to connect...
but the problem is that having 3 repetitions of your schema, when i turn ON the PIN A, also B and C get turned ON. i suppose this is because (not too obviously for me) the GND of the drivers is common to all PINS, so when NMOS of PinA conduct, the same GND conduct for Pin B and C ...

i'm sorry, really don't know if you can understand me... it's difficoult to explain for a non-professional like me.

except for the resistors

All three resistors are required.

Sorry, your explanation makes no sense. The grounds all have to be connected for that circuit to work, and for 3x the above, you will need 9 resistors and 3 MOSFETs. The A,B,C driver inputs will all be independently controlled.

If you don't want to connect the grounds of the Arduino and the motor driver/motor power supply, you MUST use three optoisolators, as MarkT suggested above.

jremington:
All three resistors are required.

Sorry, your explanation makes no sense. The grounds all have to be connected for that circuit to work, and the A,B,C driver inputs will all be independently controlled.

If you don’t want to connect the grounds of the Arduino and the motor driver/motor power supply, you MUST use three optoisolators, as MarkT suggested above.

Ok, i’m very sorry for the confusion.

first, i’m using the module in the pic attached (i think resistors alre already setup on the module)

second, i want to connect all GND in common, and is for this that pin-a and pin-b get ON at same time.

from the CABLE of the drivers i have 4 WIRES. A B C and GND, so for each PIN the GND is common. (i linked this GND to Arduino-GND)

see the attached pic. as the 24V are EVER connected and conducting to PinA and PinB, when the NMOS on top conducts, the GND is conducting also for PinB …(because GND are common).

i tried putting some LED on PinA and PinB, and when i fire Gate on ONE NMOS, both led have light…

i’m just wondering if the problem is that i should add ADDITIVE resistors OUT of the module as you shown.

"Thanks Ron, so you are saying my N-channel mosfet would work anyway in my case, right?"

No, I am telling you it's a poor choice. I made a few suggestions such as the IRL540 or the FQP30N06. Considering the better suited MOSFET cost about $1.00 USD I would suggest either which I mentioned.

jremington gave you a real nice drawing to work from. I would go that route.

Ron

The picture of the MOSFET module is completely useless. Please post a link to the module product page or data sheet.

jremington:
The picture of the MOSFET module is completely useless. Please post a link to the module product page or data sheet.

ok, i’ tought it was a famous module… searching “irf arduino” on google: half results and pictures have this module

see attached image. (sorry i don’t know how to show the picture in the text directly)


The module design is terrible, why should it be "famous"? It lacks the two most important resistors, R1 and R2 shown in the circuit diagram I posted. I recommend throwing those in the trash bin and buying optocouplers.

R2 in the circuit I posted is required to limit the gate current and if it is missing, you will eventually damage the Arduino, by drawing too much current from the port pin (charging and discharging the gate capacitance).

Read this application note. Get familiar with MOSFETs and how they work. When considering a switching device learn how to make a well informed decision. Everything we see on the internet is not fact and every module fresh off the boat is not a solution. You don't learn to swim in the deep end of the pool.

Ron

Hi, thanks for all your replies. Your are right, i'll read more about mosfet choice.

anyway i think i choosen the wrong post title or maybe i miswrite the question.

i know the mosfet IRF520 may not be the best choice in terms of quality etc.

but i think my problem actually is not on the best mosfet to choice, but a problem of wiring circuit.

I think it is a circuit problem that is not strictly related to a specific mosfet but a problem of circuitry.

Let's suppose for a moment that we have ideal digital n-mosfet and that we could imagine those as little remote digital interruptor.

i have to leave the +24V signal pass into 3 wires, A B C, that have a common GND (cable of 4 wires). max wire consumption is 10mA for each.

(ignore for a moment missing resistor that could damage arduino, i say let's ignore for a moment the arduino existance).

I'm trying to connect this 3 wires to the 3 IRF520 modules as for my previous schema of the module.

I'm connecting:
+24V to VIN of each module
A-B-C to V+ of each module
GND of the 4-wires-CABLE to V- of each module

and indipendent +5V signal to each SIG pin of each module
GND to GND-pin near SIG of each module

What it happens now (tested on circuit with LEDs): [*** THIS IS MY PROBLEM ***]
when i activate +5V Signal to module of PIN A, also B and C have a +24V between V+ and V- .

I want to pilot each signal indipendently from the other.

WHY this happens? (i think) it's because A B C are directly connected to +24V (see the V+ of the module) and when N-Mosfet of Module-A conducts, it is giving the pass to GND for all other Modules (because the GND of 4-wires cable is common to all A B C).

So this is a WIRING/Schema/Circuit problem that i would have also with normal switch push-buttons. is not related to specific mosfet.

What i'm asking to you?
Is there a way to connect the module (or any optimum n-MOSFET) in a way that i could control each PIN indipendently?

To put SIMPLIER and to not disguise who want to try help me,
here is what i want to obtain.
Tha AIM is replace P1 P2 and P3 with a N-MOSFET activated by indipendent signal of +5V


Hope the problem is much clearer now and that someone could help me.

Anyway thanks for your appreciated suggestions and resources on MOSFET world.

jremington:
Post #4 recommended two logic level MOSFETs.Your circuit is lacking a load or pullup resistor, and you need two gate resistors. A typical circuit is shown below. A HIGH on the Arduino output will drive Out_A LOW.
nmos.png

I'm sorry. I didn't read this well ehough.
This wont work for my project because i need a positive logic. I need " A HIGH on the Arduino output will drive Out_A HIGH (not LOW)." because elseway when Arduino start Out_A will be HIGH by default and the motor will start for a moment til arduino output a LOW...

Go back and look at Jremington's Post #7 drawing. You are using an N channel mosfet. You want low side switching meaning you switch the - (negative) side of each load to ground. Make it like the drawing in post #7.

Ron

Ron_Blain:
Go back and look at Jremington's Post #7 drawing. You are using an N channel mosfet. You want low side switching meaning you switch the - (negative) side of each load to ground. Make it like the drawing in post #7.

Ron

Ron i really thank you for your attempt to help me, but it seems i cannot explain well the problem or you are not reading my request.

you say "You want low side switching" but this is not what i want.

I need to send +24V signals on ABC pins of external driver ONLY WHEN Arduino set that ports to HIGH - not anything similar. From what you are saying I'm supposing a N-mosfet is not what i should use for this... maybe i should use a P-mosfet? then just advice it me and maybe write a model number so i can study/buy it.

I already tested the Jremington's Post #7 drawing (except for R1 and R2) and as you can read in my post #16 it is not working as expected as giving HIGH on ONE only GATE of the 3 mosfet, all ABC output go HIGH.

I'm wondering if an optoisolator like PC817 (i have a board with 4 of it mounted on) could solve my problems. it seems the PC817 may support 3-24V both on input and output... for 10mA it could be the best solutions.
What you think about it?