• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Hire Me | Contact | Calculators-online
You are here: Home / Arduino Projects / LCD 220V Mains Timer Circuit – Plug and Play Timer

LCD 220V Mains Timer Circuit – Plug and Play Timer

Last Updated on May 14, 2026 by Swagatam 12 Comments

In this post we are going to make an LCD 220 V mains operated timer using Arduino whose countdown time can be witnessed via 16 x 2 LCD display.

Table of Contents
  • Introduction
    • The Design:
    • Circuit Diagram:
    • Circuit Layout: 
    • Program Code:
    • How to operate this LCD Socket Timer:

Introduction

The proposed LCD timer circuit is general purpose timer with display and few buttons for setting the time.

Once the time is set output goes high and starts countdown the time and when it reach 00:00:00 (Hour: Minute: Seconds) the output goes low. You may modify this project for your customized needs.

Now back to the project.

We always worry on our electrical or electronic devices which ran for too long just because we forget them to switch off them.

Time critical electrical and electronic devices like electric cooker, low profile battery chargers, heaters etc. need to be switched off at right moment otherwise we may end up reducing the life time of the gadgets or the processed end item such as food will be unpleasant to consume.

Low profile battery chargers might not have timer or battery monitoring system which might damage the battery’s life span if we left on charge for long time.

We can say hundreds of examples like these, to escape from such bad results a timer socket can be used.

A timer socket is a simple timer which is connected to AC socket and the time critical devices will be connected at output of the timer socket. The user has to input the time using button or dials for how long the connected devices should be powered.

Once the pre-set time is reached the device will be cut-off from the power supply.

The Design:

The proposed LCD socket timer project consists of Arduino which acts as brain of the project, a 16 x 2 LCD display which shows the remaining time, three buttons for setting the time and a relay for connecting and disconnecting the output AC supply.

Circuit Diagram:

The above circuit is the arduino to LCD display connection, a 10K potentiometer is provided for adjusting the contrast of the display. Rest of the above connections are self-explanatory.

The circuit needs power to operate so, a simple regulated power supply is provided; it can output constant 9V to arduino and relay.

S1, S2 and S3 are push buttons by which the user can set time. S1 is hour button S2 is minute button and S3 is start button.

A 1N4007 diode is connected across the relay terminal to absorb high voltage back EMF from the relay while switching.

Use at-least 5A relay and 5A output socket. Connect a 5A fuse at the input supply. Always use 3-pin plug at input; don’t skip earth wiring and don’t interchange Live and Neutral lines.

Circuit Layout: 

Program Code:

//-------Program Developed by R.GIRISH---------//
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int hbtn = A0;
const int mbtn = A1;
const int start = A2;
const int relay = 7;

unsigned int hrs = 0;
unsigned int Min = 0;
unsigned int sec = 60;

boolean Hrs = false;
boolean Minlt = true;

void setup() {
  lcd.begin(16, 2);

  pinMode(hbtn, INPUT_PULLUP);
  pinMode(mbtn, INPUT_PULLUP);
  pinMode(start, INPUT_PULLUP);
  pinMode(relay, OUTPUT);
  
  digitalWrite(relay, LOW);

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Please set time:");
  lcd.setCursor(0, 1);
  lcd.print("Hour:00 Min:00");
}

void displayTime() {
  lcd.setCursor(0, 1);
  lcd.print("Hour:");
  if (hrs < 10) lcd.print('0');
  lcd.print(hrs);
  lcd.print(" Min:");
  if (Min < 10) lcd.print('0');
  lcd.print(Min);
}

void loop() {
  // Set hours
  if (digitalRead(hbtn) == LOW) {
    hrs++;
    Hrs = true;
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Please set time:");
    displayTime();
    delay(300);
  }

  // Set minutes
  if (digitalRead(mbtn) == LOW && Minlt) {
    Min++;
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Please set time:");
    displayTime();
    
    if (Min >= 60) {
      Minlt = false;
    }
    delay(300);
  }

  // Start countdown
  if (digitalRead(start) == LOW && (hrs != 0 || Min != 0)) {
    digitalWrite(relay, HIGH);

    // Adjust initial minute
    if (Min != 0) Min--;

    while (true) {
      lcd.clear();
      lcd.setCursor(5, 0);
      lcd.print(hrs);
      lcd.print(":");
      if (Min < 10) lcd.print('0');
      lcd.print(Min);
      lcd.print(":");
      if (sec < 10) lcd.print('0');
      lcd.print(sec);

      lcd.setCursor(0, 1);
      lcd.print(" AC OUTPUT: ON");

      delay(1000);
      sec--;

      if (hrs == 0 && Min == 0 && sec == 0) {
        digitalWrite(relay, LOW);
        lcd.clear();
        lcd.setCursor(5, 0);
        lcd.print("0:0:0");
        lcd.setCursor(0, 1);
        lcd.print(" AC OUTPUT: OFF");
        while (true) {}
      }

      if (sec == 0) {
        sec = 59;
        if (Min != 0) Min--;
      }

      if (Min == 0 && Hrs) {
        if (hrs != 0) {
          hrs--;
          Min = 59;
        } else {
          Hrs = false;
        }
      }
    }
  }
}
//-------Program Developed by R.GIRISH---------//

