Need help with mosfet not sending power to heat pad

Hello, so first off, I am using a HC-06 Bluetooth module to control a light and a heat pad. I get the light to work but when it comes to the heat pad, it may be something wrong with my wiring or something but my mosfet kinda overheats and no power is being sent to the heat pad when i click the "ON" button on my application. Below you can see the wiring I used on thinker cad however this does not include the HC-06 Bluetooth module and heat pad. instead of the heat pad I am experimenting with a motor.

/*
Bio Innovation Project
Heat Pad Made For Tendinitis In the Knee
By: Amish  
*/

int led1 = 4; //green led is digital pin 4
int led2 = 5; //red led is digital pin 5
int fet = 3;  //mosfet is digital pin 3
const int HeatOn = 255; // heat pad turns on at 100%
const int Heat66 = 170; // heat pad turns on at 66%
const int HeatOff = 0; //heat pad turns off 
int val; //Create an integer variable
int OverTemp = 184; // Heat Pad is over recommended temp = 40 degress C

void setup()
{
  pinMode(fet, OUTPUT); //mosfet digital pin is OUTPUT
  pinMode(led1, OUTPUT);//led1 digital pin is OUTPUT
  pinMode(led2, OUTPUT);//led2 digital pin is OUTPUT
  Serial.begin(9600); //start serial
  digitalWrite(led2, HIGH); //turn the red led on
  analogWrite(fet, LOW);
}

void loop()
{
////////////////////// Showing Voltage and Celcius in Serial Monitor //////////////////////
val=analogRead(0);      //Read the analog port 0 and store the value in val
  delay(1000);            //Wait one second before we do it again
  
float voltage = val * 5.0 / 1024;  // converting val's reading to voltage

// print out the temperature
float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset
//to degrees ((volatge - 500mV) times 100)
Serial.print(temperatureC); Serial.println(" degress C");
delay(1000);
  
///////////////////// Bluetooth Wireless /////////////////////
int blthState = Serial.read(); // Reads the data from the serial port

/////////////// 100% HEAT //////////////
 if (blthState == '0') {
  digitalWrite(led1, LOW);// Turn LED OFF
  digitalWrite(led2, HIGH); // Turn LED ON
  analogWrite(fet, LOW); //Turn Heat Pad Off
  Serial.println("Heat Pad: OFF"); 
  blthState = 0; //change blthState back to 0
 }
 else if (blthState == '1') {
  digitalWrite(led1, HIGH);//Turn LED ON
  digitalWrite(led2, LOW); //Turn LED OFF
  analogWrite(fet,HIGH); //turn Heat Pad On
  Serial.println("Heat Pad: ON");
  blthState = 0; //turn blthState back to 0

}
////////////// 66% HEAT /////////////
 if (blthState == '2') {
  digitalWrite(led1, LOW);// Turn LED OFF
  digitalWrite(led2, HIGH); // Turn LED ON
  analogWrite(fet, HeatOff); //Turn Heat Pad Off
  Serial.println("Heat Pad: OFF"); 
  blthState = 0; //change blthState back to 0
 }
 else if (blthState == '3') {
  digitalWrite(led1, HIGH);//Turn LED ON
  digitalWrite(led2, LOW); //Turn LED OFF
  analogWrite(fet,Heat66); //turn Heat Pad On
  Serial.println("Heat Pad: ON at 66%");
  blthState = 0; //turn blthState back to 0

}
//////////////////// Saftey System /////////////////////
  if (val >= OverTemp) { //if temperature is over 40 degrees Ceclius
  digitalWrite(led1,LOW);
  digitalWrite(led2,HIGH);
  analogWrite(fet,HeatOff); //turn heatpad off
    Serial.println("Heat Pad: OVERHEATING"); 
    delay(1000); //delay for 1 second
    blthState= 0;
  }
  else {
    analogWrite(fet,HeatOn); //if temperature is under 50 degrees, then keep heatpad on
    delay(1000); //delay for 1 second
  }

}

