## Saturday, 10 August 2019

A timer is a specialized type of clock used for measuring specific time intervals.

Here we are going to learn about Adjustable Timer using IC 555 and using Arduino in simple way
Let’s get started………..

## Simple Adjustable Timer Circuit Using 555 IC

Using simple 555 timer we can design an adjustable timer switch. This circuit is flexible to adjust required time. You can get more details about IC 555 timer in the link given below:

### Components Required:

• 555 timer
• Electrolytic capacitor – 470 uf
• ceramic capacitor – 0.1nF
• Resistors

120k ohm, 10k ohm
• Relay -12v
• Push button

### Working Procedure:

Here 555 timer is operated in monostable mode.
• When the trigger input is applied,555 timer produces a pulse. This pulse width depends on R and C values.
• The above proposed circuit is a 1-10 minute timer.When Pot is minimum it gives 1 minute delay,where maximum value of pot can produce 10 minutes.
Time period can be calculated using formula
T=(R1+R2)*C1.seconds
• When  Pot is maximum R  is 120K+1.1M ≈ 1.2M (approximately) and C1=470uf

T= 1.2M*470uF = 620 seconds≈10 minutes.This is the maximum time.
For minimum time place the pot in least position.Then R= 120k
Hence time T=120k*470uf=6 2 seconds~1 minute (approximately).
• A 12v relay is used to drive the ac load connected at the output.

Thus relay will be on for required amount of time set by the user using port and then it is switched of automatically.

This circuit is used in such applications where the load is switched on for sometime and is off for rest of the time.

## Adjustable ON OFF Timer(using 555 astable mode)

In this circuit a timer with cyclic on off operations is designed. This circuit uses very basic components like 555 timer and 4017 counter.

These on off intervals can be adjusted by varying the 555 timer output and number of counter outputs. Let us discuss in detail about this circuit.

### Components Required:

• R1 and R2 – 47 KΩ
• R3 – 15K Ω
• VR1 – 1M Ω
• C1 100µF
• C2 0.01µF
• C3 0.1µF
• Diodes
• 555 Timer IC
• CD4017 IC
• BC 148 B Transistor
• 6 V/ 100 Ω SPST Relay
•

### Working procedure:

When the power supply is given ,555 timer produces square wave at pin 3 as it is in astable mode.
• It gives a pulse width according to value of pot. It can be calculated as

T( high) =0.693*(R1+R2)*C 1
T(low) =0.693*R1*C1
This square wave is given to CD4017 IC decade counter which has 10 outputs                                       activated sequentially upon a given clock input.
• The outputs of the decade counter drive the transistor into active mode so that relay coil will be energized. (Instead of 6v relay one can use 12v relay also but relay should be applied with 12v instead of 6v.)
• Here the length of ON-time of the load is a multiple of 555 timer period output and number of outputs used in CD4017.
• Suppose in this circuit 3 outputs of CD4017 are used.So,On time of load is 3 times of T (high) and off time is 9 times of T(high).

Therefore, ON and OFF can be varied for desired duty cycles by appropriately connecting the pins of decade counter.

It is also possible to add a sensor or switch at reset input of decade counter for automatic turning off the load in emergency or needy (for an automatic operation) situations.

Arduino adjustable timer is simple circuit to generate timer for required time. This is used to switch on the loads for the certain time period and then they are automatically switched off.

Here arduino plays a key role in setting this time period.

Here a relay is used to switch the load for certain amount of time.

Arduino Board
LCD
Push buttons
Relay

### Working Procedure:

Initially when the circuit is switched LCD will display ” adjustable timer”.

Now using the two buttons set the timer.Button connected to 8th pin is used to set the timer in minutes and button connected to 10th pin is used to set the timer in hours.

Set the time by pressing these buttons.When the button is pressed , time is incremented every time.

Now click on start button to switch the load.

When the time is completed load is switched off automatically.

To set the timer next time click the reset button on the arduino and set the timer again.

Code:
```
#include <LiquidCrystal.h>

LiquidCrystal lcd(7,6,5,4,3,2);

const int set = 8;
int relay=9;

int hours=10;
int start=11;
int buttonState = 0;

int b=0,h=0,t=0;
int lastButtonState = 0;

pinMode(hours,INPUT);

void setup() {

pinMode(set,INPUT);
lcd.begin(16,2);

pinMode(relay,OUTPUT);
pinMode(start,INPUT);
int timer( int b,int h)

lcd.setCursor(0,0);
}
{
lcd.print(0);

if(b<=9)
{
lcd.setCursor(3,1);
else{lcd.setCursor(3,1);lcd.print(b);}

lcd.setCursor(4,1);
lcd.print(b);
}
lcd.setCursor(0,1);

lcd.setCursor(2,1);
lcd.print(":");
if(h<=9)
{
else{lcd.setCursor(0,1);lcd.print(h);}

lcd.print(0);
lcd.setCursor(1,1);
lcd.print(h);
}

}
if (buttonState != lastButtonState)

void loop()
{

{

lcd.print("Set time in min:");

if(buttonState == HIGH)
{

lcd.clear();

++b;
timer(b,h);

}

lastButtonState = buttonState;
}

{
lcd.clear();

lcd.print("Set time in hours");
++h;
timer(b,h);

}

digitalWrite(relay,HIGH);

{
lcd.clear();
t=((h*60)+(b))*1000;
lcd.print("Timer is set for");
timer(b,h);
delay(t);
}

digitalWrite(relay,LOW);

}

```

## Application Area:

Cooler controllers

Irrigation pump control

Exhaust fan switching