Skip to content

Smart water heater using Arduino DIY Project

Hey guys, welcome back to Techatronic. Today we will make an smart water heater project using Arduino and DS1820B temperature sensors. if you want to make a portable smart water heater for winter you can make this. this can be used in many things where we need a small , smart and safe water heater they can make this smart water heater.

Introduction

this is a very simple and useful project which can be used at many places. like if you are going anywhere you can carry it with you. these smart water heater are available in the market but this is unique and have some extra feature. so, if you want to make it simply you need to follow the given instructions.

if you have some prior experience in arduino , basic electronics then it will be very easy for you to make this. also, you can learn basic electronics and Arduino programming from our recent article on our website.

We have made this full tutorial with code, circuit and step by step instruction. follow the given instructions and make this smart water heater project by yourself.

HTML Image as link
Qries

Components Required.

  • Arduino nano
  • 16×2 display
  • DS1820B temperature sensor
  • buzzer
  • push button
  • singal channel relay
  • potentiometer
  • Mini water heater

if you can arrange these given components you can make this awesome smart water heater.

Here the arduino nano is the main controller of this project. as we all know the Arduino is a microcontroller and can be control many things. like it can get the information from the sensors and also it is capable to operate the output devices. here the arduino nano getting all the information from the sensors like ultrasonic sensor and temperature sensor. according to the data collect from the sensor it operate the water heater by triggering the relay.

16×2 display is used to show or display the information of the system. in this smart water heater we are showing the current temperature, required temperature, level of water in the container, and operation instructions.

DS1820b is a waterproof temperature sensor. this is also known as the probe temperature sensor and can be use to detect the temperature for liquid.

In this smart water heater we are using 3 push button for set the temperature for water heater. 1st button increases the value and 2nd button decrease the value and third button set the values.

Circuit Diagram

Code


const int buttonPin1 = 2, buttonPin2 = 3;    
int button1_State = 0, button2_State = 0;
int count_value =0;
int prestate =0;
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 10, d5 = 9, d6 = 8, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is conntec to the Arduino digital pin 4
#define ONE_WIRE_BUS 5

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature sensor 
DallasTemperature sensors(&oneWire);

int duration=0;
long distance=0;
int firstduration=0;
long firstdistance=0;
int secondduration=0;
long seconddistance=0;

void setup() {
  // initialize the pushbutton pin as an input:
  sensors.begin();
  pinMode(buttonPin1, INPUT_PULLUP);
  pinMode(buttonPin2, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(A0, OUTPUT);
   pinMode(A1, OUTPUT);
  lcd.begin(16, 2);
  Serial.begin(9600);
  lcd.clear();
  lcd.setCursor(2, 0);
  lcd.print("SMART WATER");
  lcd.setCursor(5, 1);
  lcd.print("HEATER");
  digitalWrite(A0, LOW);
  digitalWrite(A1, HIGH);
 pinMode(A4,OUTPUT);
pinMode(A5,INPUT);
}

void loop() {

  
  // read the state of the pushbutton value:
  button1_State = digitalRead(buttonPin1);
  button2_State = digitalRead(buttonPin2);
  int m = digitalRead(4);
  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (button1_State == LOW && prestate == 0) {
    count_value++;  
  
  Serial.println(count_value);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("SET TEMPERATURE");
  lcd.setCursor(7, 1);
  lcd.print(count_value);
    prestate = 1;
    delay(100);
  }
//decrement
  else if (button2_State == LOW && prestate == 0) {
    count_value--;
  
  Serial.println(count_value);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("SET TEMPERATURE");
  lcd.setCursor(7, 1);
  lcd.print(count_value);
   prestate = 1;
    delay(100);
  } 

else if(m==0)


{
digitalWrite(A4, HIGH);
   delayMicroseconds(10);
   digitalWrite(A4, LOW);
   delayMicroseconds(2);
   duration= pulseIn(A5,HIGH);
   delay(100);
   distance=duration*0.034/2;
   Serial.println(distance);
   if(distance==3 || distance==4)
   {

  digitalWrite(A1, LOW);
   digitalWrite(A0, LOW);

    while(1)
  {
   
   lcd.clear();
  
  lcd.setCursor(11, 1);
  lcd.print(count_value);
  sensors.requestTemperatures(); 
  
  lcd.setCursor(2, 0);
  lcd.print("HEATER START");
  lcd.setCursor(2, 1);
  lcd.print(sensors.getTempCByIndex(0));
  delay(500);

  if(sensors.getTempCByIndex(0)>=count_value)

  {
   
     digitalWrite(A0, HIGH);
      digitalWrite(A1, HIGH);
     //delay(200);
    }
else
{
  digitalWrite(A0, LOW);
      digitalWrite(A1, LOW);
  
  }
   

  
  }
   }

   else 

   {

    lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("FILL MORE WATER");
  lcd.setCursor(0, 1);
  lcd.print(distance);
    digitalWrite(A1, HIGH);
   //digitalWrite(A0, LOW);
    
    }
 
}
  
 else if(button1_State == HIGH && button2_State == HIGH) {
    prestate = 0;
  }
  
}

Upload code to your Arduino Nano with the help of a USB micro cable.

Smart Water heater Working

smart water heater arduino project

the display show you all the instructions how the system will work. first, you have to fill the container. make sure the water level should be good enough to operate the water heater. after that, press the 1st push button and increase the temperature as you need. you can decrease the temperature with another button. and now press third button to set the temperature. the system will start the water heater till the required temperature achieve.

PCBWay PCB Prototyping Services

I have assembled the whole circuit on a breadboard. As you know breadboard assembly is not effective for this type of project. So, PCBWay offers Rapid PCB Prototyping for Your Research Work. I personally, recommend PCBWay because you can get your first-try boards right in 24 hours!

PCBWay website

The prototyping stage is the most critical period of time for engineers, students, and hobbyists. PCBWay not only makes your boards quick but also makes your job right as well as cost-effective. This greatly reduces your cost and shortens the time for developing your electronic

PCBWay can provide 2 Layer PCBs to highly advanced HDI and flex boards. Even though the PCBs they produce differ a lot regarding functionality and areas of use. I am impressed with the quality of the boards, the delivery time, and the cost-effectiveness

once it found the required temperature in water then it will stop the water heater with a buzzer sound.

Leave a Reply

Your email address will not be published. Required fields are marked *