Lcd.print(temp) // display the temperature If(temp = tempMin) & (temp tempMax) // if temp is higher than tempMax Lcd.init() // Print a message to the LCD. change Above values to change the start temperature and max speed of fan Int tempMax = 60 // the maximum temperature when fan is at 100% Int tempMin = 30 // the temperature to start the fan 0% Int tempPin = A0 // the output pin of LM35 LiquidCrystal_I2C lcd(0x27,16,2) // in most of the screen the address is 0x27 To find the I2C address of your 16x2 screen follow this tutorial: This code is for 12c project other project details with code can be downloaded form here. Serial.print("\xC2\xB0") // shows degree symbolĭelay(1000) // wait a second between readingsĪll the required libraries can be installed from the manage libraries section under tools menu. Convert the voltage into the temperature in Celsius
Here, the user sets the minimum and the maximum reference temperature range from the keypad. Wait a few seconds between measurements.
In the Library Manager search for DHT and LiquidCrystal then install.
Of course, this value can be modified, you only need to modify the temperature according to your living environment. The fan speed control system has also been proposed. To install in the Arduino IDE, go to the Sketch tab, drop down to Include Library, and click Manage Library.
Begin serial communication at 9600 baud rateįloat voltage = reading * (5.0 / 1024.0) When the ambient temperature is greater than 30 C, the fan rotates at the fastest speed, and the LCD displays FAN ON 3 (here, 3 means the current fan speed is the third gear). Define the analog pin, the LM35's Vout pin is connected to Then open the serial monitor and start performing some test by heating/ cooling. After making the connections with Arduino, upload the code given below. After that according to the temperature the fan will work. Then Arduino read the temperature value from the sensor. Arduino will connect with a temperature sensor. To check the temperature constant and voltage output, heat and cold test can be performed. One Arduino UNO will be used to make the decision when the Fan will ON or OFF. Made all the connections according to the given schematics. Then we can turn the output voltage into respective temperature readings. So we can design a code to read the temperature using this method.įirst of all using Arduino ADC we can read the value of output voltage. Temperature sensor senses the room temperature and feeds. Lm35 has a linear 10mv constant per degree, When ever the output of sensor is increased by 10mv the temperature rises 1 degree Celsius. Automated Fan Control depending on room temperature is what this project is about in very simple terms.