How to operate this LCD Socket Timer:

• Connect the LCD timer to 220 V AC mains and connect you device at output of the timer’s socket.

• It will display “Hours: 00 Min: 00”. Press the hour (S1) or minute (S2) buttons to set the time.

• Pressing the buttons will increment the count.

• Once you set the time, press start button (S3). The output turns ON.

• The output turns OFF when the display reads 0:0:0.

NOTE: The timer displays “60” instead of “00” for minutes and seconds, which is same as traditional timers and clock counts 00 to 59 for 60 seconds. Here the timer counts 1 to 60 for 60 seconds.
If you have any questions regarding this project feel free to express in the comment section.

You'll also like:

  • IICIntroduction to I2C LCD Adapter Module
  • lcdconnMaking a Single Channel Oscilloscope using Arduino
  • DSC0410 1Making an Automatic Stopwatch for Runners, Athletes and Sportpersons
  • simple4060timercircuitSimple Timer Circuit Using IC 4060

Filed Under: Arduino Projects, Timer and Delay Relay Tagged With: 220V, LCD, Mains, Play, Plug, Timer

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « 110V, 14V, 5V SMPS Circuit – Detailed Diagrams with Illustrations
Next Post: Transformerless AC Voltmeter Circuit Using Arduino »

Reader Interactions

Questions & Answers

Total Posts: 12
Newest Oldest
Ghulam Mohio Din
February 3, 2026 • 8 months ago #200180

hi sir, sir can you make a real time timer with the help of esp32?

Reply
SwagatamAdmin
February 6, 2026 • 8 months ago #200470

Thanks Ghulam, I will try to post it soon..

Reply
Saad
July 2, 2018 • 8 years ago #61369

Hello sir,

Could you add 2-USB ports to the design to charging smartphones.

Regards,

Reply
SwagatamAdmin
July 2, 2018 • 8 years ago #61375

Hello Saad, the indicated LM338 output can be easily terminated with USB connectors for accomplishing USB ports.

Reply
Imran yousaf
October 5, 2017 • 9 years ago #54541

Good day sir
I Hope your fine
This Webside is very useful for Lerner as me
I am not related to this field but hope you understand my requirements

Sir please give a ieda for encobeter control setting by timer switch using Arduino with display
My requirements is like this
I need use R1 for encobetr temperature elements any he source for hetting
R1 function is like this for example I st temperature 35° the R1 should be cut off at 35° and below it shudder be on
R2 I will use for heater that boil the water I can get better humidity for example I set humidity at 60%65 The heater shudder be of
R3 I will use for circulation fan
R4 for egg turning motor 3 time in 24 houre on for few seconds
R5 for one more fan that is needed to on in high temperature conditions for east
Need to adjust with as you show abow cicuit s1 s2 s3 etc
I think this easy to adjust te timing
Sir need progarming and ieda for circuits using Arduino
Which is better you know that
I hope you respond me better

Reply
GR
October 6, 2017 • 9 years ago #54567

Hi Imran,

Please see whether I am correct:
1) The incubator should maintain 35 degree Celsius.
2)You need to maintain humidity of 60 to 65 % by vaporizing water.
3) You use the fan inside the incubator to spread the temp and humidity.
4) You need another fan to control during higher temperature (which will dissipate the heat outside).

Am I correct regarding your request? if not please mention in the reply.

Regards

Reply
Imran yousaf
October 7, 2017 • 9 years ago #54594

YES sir it is correct
But one thing more need to add it that is eggs turning moter
That moter need to run 3tim in 24 hours for 3 to 5 second only ,,
I need to ask if it possible we can add switch in this circuit?
Switch mean S1,S2,S3 as you used above timer circuit
For example after progarming and redy to every thing
When ever we need to adjust temperature and humidity we can adjust by that switch ?
I mean by manually?

