Temperature controlled USB fan with Arduino!
Things you will need
- Arduino
- Relay Module
- USB desk fan
- Thermistor
- Resistor 220Ω
Fairly simple concept here, we set the Arduino to kick the fan on if temps exceed 73 degrees Fahrenheit and stay off otherwise. By opening the serial monitor on baud 115200 you can view the current temperature in real time. You can also modify the values in the code to change when the fan kicks on if you like it warmer xP. Here is my layout i created with Fritzing and the code below.
Have fun!
#include <math.h> //loads the more advanced math functions
#define RELAY1 6
void setup() { //This function gets called when the Arduino starts
Serial.begin(115200); //This code sets up the Serial port at 115200 baud rate
pinMode(RELAY1, OUTPUT);
}
double Thermister(int RawADC) { //Function to perform the fancy math of the Steinhart-Hart equation
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp - 273.15; // Convert Kelvin to Celsius
Temp = (Temp * 9.0)/ 5.0 + 32.0; // Celsius to Fahrenheit - comment out this line if you need Celsius
if (Temp <= 70){
digitalWrite(RELAY1,HIGH); //low temp code here
}
else if (Temp >= 73) {
digitalWrite(RELAY1,LOW); //high temp beep code here fan on if over 73
}
return Temp;
}
void loop() { //This function loops while the arduino is powered
int val; //Create an integer variable
double temp; //Variable to hold a temperature value
val=analogRead(0); //Read the analog port 0 and store the value in val
temp=Thermister(val); //Runs the fancy math on the raw analog value
Serial.println(temp); //Print the value to the serial port
delay(1000); //Wait one second before we do it again
digitalWrite(RELAY1,LOW);
digitalWrite(RELAY1,HIGH);
}
Lucky PC Solutions
Monday, February 29, 2016
Wednesday, December 11, 2013
Give the gift of a fast operational computer!
This Holiday season when u buy one remote service Tune-UP get one FREE!. Just enter the code below at checkout and u will be emailed a redeemable Code in wich u may gift or use for yourself! thats a 120$ value for only 30$!
http://www.luckypcsolutions.com/specials/4581429616
This Holiday season when u buy one remote service Tune-UP get one FREE!. Just enter the code below at checkout and u will be emailed a redeemable Code in wich u may gift or use for yourself! thats a 120$ value for only 30$!
Tuesday, December 10, 2013
Creating an Undetectable Custom SSH Backdoor in Python
Creating an Undetectable Custom SSH Backdoor in Python [A – Z]
http://resources.infosecinstitute.com/creating-undetectable-custom-ssh-backdoor-python-z/
http://resources.infosecinstitute.com/creating-undetectable-custom-ssh-backdoor-python-z/
Fun projects made with my little brother!
Monday, December 9, 2013
Subscribe to:
Posts (Atom)