Hello, so first off, I am using a HC-06 Bluetooth module to control a light and a heat pad. I get the light to work but when it comes to the heat pad, it may be something wrong with my wiring or something but my mosfet kinda overheats and no power is being sent to the heat pad when i click the "ON" button on my application. Below you can see the wiring I used on thinker cad however this does not include the HC-06 Bluetooth module and heat pad. instead of the heat pad I am experimenting with a motor.

/*
Bio Innovation Project
Heat Pad Made For Tendinitis In the Knee
By: Amish  
*/

int led1 = 4; //green led is digital pin 4
int led2 = 5; //red led is digital pin 5
int fet = 3;  //mosfet is digital pin 3
const int HeatOn = 255; // heat pad turns on at 100%
const int Heat66 = 170; // heat pad turns on at 66%
const int HeatOff = 0; //heat pad turns off 
int val; //Create an integer variable
int OverTemp = 184; // Heat Pad is over recommended temp = 40 degress C

void setup()
{
  pinMode(fet, OUTPUT); //mosfet digital pin is OUTPUT
  pinMode(led1, OUTPUT);//led1 digital pin is OUTPUT
  pinMode(led2, OUTPUT);//led2 digital pin is OUTPUT
  Serial.begin(9600); //start serial
  digitalWrite(led2, HIGH); //turn the red led on
  analogWrite(fet, LOW);
}

void loop()
{
////////////////////// Showing Voltage and Celcius in Serial Monitor //////////////////////
val=analogRead(0);      //Read the analog port 0 and store the value in val
  delay(1000);            //Wait one second before we do it again
  
float voltage = val * 5.0 / 1024;  // converting val's reading to voltage

// print out the temperature
float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset
//to degrees ((volatge - 500mV) times 100)
Serial.print(temperatureC); Serial.println(" degress C");
delay(1000);
  
///////////////////// Bluetooth Wireless /////////////////////
int blthState = Serial.read(); // Reads the data from the serial port

/////////////// 100% HEAT //////////////
 if (blthState == '0') {
  digitalWrite(led1, LOW);// Turn LED OFF
  digitalWrite(led2, HIGH); // Turn LED ON
  analogWrite(fet, LOW); //Turn Heat Pad Off
  Serial.println("Heat Pad: OFF"); 
  blthState = 0; //change blthState back to 0
 }
 else if (blthState == '1') {
  digitalWrite(led1, HIGH);//Turn LED ON
  digitalWrite(led2, LOW); //Turn LED OFF
  analogWrite(fet,HIGH); //turn Heat Pad On
  Serial.println("Heat Pad: ON");
  blthState = 0; //turn blthState back to 0

}
////////////// 66% HEAT /////////////
 if (blthState == '2') {
  digitalWrite(led1, LOW);// Turn LED OFF
  digitalWrite(led2, HIGH); // Turn LED ON
  analogWrite(fet, HeatOff); //Turn Heat Pad Off
  Serial.println("Heat Pad: OFF"); 
  blthState = 0; //change blthState back to 0
 }
 else if (blthState == '3') {
  digitalWrite(led1, HIGH);//Turn LED ON
  digitalWrite(led2, LOW); //Turn LED OFF
  analogWrite(fet,Heat66); //turn Heat Pad On
  Serial.println("Heat Pad: ON at 66%");
  blthState = 0; //turn blthState back to 0

}
//////////////////// Saftey System /////////////////////
  if (val >= OverTemp) { //if temperature is over 40 degrees Ceclius
  digitalWrite(led1,LOW);
  digitalWrite(led2,HIGH);
  analogWrite(fet,HeatOff); //turn heatpad off
    Serial.println("Heat Pad: OVERHEATING"); 
    delay(1000); //delay for 1 second
    blthState= 0;
  }
  else {
    analogWrite(fet,HeatOn); //if temperature is under 50 degrees, then keep heatpad on
    delay(1000); //delay for 1 second
  }

}

Put LED on gate - what happens ?
Replace motor by 500 ohm resistor or small light bulb

What mosfet are you using? What is the power requirements of the motor/ heat pad?

tinman13kup:
What mosfet are you using? What is the power requirements of the motor/ heat pad?

he heat pad takes 5VDC, and I am using a N channel mosfet IRF520

ted:
Put LED on gate - what happens ?
Replace motor by 500 ohm resistor or small light bulb

