Using the arduino software and write this code down . Controller is a multichannel temperature sensor and PWM fan controller and fan speed monitor for systems requiring active cooling. It is designed to interface directly to an I 2 C® bus. Matlab code for phase 2 simplex method list. The ADT7470 can monitor up to 10 daisy-chained TMP05 temperature sensors. It can also monitor and control. float temp; int tempPin = A0; //arduino pin used for temperature sensor int tempMin = 25; // the temperature to start the buzzer int tempMax = 70; int fan = 6; // the pin where fan is connected int fanSpeed = 0; void setup() { pinMode(fan, OUTPUT); pinMode(tempPin, INPUT); Serial.begin(9600); } void loop() { temp = analogRead(tempPin); temp = (temp *5.0*100.0)/1024.0; //calculate the temperature in Celsius Serial.println(temp); delay(1000); // delay in between reads for stability if(temp < tempMin) { // if temp is lower than minimum temp fanSpeed = 0; // fan is not spinning digitalWrite(fan, LOW); } if((temp >= tempMin) && (temp <= tempMax)) //if temperature is higher than the minimum range { fanSpeed = map(temp, tempMin, tempMax, 32, 255); // the actual speed of fan analogWrite(fan, fanSpeed); // spin the fan at the fanSpeed speed } } Now after verifying and uploading the code to the arduino, you can open the serial monitor up at the right of the arduino software to show the temperature of the surrounding.
0 Comments
Leave a Reply. |