Project tutorial
Realtime temperature monitor

Realtime temperature monitor

Realtime temperature monitoring system - IOT

  • 736 views
  • 0 comments
  • 2 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

Temperature Adjusting Arduino Fan Unit (T.A.A.F.U.).

Android app in the google play store: HERE

1 Project description

With the reliance on the cloud and other server-based applications on the rise, performance is paramount and failures become more unacceptable. One way to increase performance is to increase cooling capabilities in servers. Many servers already have temperature-controlled fans or other forms of cooling. A downside to increasing cooling for performance is a failure in cooling can damage the hardware. Many times if a failure occurs you are not aware of said failure unless you are on-site or directly monitoring the server.

We propose making an Arduino controlled fan that will adjust the speed of said fan depending on the temperature detected by a temperature sensor. The product will also use an LED display to indicate the temperature the sensor is detecting. Another feature of our product is that if the fan cannot bring the temperature down to a reasonable temperature, the device will use a wifi module to send a notification to an android app on the customer's phone. Our system also adds redundancy to a cooling solution when paired with cooling solutions already integrated into servers.

2 Background

Provide a brief discussion of relevant technical background material on which the project is based. Identify at least 3 published references.

This article has an example of the use of a wifi chip to send a message to an android device. While implemented using a motion sensor in the example the chip used in this project will use a temperature sensor but will work in much the same way.

  • This article has an example of the use of a wifi chip to send a message to an android device. While implemented using a motion sensor in the example the chip used in this project will use a temperature sensor but will work in much the same way.

Aditya, M. Sharma, and S. Chand Gupta, "An Internet of Things Based Smart Surveillance and Monitoring System using Arduino, " 2018 International Conference on Advances in Computing and Communication Engineering (ICACCE), Paris, 2018, pp. 428-433, DOI: 10.1109/ICACCE.2018.8441725.

Available:https://ieeexplore.ieee.org/abstract/document/8441725

This article provides an example of how the fan will be implemented in the project. The fan in the project will activate as a result of temperature change instead of smoke detection but is still a similar representation of what this project sets out to achieve.

  • This article provides an example of how the fan will be implemented in the project. The fan in the project will activate as a result of temperature change instead of smoke detection but is still a similar representation of what this project sets out to achieve.

M. F. M. Fuzi, M. N. F. Jamaluddin and M. S. N. Abdulah, "Air ventilation system for server room security using Arduino, " 2014 IEEE 5th Control and System Graduate Research Colloquium, Shah Alam, 2014, pp. 65-68, DOI: 10.1109/ICSGRC.2014.6908697.

Available: https://ieeexplore.ieee.org/abstract/document/6908697

This article explains how the temperature sensor planned to be chosen for this project calculates temperature by measuring the resistance of the thermistor. We will use the same method when calculating the temperature of a server.

  • This article explains how the temperature sensor planned to be chosen for this project calculates temperature by measuring the resistance of the thermistor. We will use the same method when calculating the temperature of a server.

P. V. Vimal and K. S. Shivaprakasha, "IOT based greenhouse environment monitoring and controlling system using Arduino platform, " 2017 International Conference on Intelligent Computing, Instrumentation and Control Technologies (ICICICT), Kannur, 2017, pp. 1514-1519, DOI: 10.1109/ICICICT1.2017.8342795.

Available: https://ieeexplore.ieee.org/document/8342795

3 Context

3. 1 Ethical

The ethical concern for our product is to guarantee that our android app does not collect any user data unnecessary for its ability to function.

3.2 Professional

Our product is designed to be used in a server setting but could be adapted to a wide range of different temperature-sensitive products.

3.3 Global

Our solution aims to be affordable and alert the customer when his potentially expensive equipment is at risk of damage.

3.4 Economic

N/A

3.5 Environmental

The prototype product will not have any environmental issues unless applied to mobile devices outside of a server setting, in which it will be potentially exposed to elements; therefore, the Arduino and other systems susceptible to weather will be sealed.

3.6 Societal

The product allows for a system that communicates to users regarding the status of their equipment’s temperature through the app, and the response of the system’s fan regulates an equilibrial working temperature for technology.

4. Detailed design plan

Software:

  • Android App :Create an Android app that keeps a log of the fan activity. It will also send push notifications when the temperature keeps increasing or stays steady for more than a certain time.
  • LED status system :Have to be able to take readings from the temperature sensor to display the correct LED color
  • Temperature sensors will deliver information to the program to determine which LED shines
  • Temperature Sensor Integration with Arduino :Will have to learn how to program the temperature sensors to read if there is a change in temperature
  • Program the temperature sensor to detect when the temperature is either too high, too low, or just right and relay the information to the LEDs
  • Fan System:The fan will be set to turn on at a certain high temperature and turn off at a certain low temperature. In between those on and off temperature, the fan will decide to speed up or down depending on the temperature. If the temperature is low, the fan will slow down and when the temperature is high, the fan will speed up.
  • Wifi Integration:Will program the wifi module to work with the Arduino and send information to the android app.

