TEMPERATURE MONITORING SYSTEM USING BLUETOOTH ARDUINO

In this article we will do temperature monitoring system using Bluetooth Arduino and how to cut-off signal for a machine or device when it reaches at threshold value. Like if the temperature of the machine reaches at 50 degree centigrade then cut-off the power so that it cools down and doesn’t get damaged. Even we will see how to change the threshold value of the temperature.

TEMPERATURE MONITORING SYSTEM USING BLUETOOTH AND ARDUINO CODE

// Set pin number
int device = 2;
int setpoint = 40;

void setup() {
  Serial.begin(9600);
  pinMode(device, OUTPUT);
  Serial.print("Give input of Setpoint");
  delay(2000);
}

void loop() {
  // To check if data is available on Serial port
  if (Serial.available() > 0) {
    // To read a data in integer form from HC05 via serial communication protocol
    setpoint = Serial.parseInt();
    Serial.print("Set Point Changed: ");
    Serial.println(setpoint);
  }
  int temperature = analogRead(A0);
  temperature = map(temperature, 0, 1023, 0, 500);
  Serial.print("Temperature = ");
  Serial.println(temperature);

  if (temperature <= setpoint) {
    digitalWrite (device, HIGH);
    Serial.println("Device is on");
  }
  else if (temperature > setpoint) {
    digitalWrite (device, LOW);
    Serial.println("Device is off");
  }
  delay(1000);
}

With the help of this sketch you can control industrial motor and domestic fan. Here we setup setPoint of temperature as 40 degree initially but you can change it from mobile app. Arduino MCU will receive that setpoint via HC05 Bluetooth module and save it until power is on. And MCU will compare real time temperature is received from temperature sensor, connected on A0 pin with setpoint, as per condition satisfied, output device will get turned on or turned off.

CIRCUIT DIAGRAM

Temperature Sensor Arduino Bluetooth

S.N. Arduino HC-05
1. + 5V + 5V
2. GND GND
3. Rx Tx
4. Tx Rx
S.N. Arduino LED
1. 2 Anode
2. GND Cathode
S.N. Arduino LM-35
1. + 5V + 5V
2. GND GND
3. A0 Vout

OUTPUT

When the temperature reaches at setPoint (threshold value) or cross the value device connected on pin 2 will be turned off and as it reaches below the setPoint it will again turn it ON. You can change condition according to your convenient like, turn on if temperature is five less than setPoint (else if (temperature <= setPoint – 5)).

output temperature setpoint

Leave a Reply

avatar
  Subscribe  
Notify of

Arduino Tutorials with Basic Electronics: CONTENT

Translate »