I used the blinking experiment along with the mosfet and a led and it seemed to work which makes me wonder that its my code

I how much current does the heat pad take ? is your power supply big enough?

The IRF520 is NOT a logic level MOSFET - ie the 5v from an arduino is not high enough to turn it properly 'on'

Try eg a FQP30N06L or a IRFL44Z...

Allan

allanhurst:
I how much current does the heat pad take ? is your power supply big enough?

The IRF520 is NOT a logic level MOSFET - ie the 5v from an arduino is not high enough to turn it properly 'on'.

Enough to drive a little LED, but probably not your heatpad.

Try eg a FQP30N06L or a IRFL44Z...

Allan

allanhurst:
I how much current does the heat pad take ? is your power supply big enough?

The IRF520 is NOT a logic level MOSFET - ie the 5v from an arduino is not high enough to turn it properly 'on'

Try eg a FQP30N06L or a IRFL44Z...

Allan

I will definitely try that! thanks! it may also be because I am also trying to power more things aswell. If i were to connect a 9v battery to the arduino, do you think that would work? im trying to make this into a prototype for a innovation I have at school so I am trying to make this as simple as I can and as light as it can be

AmishP:
I used the blinking experiment along with the mosfet and a led and it seemed to work which makes me wonder that its my code

Did you put the LED on the gate ?

ted:
Did you put the LED on the gate ?

yes, I connected it like I did for the motor, It started to blink

Measure 5V when the MOSFET is hot. it is still 5V ?
Also measure the voltage on drain.

ted:
Measure 5V when the MOSFET is hot. it is still 5V ?
Also measure the voltage on drain.

would I have to use a multi meter for that? if so, I wont be able to do it right now and will have to do it at school tomorrow

What kind of motor you have - picture/ link
Your program is ok, ist turning on the mosfet ......
Put the wire from pin 3 to ground then to 5V

AmishP:
at school tomorrow

Measure resistance of the pad and motor.

Don’t cross post!

http://forum.arduino.cc/index.php?topic=547480.0

AmishP:
If i were to connect a 9v battery to the arduino, do you think that would work?

For a while, until it's empty - those common 9V block batteries have low capacity. But the MOSFET is not going to work better as the signal is still 5V thanks to the Arduino's voltage regulator. You need a logic level MOSFET.

Oh, and don't try to power your 5V heat pad off the 5V Arduino output. It can't supply the current. A small 9V battery also won't be able to power a heat pad, ever. Just get a 5V adapter, old mobile phone charger will do, with current rating well above what the heat pad requires.

allanhurst:
The IRF520 is NOT a logic level MOSFET - ie the 5v from an arduino is not high enough to turn it properly 'on'

And a FET turned partly ON gets hot. They're only high efficiency when fully ON or OFF.

IRLZ44N FETs were relatively cheap last year, shop a bit.

On Youtube there is a content channel run by AddOhms with many electronics tutorial videos to choose.
The one on MOSFETs teaches how to read the datasheet to find out if it will meet your needs even with a heatsink.

For about $2-$3 you can get a 3A max output (but don't use more than half to be safe) buck converter though the shipping time will likely be 3 weeks. For a bit more, Jameco and others sell dc-dc converters with shorter shipping and likely give more honest specs.

What's cool about dc buck converters is that if you draw 100mA of 5V out of one that has 9V input, it will only draw about 60mA of that 9V.
If you draw 100mA of 5V from a 7805 regulator (Arduino external power regulator) it will draw 100mA from whatever >7V supply that feeds it --and waste every bit over 5V going in.
One of these ways makes it easier on the supply/battery and the regulator just steps all over your battery.

You can use a plug-in supply, or multiple 9V batteries wired in Parallel to get more current, and use the regulator either all the way through or until you get a converter.

Heating pad.... I'd use a relay to switch a plug-in pad ON and OFF, but never rapidly, relay-PWM burns up relays.

What is the current requirement or Wattage of the heat pad?

ted:
What kind of motor you have - picture/ link
Your program is ok, ist turning on the mosfet ......
Put the wire from pin 3 to ground then to 5V

I am using a motor in the program because they do not have a heat pad, for my actual project I am using a Heat pad that takes 5VDC