Timer Switch Circuit: The Ultimate Guide

How Timer Switch Circuits Work

At its core, a timer switch circuit consists of a few key components:

  • A timer chip (typically a 555 timer IC)
  • A relay to switch the electrical load on and off
  • Resistors and capacitors to set the on/off timing
  • A power supply to run the circuit

The 555 timer chip acts as the brains of the circuit. It contains a voltage controlled oscillator and has trigger and reset inputs. By connecting resistors and capacitors to the 555 timer in a certain configuration, you can set it to output a square wave signal that oscillates at a specific frequency, with an on time and off time determined by the R-C values.

This timed control signal is then used to switch a relay on and off. The relay is an electromechanical switch that contains a coil and a set of contacts. When current flows through the coil, it creates a magnetic field that attracts an armature, causing the contacts to close and allow current to flow to the load. When coil current stops, the contacts open, cutting power to the load.

So in summary, the 555 timer generates a precision on/off control signal which triggers the relay to switch mains power on and off to the connected load at set intervals. By varying the resistor and capacitor values, the on and off times can be adjusted from seconds to hours.

555 Timer Basics

To understand how a 555 timer can be used to create an adjustable timer switch, it’s helpful to know a bit more about how this versatile little chip works.

A 555 timer has 8 pins with the following functions:

Pin Name Description
1 Ground Connected to circuit ground / 0V
2 Trigger Timer is triggered when this pin drops below 1/3 Vcc
3 Output Outputs either Vcc or 0V depending on state of timer
4 Reset Timer is reset when this pin is connected to ground
5 Control Controls threshold voltage, normally connected to GND through a 0.01uF capacitor
6 Threshold When voltage on this pin is greater than 2/3 Vcc, output goes low
7 Discharge Open collector output to discharge timing capacitor
8 Vcc Positive supply voltage (usually 5-15V)

Inside the 555 chip is a voltage divider that provides reference voltages of 1/3 and 2/3 of the supply voltage Vcc. The trigger comparator monitors the voltage on the trigger input. When this drops below 1/3 Vcc, the internal flip-flop is set and the output goes high (Vcc). The threshold comparator checks the voltage on the threshold input. If this exceeds 2/3 Vcc, the flip-flop is reset and the output goes low (0V).

In astable mode, which is what’s used to create an oscillating signal for a timer, the 555’s output pin is connected to the discharge pin through a resistor. A timing capacitor is connected between the discharge pin and ground. When the output goes high, the capacitor starts charging through the resistors. When the cap voltage reaches 2/3 Vcc, the threshold comparator resets the flip-flop and the output goes low. Now the cap discharges through the discharge pin until its voltage drops to 1/3 Vcc, at which point the cycle repeats.

The charge/discharge time, and hence the output frequency and duty cycle, is determined by the resistor and capacitor values according to these formulas:

  • Charge time = 0.693 * (R1 + R2) * C
  • Discharge time = 0.693 * R2 * C
  • Total period = 0.693 * (R1 + 2R2) * C
  • Frequency = 1.44 / ((R1 + 2R2) * C)
  • Duty cycle = (R1 + R2) / (R1 + 2R2)

Where R1 is the resistor from Vcc to discharge, R2 is from discharge to the timing cap, and C is the timing capacitor value.

By selecting appropriate resistors and cap, you can create a 555 oscillator with on and off times ranging from less than a second to hours. This forms the basis of the timer switch circuit.

Timer Switch Circuit Diagram

Now that we understand the basics of how a 555 timer works, let’s look at how to implement a complete timer switch circuit. Here is a typical circuit diagram:

[Typical timer switch circuit diagram]

The key components are:

  • 555 timer IC (U1)
  • SPDT 12V relay (RLY1)
  • 1N4001 diode (D1)
  • 1K resistor (R1)
  • 100K potentiometer (R2)
  • Selected timing resistor (R3)
  • Selected timing capacitor (C1)
  • 0.01uF bypass cap (C2)
  • 12V DC power supply

