Seba999:
I'm controlling with 2 MOSFET my 24V source to power 2 motors as you can see attached.
Must learn to crawl before learning to walk. Start with 1 motor to begin with, instead of 2. And show us which tutorial site taught you to wire the motors up in this particular way..... with no diodes. Also, never assume that the readers here are clairvoyant..... so when you mention 'bug', you must describe what you see.
So I must add diodes between the input and output of the motor ? For each motor ?
How could this possibly make my arduino buggy ? I mean all the wires involved in the motors actions are configured as output by pinMode ( so they shouldn't interfer with my code no ? ^^ )
And which diode should I use ? All of them should work ? Does LED may do the tricks ? ( with pros and cons ? )
If I remember well Rgs = 100 Ohms ... Or maybe 1K Ohms ? ( I should verify )
Adding a diode should do the trick to stop the flow back current ? And thus avoid the undesired behaviour ?
As far as I know a LED is light-emitting DIODE so they would do the trick ? ... I ask this because I don't have any diode from now on ^^ ( even if it shouldn't be the most expensive thing to buy )
The reason is that LED diodes are not designed to withstand much reverse voltage. Many are rated at 10 V
MAXIMUM. In your circuit you will be exposing the diode to 24V each time the motor is on.
So I must add diodes between the input and output of the motor ? For each motor ?
Always for every motor, relay, solenoid, anything inductive. Cathode to positive supply.
How could this possibly make my arduino buggy ?
Because of the high voltage spikes flying about if you don't use them - can cause substantial
interference to low voltage signals.
The diode just needs to handle the voltage of the supply, and be pulse current rated for the current
through the load. Any diode type will work, its not critical, unless using fast PWM.
Seba999:
If I remember well Rgs = 100 Ohms ... Or maybe 1K Ohms ? ( I should verify )
Change Rgs to 10K, 100R is too low, you only want to make sure the gate is at source potential if the gate circuit is open circuit.
100R will be drawing excessive current from the controller, 5 / 100 = 50mA, the outputs are only rated to 40mA.
Also fit the 220R resistor in series with the gate.
Thanks.. Tom....
MarkT:
Always for every motor, relay, solenoid, anything inductive.
Why thoses diodes aren't included in the motor itself ? I mean if this is mandatory why it's not soldered inside it already ? O.o
TomGeorge:
100R will be drawing excessive current from the controller, 5 / 100 = 50mA
Considering your calculation if I have 1KOhms Resistor it would fit ? isn't it ?
I just looked back to my circuit (already soldered of course) and ... I must have been drunk while doing it 'cause I have 1KOhms AND 10KOhms resistors !! God damn it !
Does it changes something to have some with 1K and others with 10K ?
In a DC circuit, where the polarity driving the inductive load does not change:
“Always for every motor, relay, solenoid, anything inductive. Cathode to positive supply.”
The inductance of the wires from the switch to the motor may be significant. The diode must be close to the switch so that current can continue to flow around the wires when the switch (transistor Q1 in this diagram) switches.
This would be very rare so it is not usually a problem to solder the diode directly to the back of the motor, once you've worked out which polarity spins it the direction you want.