motor mosfet burning out?

hey guys so working on my first project with arduino, what it is.... its a arduino controlled mosfet motor, this is for another hobby of mine, what it dose, if Switch one is pressed than turn motor x amount, and the if switch two is pressed then turn motor x amount, but controlled with a mosfet, i have everything working, but the mosfet keeps burning.. what is wrong with my schematic ? im using a : IRL540PBF N, Mosfet with not in the pic, i have 11.1v going into a buck converter for the arduino, then motor + goes right to 11.1V +

and sorry for the layout im not good at electronics yet haha

Let’s see your actual wiring.

What does “burning” mean? Getting hot or destroyed.

Let’s see your sketch.

You need to use circuit C1 as seen in the image below.

getting destroyed, i did wire it up exactly how you showed me in my other post and it was burning the 1N4007, diode, would it be better if i used a 1N5817?

Hi,
Can you please post a picture of your project so we can see your component layout?
What size is the motor?
What is your power supply for the motor?

Can you draw a proper labeled circuit diagram including the power supply?
A picture of your drawing will be fine and more informative than the Fritzy image you have posted.

Thanks… Tom… :slight_smile:

Can you post the Schematic of your project so that we can better guide you?

iv tired to make it more readable XD i doubt it... but the battery in is 11.1v lipo, going to a buck converter to go from 11.1 to 5v for the arduino, i had to use a "RBG LED" just for a place holder as there was none in tinkercad. but in my image the rbg led is a buck converter.

and for the pic of the actual thing.... its done via wires no breadboard, so it looks messy lol and the code im using is this, but like i said it all works fine, just that the mosfet was burning out, as in it time to go in the bin, dead.

int DWELL = 20; // how long to open MOSFET ms
int RATE = 30; // how long to wait after closing MOSFET ms
int MOSFET = 2; // MOSFET control pin
int SEMI = A4; // semi auto switch pin
int FULLAUTO = A5; // full auto switch pin
int SEMISTATE = LOW; // start state of semi switch
int SEMISTATUS = LOW; // current state of semi switch

void setup()
{
  pinMode( MOSFET, OUTPUT ); // MOSFET
  pinMode( SEMI, INPUT_PULLUP ); // Semi Auto
  pinMode( FULLAUTO, INPUT_PULLUP ); // Full Auto

}

void loop()
{

  SEMISTATE = digitalRead( SEMI ); // read current status of semi switch
  
  if( SEMISTATUS != SEMISTATE ) // not the same as last / start status (must be LOW)
  {

    if( SEMISTATE == LOW ) { // switch is closed

      semiAuto(); // fire semi auto shot

    }

    delay( 50 ); // wait to prevent the switch bouncing

    SEMISTATUS = SEMISTATE; // set current state to current trigger state

  }
  

  if( digitalRead( FULLAUTO ) == LOW ) // full auto switch is closed
  {
digitalWrite(LED_BUILTIN, HIGH); 
    fullAuto(); // fire full auto

  }
  
}

void semiAuto()
{

  digitalWrite( MOSFET, HIGH ); // open MOSFET

  delay( DWELL ); // wait to clear barrel

  digitalWrite( MOSFET, LOW ); // close MOSFET
  
}

void fullAuto()
{
digitalWrite(LED_BUILTIN, HIGH); 
  digitalWrite( MOSFET, HIGH ); // open MOSFET

  delay( DWELL ); // wait to clear barrel

  digitalWrite( MOSFET, LOW ); // close MOSFET

  delay( RATE ); // wait for next shot

  if( digitalRead( FULLAUTO ) == LOW ) // if trigger is still pulled
  {

    fullAuto(); // call function again

  }

}

Hi,
You have 5V from the DC to DC converter going to Vin.
The 5V from the DC to DC converter should be to the 5V pin.

Vin has to be 7V or higher to provide the internal 5V reg supply.

Tom... :slight_smile:

Please confirm your DCtoDC converter output is 5V.

Volanaro:
getting destroyed, i did wire it up exactly how you showed me in my other post and it was burning the 1N4007, diode, would it be better if i used a 1N5817?

Show us in this thread please, a thread should be self-contained. I suspect you wired the diode wrongly.

Hi,
Can you post a picture of your project so we can see your component layout?
Do you have the cathode, the end with the white ring, of the diode connected to the POSITIVE terminal of the motor and the other end connected to the NEGATIVE terminal of the motor?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Simple solution, try a avalanche rated logic level mosfet. That eliminates the free wheeling diode. I expect it will work after the ground problems are fixed and the motor is not powered from the arduino 5 volt system.
Good Luck & Have Fun!
Gil