Xutiz
Published © GPL3+

Bluetooth Heater Boiler

One button and hot water!

BeginnerShowcase (no instructions)1,409
Bluetooth Heater Boiler

Things used in this project

Hardware components

HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Buzzer, Piezo
Buzzer, Piezo
×1
Resistor 220 ohm
Resistor 220 ohm
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Relay Module (Generic)
×1
Immersion Heater Boil
×1

Software apps and online services

Arduino Web Editor
Arduino Web Editor

Story

Read more

Code

The code

Arduino
This is all the project.
#include <SoftwareSerial.h>
#define NOTE_G6  1568
#define NOTE_B7  3951

int const rele = 5; //entrada para o Relé
int const rxd = 2;
int const txd = 3;
int const buzzer = 10;

int dadobluetooth = 0;

SoftwareSerial bluetooth(rxd, txd);

void setup() {
  Serial.begin(9600);
  bluetooth.begin(9600);
  delay(100);
  pinMode(rele, OUTPUT);
  pinMode(buzzer, OUTPUT);
  digitalWrite(rele, HIGH);
}

void loop() {
  if(bluetooth.available()){
    
    dadobluetooth = bluetooth.read();
    
    if(dadobluetooth == '1'){
      digitalWrite(rele, LOW);
      tom(NOTE_G6, 350);
      tom(NOTE_B7, 200);
      Serial.println("Rabo ta quente");
      bluetooth.println("Rabo ta quente");
    }
    
    if(dadobluetooth == '0'){
      digitalWrite(rele, HIGH);
      tom(NOTE_B7, 350);
      tom(NOTE_G6, 200);
      Serial.println("Rabo ta esfriando");
      bluetooth.println("Rabo ta esfriando");
    }
    
  }
}

void tom(int frequencia, int duracao){
  tone(buzzer, frequencia, duracao);
  delay(duracao);
  noTone(buzzer);
  delay(50);
}

Credits

Xutiz

Xutiz

0 projects • 0 followers

Comments