Reply
SwagatamAdmin
October 5, 2017 • 9 years ago #54543

Hi Imran, sorry I am not so good in Arduino coding, so I won’t be able to help you in this regard.

Reply
Imran yousaf
October 5, 2017 • 9 years ago #54547

Ok sir
But you can refer to
Sir R.GR

Reply
Imran yousaf
October 5, 2017 • 9 years ago #54551

Dear sir

With very sorry for that
You tell me where I cannot explain properly?
how muc I know will tray to explain better.

Reply
SwagatamAdmin
October 5, 2017 • 9 years ago #54555

Imran,

please use correct spelling for all the words, and only explain what functions you want from the circuit in a step-wise manner, like 1) 2) 3)….

Reply
SwagatamAdmin
October 5, 2017 • 9 years ago #54548

Yes I can do it but your explanation is not correctly understandable. if you can write it with good English then I’ll surely refer it to Mr. GR.

Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

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

Primary Sidebar

My YouTube Channel

Circuit Simulator: Draw and Simulate Schematics

circuit simulator image

Categories

  • Arduino Projects (95)
  • Audio and Amplifier Projects (134)
  • Automation Projects (18)
  • Automobile Electronics (104)
  • Battery Charger Circuits (90)
  • Datasheets and Components (109)
  • Electronics Theory (151)
  • Energy from Magnets and Earth (43)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (98)
  • Lamps and Lights (161)
  • Meters and Testers (72)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (30)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Security and Alarm (65)
  • Sensors and Detectors (107)
  • SMPS and Converters (46)
  • Solar Controller Circuits (62)
  • Temperature Controllers (44)
  • Timer and Delay Relay (51)
  • Voltage Control and Protection (44)
  • Water Controller (37)
  • Wireless Circuits (31)

Subscribe to get New Circuits in your Email

Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on EGS002 Datasheet, Circuit Diagram Explained
  • Hung on EGS002 Datasheet, Circuit Diagram Explained
  • Swagatam on How to Design a Buck Converter Circuit: Formulas and Calculations
  • martin on How to Design a Buck Converter Circuit: Formulas and Calculations
  • Swagatam on Touch Dimmable LED Light Bar Circuit

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin

Calculators

  • ZVS Induction Heater + Tank Calculator Tool
  • Zener Diode Calculator
  • Wire Current and Thickness Calculator (Ampacity Calculator)
  • Voltage Divider Calculator
  • Transistor Base Resistor Calculator
  • Transistor Astable Multivibrator Calculator
  • TL431 Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Ferrite Core Air Gap Calculator Tool
  • Parallel MOSFET Calculator Tool: How to Connect MOSFETs in Parallel Safely
  • LC Resonance Calculator for EV Battery Charger Circuits
  • LED String Series Resistor Calculator
  • PFC (Power Factor Correction) Calculator Tool: 3kW
  • Passive Power Factor Correction (PFC) Calculator
  • LM567 IC Calculator Tool
  • SMPS Flyback Boost Converter Calculator
  • Shunt Resistor Calculator for Ammeters
  • SCR and Triac Gate Resistor Calculator
  • Battery Back up Time Calculator
  • Boost Converter Calculator (Non-Isolated)
  • Bootstrap Capacitor Calculator
  • Buck Converter Calculator
  • Buck-Boost Converter Calculator
  • Capacitance Reactance Calculator
  • DCM Flyback Transformer & Wire Gauge Wire Size Calculator Tool
  • Filter Capacitor Calculator
  • IC 4047 Calculator (Frequency and PWM)
  • IC 4060 Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • IC SG3525, SG3524 Calculator
  • Inductance Calculator
  • Induction Heater Inductor and Resonant Frequency Calculator
  • Induction Heater Work Coil Calculator
  • Inverter LC Filter Calculator
  • LC Resonance Calculator
  • LED Current Calculator
  • LM317, LM338, LM396 Calculator
  • NAND/NOT Gate RC Values Calculator
  • NOT, NAND Gate Frequency Calculator
  • Notch Filter Calculator Tool
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • RC Filter Calculator
  • Reactance Calculator
  • Sine Table Calculator for SPWM Arduino Code
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • SMPS Calculator for Toroidal Ferrite Transformers
  • SMPS Flyback Transformer Calculator – Design by Target Duty Cycle
  • TL431 Calculator
  • Op-Amp Hysteresis Resistor Calculator

© 2026 · Swagatam Innovations