Ok one more question alsetalokin. I feel like I'm getting close to nailing this breadboard down and being able to play with PID code.
My question is this. I've gotten the LED to work great with the MOSFET circuit and PWM code. But when I replace it with the heating resistor, nothing happens.
I thought this was due to the PWM code and not allowing the heating resistor enough time to heat up. So I gave it an even simpler code of just putting pin 3 to high for 1,000,000 MS (17 mins). Resistor does not heat up. Then you plug the LED back in and it stays lit.
Is this due to the big 270 Ohm (non-heating) resistors I put on the board? Too much resistance on the current before it's fed into the heating resistor?
See picture attached
Code I used
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(3, OUTPUT);
}
void loop() {
digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000000); // wait for a second
digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Yes, as I mentioned earlier the resistor on the board is a _current limiting_ resistor for the LED. Don't use it for the Heating Resistor! Look at the Fritzing sketch I posted up above (Heating Resistor3) and you'll see how to put the HR in parallel with the LED+CLResistor, so that the current through the HR isn't limited by the LED's resistor.
The power dissipated in a resistor is P=I
2R, so it's easy to see that the power dissipated in your 270 ohm resistor is more than ten times the power dissipated in the 20 ohm heating resistor, if you keep the 270 ohms in series with the HR. The current through the 270+20 ohms, if you are using the 4.5 volt supply, and neglecting the Mosfet's resistance, is I = V/R or 4.5/290 = about 15 mA. So the 20 ohm HR will only be dissipating I
2R, or (0.015)
2x20 = a bit over 4 mW, and the 270 ohm resistor is dissipating about 61 mW !! (if I did the math right...)
If you don't use the current-limiting resistor in series with the HR, then you should have I = V/R or 4.5/20 = 0.225 A, and the HR should be dissipating (0.225)
2x20= a bit over 1 Watt. (Again neglecting the mosfet's on-state resistance, and assuming 100 percent ON from the PWM.) You should be able to feel this with your fingers, I should think. But for real heating, I'd use a higher supply voltage for the HR.