){.nav-menu .menu-item-has-children a{padding-right:20px}.nav-menu .menu-item-has-children a:after{position:absolute;right:7px;top:10}}.vce-ad-container{margin:30px auto;display:block;clear:both;width:728px;position:relative;max-width:100%}.vce-ad-below-header{margin-bottom:0}@media only screen and (max-width:1200px) and (min-width:1024px){.vce-ad-container{width:630px}.vce-ad-below-header{width:728px}}@media only screen and (max-width:1023px){.vce-ad-below-header,.vce-ad-container{width:728px}}@media (max-width:767px){.vce-ad-container{width:375px}}@media (max-width:400px){.vce-ad-container{width:300px}}@media (max-width:320px){.vce-ad-container{width:280px;max-width:100%}}:root .main-navigation ul ul{opacity:1}@media only screen and (min-width:1024px) and (max-width:1200px){.container{max-width:1000px}.vce-main-content{width:700px}.main-navigation ul ul{display:none}.top-header{overflow:hidden}.main-navigation a{padding:15px 9px 15px}.search-header-wrap a{padding:15px}.header-3-wrapper .site-branding{max-width:300px}h1.entry-title{width:540px}.entry-title{display:block}}@media only screen and (min-width:670px) and (max-width:1023px){.header-3-wrapper .site-branding{max-width:300px}.header-3-wrapper .nav-menu>li>a{padding:0 15px}h1.entry-title{width:540px}.entry-title{display:block}}@media only screen and (max-width:1023px){.container{max-width:90%}.vce-main-content{width:100%;padding:15px 0!important}.main-navigation ul ul{display:none}.vce-res-nav{float:left;position:absolute;left:0}.header-3-wrapper{height:50px!important;padding-top:0!important;text-align:center}.header-3-wrapper .site-branding{position:relative;float:none;top:0!important;left:initial!important;text-align:center;max-width:initial;padding:3px 0 7px}.site-branding{padding:4px 0 7px;display:inline-block}.site-branding img{max-width:120px;max-height:28px}.main-header .header-3-wrapper .site-title,.main-header .header-3-wrapper .site-title a.has-logo{line-height:40px!important;font-size:26px!important}.sidebar{margin:0 auto 20px;float:none!important;display:block;clear:both;padding-top:0!important;width:100%;max-width:300px}h1.entry-title{max-width:100%}.vce-responsive-nav{display:block;margin:10px 0 9px}.nav-menu,.top-header{display:none}.main-header .site-title,.main-header .site-title a{line-height:36px!important;font-size:40px!important}li>ul{margin:0}}@media only screen and (min-width:200px) and (max-width:670px){html{margin-top:0!important;overflow-x:visible}html body,button,input,textarea{font-size:14px;line-height:22px}.container{max-width:95%}.vce-main-content{padding:0 0 10px!important}.main-box,.sidebar .widget{margin-bottom:10px}.vce-wrap-right{width:100%;max-width:100%;text-align:center}.vce-single .entry-header{margin:20px 0}.vce-wrap-right{text-align:center}body h1.entry-title{font-size:24px;line-height:30px;padding:0 20px}body p{margin-bottom:20px}body h1{font-size:24px;line-height:34px;margin-bottom:10px}body h4{font-size:18px;line-height:28px;margin-bottom:10px}.sidebar .widget-title{line-height:22px}.vce-wrap-right>ul{float:none;display:inline-block;margin:10px 0 0}}#cookie-notice *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cookie-notice .cookie-notice-container{display:block}#cookie-notice.cookie-notice-hidden .cookie-notice-container{display:none}.cookie-notice-container{padding:15px 30px;text-align:center;width:100%;z-index:2}.cn-close-icon{position:absolute;right:15px;top:50%;margin-top:-10px;width:15px;height:15px;opacity:.5;padding:10px;outline:none}.cn-close-icon:before,.cn-close-icon:after{position:absolute;content:' ';height:15px;width:2px;top:3px;background-color:#fff}.cn-close-icon:before{transform:rotate(45deg)}.cn-close-icon:after{transform:rotate(-45deg)}#cookie-notice .cn-button{margin:0 0 0 10px}.cn-button.bootstrap{font-family:-apple-system,BlinkMacSystemFont,Arial,Roboto,"Helvetica Neue",sans-serif;font-weight:400;font-size:13px;letter-spacing:.25px;line-height:20px;margin:0;text-align:center;text-transform:none;display:inline-block;touch-action:manipulation;white-space:nowrap;outline:none;box-shadow:none;text-shadow:none;border:none;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;text-decoration:none;padding:8.5px 10px;line-height:1}.cn-button.bootstrap{color:#fff;background:#20C19E}.cn-text-container{margin:0 0 6px 0}.cn-text-container,.cn-buttons-container{display:inline-block}@media all and (max-width:900px){.cookie-notice-container #cn-notice-text{display:block}.cookie-notice-container #cn-notice-buttons{display:block}#cookie-notice .cn-button{margin:0 5px 5px 5px}}@media all and (max-width:480px){.cookie-notice-container{padding:15px 25px}}