Hardware:

  • Circuit Design: The prototype board will be created for the system and if possible we will get a prototype board from jlcpcb for the final product.
  • 3D design for casing box: Design a 3D box that stores the circuit, display, and fan in such a way that air circulation is effective and makes it look like a final product.
  • Adapter: The adapter is gonna be the main power source of the whole system. The adapter will give the right amount of voltage that the system needs.
  • Fan: This is the main component which is controlled by Arduino.
  • Wifi Module: Makes the system controllable with the Android App (Receives data transferred from the Android App and translates it to the whole system.)
  • Temperature Sensor:Will have to see what resistors are needed (if any) to wire the temperature sensorsWhen the temperature is too high/low, the red LED shines to warn the user and then proceeds to turn the fan on in order to regulate the temperatureWhen the temperature is in the acceptable range, the green LED shines to assure the user that the system is safe

Code

ESP8266 wifi moduleArduino
#include <DHT.h>;
#include <LiquidCrystal_I2C.h>
#include "FirebaseESP8266.h"  
#include <ESP8266WiFi.h>
#include <Adafruit_Sensor.h>
#include <NTPClient.h>
#include <WiFiUdp.h>

#include<SoftwareSerial.h> //Included SoftwareSerial Library
//Started SoftwareSerial at RX and TX pin of ESP8266/NodeMCU
SoftwareSerial s(3,1);

#define DHTPIN D4    
#define DHTTYPE DHT11 
#define RED D6
#define GREEN D7
//#define BLUE 9
#define FAN_RELAY D5
#define FireBaseHost "onlyfans-d399c.firebaseio.com"
#define FireBaseAuth "Q4hMdDoU78odV9JJpiPeKgU5vyZ0lxONDFUj33Qi"
WiFiUDP ntpUDP;
// set the LCD number of columns and rows
int lcdColumns = 16;
int lcdRows = 2;
const long utcOffsetInSeconds = 60000;
const int GTMOffSet = -6;

NTPClient timeClient(ntpUDP, "time.nist.gov",GTMOffSet*60*60, utcOffsetInSeconds);
// set LCD address, number of columns and rows
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);  
DHT dht(DHTPIN, DHTTYPE); 
FirebaseData firebaseData;

