I hope this video is helpful to you. I have included everything you need to build a temperature controlled fan with Arduino. If you find it helpful, give it a like 👍 Check out some of of other videos - consider subscribing to the channel if you like the content. Thanks for watching!
hey there! Thanks for the feedback, and I totally agree with you. I include a diagram in my more recent videos. Sorry there's not one in this video. If you need to know the connections or you're having trouble, i'm happy to help 👍
Hi Tom. I copy all code to the Facebook page, mainly because it doesn't fit in the description sometimes. Here is what I used. #define FANpIN 5 #define GREEN 3 #define RED 4 int ThermistorPin = 0; int Vo; float R1 = 10000; float logR2, R2, T; float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07; void setup() { pinMode(FANpIN, OUTPUT); Serial.begin(9600); // Serial Monitor pinMode(RED, OUTPUT); pinMode(GREEN, OUTPUT); } void loop() { Vo = analogRead(ThermistorPin); R2 = R1 * (1023.0 / (float)Vo - 1.0); logR2 = log(R2); T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2)); T = T - 273.15; T = (T * 9.0)/ 5.0 + 32.0; Serial.print("Temperature: "); Serial.print(T); Serial.println(" F"); if (T > 74) { // If temperature is more than 74 digitalWrite(FANpIN, HIGH); // fan on digitalWrite(RED, HIGH); digitalWrite(GREEN, LOW); } else if (T < 74) { digitalWrite(FANpIN, LOW); // fan stays off digitalWrite(RED, LOW); digitalWrite(GREEN, HIGH); } delay(3000); // Waits for 3 seconds to read the pin again }
@@BMonsterLaboratory That is kind to say, but I'm shure I cannot (I'm an technical engineer and do not know anything about electronics) but I can copy quite nicely :) - unfortunately I have only a TMP36 thermo sensor, which you do not use. I assume I better do not cut off one of the legs haha but where to connect to, I have no idea...
Is it possible to do it without the relay? Cuz i followed your temperature sensor with lcd on it and now i need to put the fan into the circuit but still confused
Hi Irfan! Yes, you should be able to do it without a relay. You can use a 9v power supply (wall adapter or battery connected to Vin/GND). From the 9v power supply i'm thinking you can use a voltage divider circuit and drop 9v to 5v so you can connect it to pin 5. You don't want to connect more than 5v to your digital pins. I haven't tried this ...just thinking out loud. If you're unsure or need help, let me know and I can try it and send you a circuit diagram. hope that helps! good luck
I hope this video is helpful to you. I have included everything you need to build a temperature controlled fan with Arduino. If you find it helpful, give it a like 👍 Check out some of of other videos - consider subscribing to the channel if you like the content. Thanks for watching!
Great video. Helped me finish my project that's very similar. Thanks bud.
Great to hear! Thanks for leaving a message 👊👊
it would be helpful if you include schematic diagram also
hey there! Thanks for the feedback, and I totally agree with you. I include a diagram in my more recent videos. Sorry there's not one in this video. If you need to know the connections or you're having trouble, i'm happy to help 👍
Hi, I like your set up, but where can I copy the sketch? Writing it from the screen is quite difficult :)
Hi Tom. I copy all code to the Facebook page, mainly because it doesn't fit in the description sometimes. Here is what I used.
#define FANpIN 5
#define GREEN 3
#define RED 4
int ThermistorPin = 0;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
void setup() {
pinMode(FANpIN, OUTPUT);
Serial.begin(9600); // Serial Monitor
pinMode(RED, OUTPUT);
pinMode(GREEN, OUTPUT);
}
void loop() {
Vo = analogRead(ThermistorPin);
R2 = R1 * (1023.0 / (float)Vo - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
T = T - 273.15;
T = (T * 9.0)/ 5.0 + 32.0;
Serial.print("Temperature: ");
Serial.print(T);
Serial.println(" F");
if (T > 74) { // If temperature is more than 74
digitalWrite(FANpIN, HIGH); // fan on
digitalWrite(RED, HIGH);
digitalWrite(GREEN, LOW);
}
else if (T < 74) {
digitalWrite(FANpIN, LOW); // fan stays off
digitalWrite(RED, LOW);
digitalWrite(GREEN, HIGH);
}
delay(3000); // Waits for 3 seconds to read the pin again
}
There are other ways to do it...i"m sure you could improve on what I have here. Hope that helps! 👍
Thank you it saves me a lot of time and possible mistakes!
@@tomhoekstra1088 welcome anytime!
@@BMonsterLaboratory That is kind to say, but I'm shure I cannot (I'm an technical engineer and do not know anything about electronics) but I can copy quite nicely :) - unfortunately I have only a TMP36 thermo sensor, which you do not use. I assume I better do not cut off one of the legs haha but where to connect to, I have no idea...
Is it possible to do it without the relay? Cuz i followed your temperature sensor with lcd on it and now i need to put the fan into the circuit but still confused
Hi Irfan! Yes, you should be able to do it without a relay. You can use a 9v power supply (wall adapter or battery connected to Vin/GND). From the 9v power supply i'm thinking you can use a voltage divider circuit and drop 9v to 5v so you can connect it to pin 5. You don't want to connect more than 5v to your digital pins. I haven't tried this ...just thinking out loud. If you're unsure or need help, let me know and I can try it and send you a circuit diagram. hope that helps! good luck