R1 and R2 form a voltage divider to provide an adjustable voltage to the control pin, allowing the duty cycle to be varied. R3 and C1 set the overall on/off timing. With the values shown, the on time can be adjusted from about 0.5 sec to 12 sec, and the off time is fixed around 6 sec.

D1 is a freewheeling diode that protects the 555 from inductive voltage spikes generated by the relay coil when switching off. C2 provides power supply decoupling to keep the 555 stable.

A 12V AC adapter provides power for the circuit and relay. The relay contacts are used to switch mains power on and off to the connected load.

Adjusting Timer Switch On/Off Times

To change the on and off times of the timer switch, you need to alter the values of the timing resistor R3 and capacitor C1. There are a few different ways to implement this.

Fixed Resistor

The simplest is to just use a fixed resistor value for R3. Referring to the 555 timer formulas above, for a 60 sec on time and 60 sec off time (2 min total period) with a 1000uF cap for C1, the resistor value would be:

R3 = (Period / (1.386 * C)) – (2 * R2)
= (120 / (1.386 * 1000e-6)) – (2 * 100e3)
= 86.6K – 200K
= -113.4K

Of course, a negative resistance doesn’t make sense. The calculated value indicates that the desired 2 min cycle time is too long for the chosen cap value. To fix this, you either need to use a larger capacitor or add a fixed resistor in series with the pot.

Rearranging the formula to solve for C instead:

C = Period / (1.386 * (R3 + 2*R2))
= 120 / (1.386 * 202e3)
= 429uF

So with the pot set to maximum resistance (100K), a 429uF cap would give a 2 min total period. Of course, the next larger standard cap value is 470uF.

With R2 = 100K and C1 = 470uF, the time periods would be:

  • Rmin = 0 (pot at minimum):
    • On time = 0.65 sec
    • Off time = 1.3 sec
  • Rmid = 50K (pot at midpoint):
    • On time = 26 sec
    • Off time = 52 sec
  • Rmax = 100K (pot at maximum):
    • On time = 52 sec
    • Off time = 104 sec

So this setup provides a decent range of adjustment from a couple seconds up to nearly 2 minutes. The times can be further increased by using a larger cap or adding a fixed resistor in series with the potentiometer.

Switched Resistors

Another option to get more adjustment range is to use a rotary switch to select between different fixed resistors:

[Switched resistor timer schematic]

A 1-pole-6-position rotary switch selects between 6 different resistors. An example set of resistor values for 6 time ranges is:

Position Resistor On Time (sec) Off Time (sec) Period (min)
1 2.2K 0.007 0.014 0.0004
2 22K 0.072 0.145 0.004
3 220K 0.72 1.45 0.036
4 2.2M 7.25 14.5 0.36
5 4.7M 15.5 31 0.78
6 6.8M 22.4 44.8 1.12

Selection of standard values provides a good range of time scales from very fast pulsing up to cycles of around a minute. For longer periods, use larger resistors or capacitors. For finer adjustment, you could use a multi-pole switch to independently change R3 and C1.

Dual Potentiometer

For continuously variable control over a wide range, a dual-gang potentiometer can be used:

[Dual potentiometer timer diagram]

A 1M dual-gang (stereo) log taper pot is used. One section adjusts R3 from 0-1M to change the charge time. The other section adjusts R2 from 0-1M to control the threshold level and discharge time.

With the values shown, the time ranges would be approximately:

R2 pos. R3 pos. On time Off time Period
min min 1 sec 0.5 sec 1.5 sec
min mid 6 sec 0.5 sec 6.5 sec
min max 12 sec 0.5 sec 12.5 sec
mid min 1 sec 2.8 sec 3.8 sec
mid mid 6 sec 2.8 sec 8.8 sec
mid max 12 sec 2.8 sec 14.8 sec
max min 1 sec 11 sec 12 sec
max mid 6 sec 11 sec 17 sec
max max 12 sec 11 sec 23 sec

So by adjusting the dual pot, the on and off times can be varied independently over a range of about 1-12 seconds each, for a total period of 1.5 to 23 seconds. Again, changing the capacitor C1 will scale all the times up or down.

Types of Timer Switch Circuits

