• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos 

You are here: Home / Arduino Engineering Projects / LCD 220V Mains Timer Circuit – Plug and Play Timer

LCD 220V Mains Timer Circuit – Plug and Play Timer

Last Updated on June 7, 2020 by Swagatam

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.

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:

caution electricity can be dangerous

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);
pinMode(mbtn, INPUT);
pinMode(start, INPUT);
pinMode(relay, OUTPUT);
digitalWrite(hbtn, HIGH);
digitalWrite(mbtn, HIGH);
digitalWrite(start, HIGH);
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 loop()
{
if(digitalRead(hbtn) == LOW)
{
Hrs = true;
hrs = hrs + 1;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Please set time:");
lcd.setCursor(0,1);
lcd.print("Hour:");
lcd.print(hrs);
lcd.print(" ");
lcd.print("Min:");
lcd.print(Min);
delay(300);
}
if(digitalRead(mbtn) == LOW && Minlt == true)
{
Min = Min + 1;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Please set time:");
lcd.setCursor(0,1);
lcd.print("Hour:");
lcd.print(hrs);
lcd.print(" ");
lcd.print("Min:");
lcd.print(Min);
if(Min == 60)
{
Minlt = false;
}
delay(300);
}
if(digitalRead(start) == LOW)
{
if(hrs != 0 || Min != 0)
{
digitalWrite(relay, HIGH);
if(Min != 0)
{
Min = Min - 1;
}
while(true)
{
lcd.clear();
lcd.setCursor(5,0);
lcd.print(hrs);
lcd.print(":");
lcd.print(Min);
lcd.print(":");
lcd.print(sec);
lcd.setCursor(0,1);
lcd.print(" AC OUTPUT: ON");
sec = sec - 1;
delay(1000);
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 = 60;
if(Min != 0)
{
Min = Min - 1;
}
}
if(Min == 0 && Hrs == true)
{
hrs = hrs - 1;
Min = 60;
if(hrs == 0)
{
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:

  • 1.  Industrial Tank water fill/drain controller Circuit
  • 2.  Poultry Feed Controller Timer Circuit
  • 3.  Digital Clock Activated Water Level Controller Circuit
  • 4.  Timer Controlled Submersible Pumpset Circuit
  • 5.  Programmable Diesel Generator Timer Circuit
  • 6.  SMS Based Pump Controller with Automatic Dry Run Shut Off

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

10 Comments
Newest
Oldest
Inline Feedbacks
View all comments

Primary Sidebar

Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (26)
  • 555 IC Circuits (99)
  • 741 IC Circuits (20)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (115)
  • Battery Chargers (83)
  • Car and Motorcycle (94)
  • Datasheets (73)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (101)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (120)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (103)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (66)
  • Mini Projects (149)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (79)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (62)
  • Sensors and Detectors (121)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (61)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (41)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations

wpDiscuz