Simple Thermostat for Electric Geyser

Here is a simple yet highly reliable thermal control circuit which can be used with almost all electric geysers. The Arduino microcontroller based circuit switches an electromagnetic relay on or off according to the temperature sensed by a single chip temperature sensor LM35DZ. When the sensor detects a temperature lower than the pre-settled threshold level, the relay is energized and when the temperature goes above the threshold, relay is de-energized. The circuit can be powered by any appropriate 12V (>500mA) wall-wart or battery pack.

The 3-pin LM35DZ temperature sensor chip is factory-calibrated in the Celsius (oC) scale with a linear “Degree – to – Volt” conversion function i.e. its output voltage changes linearly with temperature from 0V (0oC) to 1000mV (100oC). This greatly simplifies the circuit design as we only need to upload a small code in order to build a complete thermal controlled switch (thermostat). Besides, No special instrument is needed for calibration.

The relay can be set to trip at any temperature just by changing a single line of code. In practice, most water geysers available in the market have a temperature range of 40 – 75 oC with a default thermostat setting of 60oC (or high). This means that water in the geyser will be heated till it reaches a temperature of 60 oC (or high). Beware, water heated up to this temperature level becomes extremely hot and needs to be mixed with lot of cold water before use.

Hardware Layout & Parts List

Hardware Layout

Here, the temperature sensor is wired to A1 of Arduino board but if the sensor cable is longer there’s a chance of noisy analog read. Ideally you should use a low-voltage screened cable for the interconnection. Although adding a small capacitor on the analogue input will dampen the noise, an RC filter (say, a time-constant of 100mS that doesn’t overload the output) instead reduce noise and improve measurements. Also try to decouple the +5V line of LM35 with a 100Ω resistor and 100uF capacitor.

  • Arduino Uno Board (Official or Clone)
  • 16×2 LCD Keypad Shield (DFRobot DFR0009)
  • 12V 1 channel (Hi/Lo) Relay Module
  • LM35DZ Temperature Sensor
  • 12V DC (>500mA) smps power supply adapter/module
  • 100 Ω ¼ W Resistor & 100uF Capacitor (optional – see note)

Arduino Sketch/Code

   *Simple Geyser Thermostat
   *Thermo-Regulator/Arduino Uno
   *LM35 & DFR LCD-Keypad Shield
   *Experimental Sketch v2
   *Publisher: Codrey Electronics
   *Site: https://www.Codrey.com

#include <LiquidCrystal.h> // LCD Library
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // LCD Shield Interface (RS, EN, D4,D5, D6, D7)
int tempPin = A1;   // Temperature Sensor I/P
int tRead; // Temperature Data
int tempMin = 50;   // Minimum temperature level
int tempMax = 60;   // Maximum temperature level/Trip Threshold
int relay = 13;       // Relay Driver O/P
int relayStatus = 1;

void setup() {
  lcd.begin(16, 2);
  pinMode(tempPin, INPUT); // A1 as input
  pinMode(relay, OUTPUT); // D13 as output
  digitalWrite(relay, HIGH); // Turn Relay ON


void loop() {
  lcd.setCursor(0, 0);
  tRead = readTemp();     // Read temperature

  if (relayStatus == 1 and tRead >= tempMax) {
    // Temperature exceeds TempMax - Turn Relay OFF
    digitalWrite(relay, LOW);
    // Update status
    relayStatus = 0;

  if (relayStatus == 0 and tRead <= tempMin ) {
    // Temperature falls below TemPMin -  Turn Relay ON

    digitalWrite(relay, HIGH);
    // Update status
    relayStatus = 1;


  lcd.setCursor(0, 1);
  lcd.print("WATER TEMP:");
  // Display temperature in *C
  lcd.print("C! ");


int readTemp() { 
 // Get temperature and convert it to Celsius
  tRead = analogRead(tempPin);
  return tRead * 0.48828125; // (5 * 1000 / 1024) / 10

Proof of Concept

& That’s all for now. Thanks for reading! Please feel free to give us your feedback. We strive to keep you well informed…

Leave a Comment X


  • Hi
    I am relatively new to Arduino, this project is awesome, just one question. using the LCD shield can one not adjust the minimum temp and max temp relative to each other using the build in up down buttons. this will save a trip to the device with a laptop (or otherwise)
    I have read up a bit on the LCD Shield but struggle o find how that will be acomplished.

    Thank you for your projects