String daysOfTheWeek[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
String months[12]={"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
const char* wifi_ssid = "onlyfans";           
const char* wifi_password = "123456789";         
const char* fanID = "onlyfans-d399c";
unsigned long currentMillis = 0; 
unsigned long previousFanOn = 0;   // will store last time the fan was turned on
int fanSlowInterval = 80; // millisecs between fan move
float hum;  
float temp; 
float oldTemp;
int fanSpeed = 0;
bool greenLED = false;
bool redLED = false;
bool orangeLED = false;


void setup()
{
  Serial.begin(115200);
  s.begin(115200);
  dht.begin();
  WiFi.begin(wifi_ssid, wifi_password);
  Firebase.begin(FireBaseHost, FireBaseAuth);
  
  lcd.init();
  lcd.backlight();
  
  delay(500);
  
  lcd.setCursor(4, 0);
  lcd.print("Welcome");
  lcd.setCursor(0, 1);
  lcd.print("T. A.  A.  F. U");
  
  oldTemp = dht.readTemperature();
  oldTemp = (1.8*oldTemp)+32;
  
  Serial.print("********** connecting to WIFI ********** : ");
  Serial.println(wifi_ssid);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print("...___ connecting");
  }
  Serial.println("");
  Serial.println("-> WiFi connected");
  Serial.println("-> IP address: ");
  Serial.println(WiFi.localIP());
  
  timeClient.begin();

  pinMode(RED, OUTPUT);
  pinMode(GREEN, OUTPUT);
  pinMode(FAN_RELAY, OUTPUT);
 // pinMode(BLUE, OUTPUT);
 
  fanSpeed = 200; 
  digitalWrite(FAN_RELAY, HIGH);
  writeLED(0,255,0);
   //  greenLED = true;
   // orangeLED = false;
  //  redLED = false;
  delay(500);//waiting 1 seconds to clear the display
  lcd.clear();
  
}
String getTime(){
  timeClient.update();
//Get a time structure
  unsigned long epochTime = timeClient.getEpochTime();
  struct tm *ptm = gmtime ((time_t *)&epochTime); 
  int monthDay = ptm->tm_mday;
  int currentMonth = ptm->tm_mon+1;
  String currentMonthName = months[currentMonth-1];
  int currentYear = ptm->tm_year+1900;
  String currentDate = String(currentYear) + "-" + String(currentMonth) + "-" + String(monthDay);
  String formattedTime = timeClient.getFormattedTime(); 
  String date = daysOfTheWeek[timeClient.getDay()]+", "+formattedTime+" "+currentDate;
  Serial.println(date);
  return date;
}

void writeLED(int red_light_value, int green_light_value, int blue_light_value)
 {
  analogWrite(RED, red_light_value);
  analogWrite(GREEN, green_light_value);
 // analogWrite(BLUE, blue_light_value);
 }

 void writeDisplay(){
  lcd.setCursor(1, 0);
  lcd.print("Temp: ");
  lcd.print(temp);
  // print temp
  // TODO
  lcd.setCursor(1, 1);
  lcd.print("Fan Speed: ");
  lcd.print(fanSpeed);
  // print temp
  // TODO
 }

void updateTemperature(){
  hum = dht.readHumidity();
  temp= dht.readTemperature();
  
  //convert o celsious to farenheight
  temp = (1.8*temp)+32;
  
}

void updateDataBase() {
  char * fanStatus;
  String  date = getTime();
  char * push = "false";
  if (fanSpeed>0){
    fanStatus = "On";
  }
  else{
    fanStatus = "Off";
  }
  temp = dht.readTemperature();
  temp = (1.8*temp)+32;
  if (oldTemp<temp && temp>=81){
    oldTemp = temp;
    push = "true";
  }
  else{
    oldTemp = dht.readTemperature();
    push = "false";
  }
 
  Firebase.setString(firebaseData,"Current Speed", String(fanSpeed));
  Firebase.setString(firebaseData,"Current Temperature", String((int)temp+1));
  Firebase.setString(firebaseData,"Fan ID", fanID);
  Firebase.setString(firebaseData,"Fan Status", fanStatus);
  Firebase.setString(firebaseData,"Last Updated", date);
  Firebase.setString(firebaseData,"Push Notification", push);
 
 //
}


void updateLEDStatus(){
  if (temp<77&& !greenLED){
    //green light
    
    writeLED(0,255,0);
    greenLED = true;
    orangeLED = false;
    redLED = false;
    s.write((int)temp);
  }
  //orange
  else if(temp>=77 && temp<81 && !orangeLED){
    writeLED(255,165,0);
    greenLED = false;
    orangeLED = true;
    redLED = false;
    s.write((int)temp);
  }
  else if(temp>80 && !redLED){
    //red light
    writeLED(255, 0, 0);
    greenLED = false;
    orangeLED = false;
    redLED = true;
    s.write((int)temp);
  }
}


void writeFAN(){
 if (temp<77 ){
    digitalWrite(FAN_RELAY, LOW);
    fanSpeed = 0;
  }
 
  else if(temp>=77 && temp<81 ){
    if(previousFanOn>=4,294,967,000){            //4,294,967,295 is the highest float it can reach)
        previousFanOn=0;
    }                           
    
    if(currentMillis - previousFanOn >= fanSlowInterval){
      previousFanOn +=fanSlowInterval;
      digitalWrite(FAN_RELAY, HIGH);
      fanSpeed = 100;
    }
    else{
      digitalWrite(FAN_RELAY, LOW);
    }
  }
  else{
    digitalWrite(FAN_RELAY, HIGH);
    fanSpeed = 200;
  }
}


void loop()
{

  
    currentMillis = millis();  
    updateTemperature();
    updateLEDStatus();
    writeDisplay();
    writeFAN();
    updateDataBase();
    
    Serial.print("Humidity: ");
    Serial.print(hum);
    Serial.print(" %, Temp: ");
    Serial.print(temp);
    Serial.println(" Farenheight");
    delay(5000);
}



   

Custom parts and enclosures

Solidworks assembly file
taafu_kV8600JqiQ.SLDASM
Solidworks part file(BOX)
casing_RBNr4whloU.SLDPRT
Solidworks part file(Cover)
casing_cover_TjqzGqRK9V.SLDPRT

Schematics

final_model1_F2ghw9LJFn.PNG
Final model1 f2ghw9ljfn

Comments

Similar projects you might like

Monitor Fire and Temperature Using ARTIK Cloud

Project tutorial by Samsung IoT

  • 3,988 views
  • 0 comments
  • 25 respects

Joy Robot (Robô Da Alegria)

Project tutorial by Igor Fonseca Albuquerque

  • 8,258 views
  • 6 comments
  • 49 respects

COVID19 Realtime Monitor

Project tutorial by hwhardsoft

  • 26,724 views
  • 23 comments
  • 61 respects

Monitor Temperature with Google Sheets

Project tutorial by Andrei Florian

  • 6,518 views
  • 1 comment
  • 20 respects

Temperature Monitor with DHT22 and I2C 16x2 LCD

Project tutorial by adrakhmat

  • 41,636 views
  • 18 comments
  • 55 respects
Add projectSign up / Login