The basic timer switch circuit can be adapted in a few different ways depending on the intended application. Let’s look at some common variations.

Daily Timer

A daily cycle timer will turn the load on and off at the same times each day. This is useful for things like landscape lighting, aquarium pumps, etc. that you want to control on a 24-hour schedule.

To make a 555 Timer Circuit repeat at a 24 hour interval, you need very large RC time constants. One way is to use a huge electrolytic capacitor, say 10,000uF or more. Another is to put multiple resistors in series to get up into the 10-100 Megohm range. Both of these approaches have drawbacks in terms of component size and stability over time and temperature changes.

A better approach is to add a 4060 binary counter IC after the 555:

[Daily timer circuit]

The 4060 is a 14-stage ripple counter. Its clock input triggers on the rising edge of the 555’s output signal to increment the counter. Each successive output (Q1-Q14) divides the input frequency by 2. So if the 555 is set up as a 1 Hz oscillator, Q1 will be 0.5Hz, Q2 will be 0.25Hz, etc.

Q14 divides the input by 16384. So if the 555 runs at 1.068 Hz, Q14 will oscillate with a period of about 24 hours. By using this signal to drive the relay, you get a daily on/off cycle.

The 100K multi-turn trimmer potentiometer allows the 555’s frequency to be precisely calibrated to give a 24 hour period. The 1M resistor and 100uF cap set the base frequency.

With the component values shown, the on time will be about 16 hours and the off time about 8 hours. To change the duty cycle, you can vary the ratio of R1 and R2. Adding a diode across R2 will make the off time shorter than the on time.

Sunset/Sunrise Timer

A variation on the daily timer is a circuit that turns the load on at sunset and off at sunrise (or vice versa). This is handy for outdoor lighting, chicken coop doors, etc.

The simplest way to make a dusk-to-dawn timer is with a photoresistor or phototransistor that triggers the 555 based on ambient light level:

[Light-sensitive timer schematic]

A CdS photocell (R1) or phototransistor (Q1) is connected between the trigger pin and ground. The 10K resistor R2 acts as a pull-up to keep the trigger high when the sensor is not illuminated.

In low light, the resistance of the photocell is high (>1M), so the trigger voltage is above 1/3 Vcc and the 555’s output is low. When bright light hits the sensor, its resistance drops, pulling the trigger low and causing the output to go high. The 1uF cap C1 provides a bit of delay to prevent spurious triggering.

The rest of the circuit is a standard 555 monostable timer. The relay is energized when the output is high, so the load will be on when the sensor is illuminated and off when dark.

To change the brightness threshold, you can vary the value of R2. A higher value will make the circuit trigger at a lower light level. Adding a small capacitor (100pF) in parallel with the photocell will slow down its response to changes in brightness.

For a more precise way to compensate for seasonal changes in day length and ambient light conditions, you could add a second photosensor to provide a reference level that subtracts from the main sensor:

[Differential light sensor schematic]

An op-amp is used to amplify the difference between the voltages from two matched CdS cells. The reference cell (R2) is exposed to ambient light but shielded from direct sun. The active cell (R1) is pointed at the sky. Potentiometer R4 sets the trigger threshold.

In dim conditions, the cells have similar resistance, so the op-amp output is low. When the active cell is exposed to bright sunlight, its resistance drops and the op-amp output goes high. The high/low transition triggers the 555 timer.

With some experimentation to find the right component values and sensor positioning, this circuit can provide fairly accurate sunrise/sunset triggering year-round.

Interval Timer

An interval timer switches the load on for a fixed time at regular intervals. This is useful for something like a plant watering or fish feeding system, where you want a brief on period repeated a few times per day.

A simple interval timer can be built with two 555s:

[Dual 555 interval timer schematic]

The first 555 is connected as a slow astable oscillator. Its output drives the trigger input of the second 555, which is wired as a monostable timer.

When the first timer’s output goes high, it triggers the second timer, which turns on the relay for a period set by R4 and C

CATEGORIES:

Uncategorized

Tags:

No responses yet

Leave a Reply

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

Latest Comments

No comments to show.