Tuesday 6 May 2014

Timer Circuits With 4060B


Build a reliable timer to switch devices on and off - from 30 seconds to 24 hours



There are many applications for which a timer is very useful to turn a device on or off automatically after a preset interval - for example, switching off an irrigationsystem after 30 minutes of use, turning off a battery charger to prevent overcharging, etc.

Timing short intervals of milliseconds to minutes can easily be achieved using a NE555 timer chip. Unfortunately, this device is not suitable for timing longer intervals, and so a suitable alternative is required.

Binary Counting with the 4060B


4060B CMOS IC

The 4060B (pictured above) is a CMOS binary counter. Using a resistor and a capacitor, the counting speed can be set by the user very easily. The pins of the 4060B integrated circuit output the running count in binary as shown below:

0 = 0000000000
1 = 0000000001
2 = 0000000010
3 = 0000000011
4 = 0000000100
5 = 0000000101
6 = 0000000110
7 = 0000000111
8 = 0000001000

Each of the binary 1's and 0's is called a bit (much as the numbers 0,1,2...8,9 are called digits in the decimal number system). The furthest right bit represents 1, the next to the left represents 2, the next represents 4, the next 8, the next 16 and so on doubling every time you move one position to the left. Therefore 000010000 is binary for 16, and 000100000 is binary for 32.

To keep things simple, let's assume the count is increased by one every second. The rightmost bit (the 1's bit) will be off for one second, on for one second, off for one second and so on...

0000000001, 0000000010, 0000000011

The fifth bit from the right (the 16's bit) is therefore off for 16 seconds (when the count is 0-15), then on for 16 seconds (when the count is 16-31), then off for 16 seconds (when the count is 32-47), and so on.

With this knowledge, we can make a very accurate timer utilising our 4060B binary counter chip. Let's say we want a 16 second timer: we start the 4060B counter from 0, and wait until the 16's bit goes from 0 to 1. At that exact time we know that 16 seconds have elapsed. Similarly if we start the counter again, and wait until the 32's bit goes from 0 to 1, we know that 32 seconds have elapsed.

A timer which can only time, 1, 2, 4, 8, 16, 32, 64, 128, and so on seconds would not be very useful, but since we can adjust the speed of the count, any time interval from seconds to 24+ hours can be accurately timed.

4060B Timer

A schematic of the 4060B chip is provided below:

schematic of the 4060B integrated circuit

The pins labelled in red Q4-Q14 are the binary outputs: Q4 for the 16's, Q5 for the 32's, Q6 for the 64's and so on up to Q13 for the 8192's, and Q14 for the 16384's.

Just three external components are required to control the 4060B counter - two resistors and one capactor. The frequency of the internal oscillator (i.e. the speed of the count) is set according to the equation given at the bottom of the schematic below:

The external components required to set the counting speed of the 4060B

Since Q14 represents the 16,384's and Q4 represents the 16's - we know it will take 1,024 times longer (16,384 / 16) for Q14 to flip from 0 to 1 than it takes Q4. So, for an example 2-hour timer (=7,200 seconds), we just need to fine-tune the circuit so that Q4 turns on after 7,200 / 1,024 seconds = 7.03 seconds, knowing that if that is done correctly, after exactly 2 hours Q14 will flip from 0 to 1.

24 hour timer circuit with the 4060B CMOS IC

The circuit shown above (from Ron J's Circuit Page) is a timer which energises a relay after a preset time has elapsed. It can be set to time an interval from 30 seconds to 24 hours.

The orange arrow labelled Range should be connected to a pin on the 4060B chip selected from the RANGE table. If for example, you require a timer to time 3 hours, connect it to pin number 1 on the chip since that pin corresponds to the time range 2hrs to 4hrs. 

3 hours is 10,800 seconds, and we are using the output from pin 1 to trigger the relay. Looking at the SETUP table entry for pin 1 we see that we divide our target time (10,800 seconds) by 256 to obtain the on/off time for the yellow LED at pin 7 = 42.28 seconds. Therefore, if we adjust the potentiometer R4 so that the yellow LED turns on after approximately 42 seconds, we'll know that the relay will be energised after approximately 3 hours.

Timer Circuit


The diode D1 makes this a one-shot timer. This means that after the programmed time delay of 3 hours, the relay will stay on until the circuit is reset. If the diode is omitted from the circuit then you get a repeating timer with the relay off for 3 hours, on for 3 hours, off for 3 hours, and so on until the circuit it reset.

To build a repeat timer with different ON/OFF durations based around the 4060B - for example, 1 hour OFF, 1 minute ON, 1 hour OFF, 1 minute ON etc - click here to read our article Repeat Timer Circuit.

Microcontrollers for Timers

We originally published this article back in 2006. Since then there has been a huge growth in the popularity of microcontrollers suitable for use by makers - for example PICAXE and Arduino, as well as the introduction of the Raspberry Pi.

Using microcontrollers enables complex devices to be made with minimal electronic components and soldering - the complexity is hidden away in the software you write and load onto the microcontroller. This makes it much faster and easier to prototype and make changes to your project.

Click here for our automatic PICAXE code generator for a repeating timer: Make a PICAXE Repeating Timer. All you need to do is put together the PICAXE prototype board, download the generated code to the microcontroller chip, and you will have a reliable repeating timer which you can easily re-programme as and when required without needing to get out your soldering iron again.

Buy a Timer Circuit

If you need a timer circuit for any application, email neil@reuk.co.uk with details of your exact requirements and we'll happily put together a bespoke solution.

REUK Super Timer 2 - Repeating Relay Timer

If you just need a general user-programmable repeating relay timer, then click here for details on our REUK Super Timer and REUK Super Timer 2 (pictured above). These are our popular fully built repeating relay timers which you can simply programme with independent ON and OFF durations from 1 second to 99 hours using a button.



ATTACHMENTS

Schematic Diagram No.1



These two circuits are multi-range timers offering periods of up to 24 hours and beyond. They can be used as repeating timers - or as single-shot timers. Both circuits are essentially the same. The main difference between them is their behaviour in single-shot mode. 

In single-shot mode - when the preset time has elapsed - Version 1 energizes the relay and Version 2 de-energizes the relay. The first uses less power while the timer is running - and the second uses less power after the timer has stopped. Pick the one that best suits your application. 


The Cmos 4060 is a 14-bit binary counter. However - only ten of those bits are connected to output pins. The remaining bits - Q1, Q2, Q3 and Q11 - do exist. You just can't reach them. 

The 4060 also has two inverters - connected in series across pins 11, 10 & 9. Together with R3, R4, R5 and C3 - they form a simple oscillator. 

While the oscillator is running - the 14-bit counter counts the number of oscillations - and the state of the count is reflected in the output pins. 

By adjusting R4 you can alter the frequency of the oscillator. So you can control the speed at which the count progresses. In other words - you can decide how long it will take for any given output pin to go high. 

When that pin goes high - it switches the transistor - and the transistor in turn operates the relay. 

In single-shot mode - the output pin does a second job. It uses D1 to disable the oscillator - so the count stops with the output pin high. 

If you want to use the timer in repeating mode - simply leave out D1. The count will carry on indefinitely. And the output pin will continue to switch the transistor on and off - at the same regular time intervals. 

The Stripboard Layout For 
The Cmos 24-Hour Timer No.2


Using "Trial and Error" to set a long time period would be very tedious. A better solution is to use the Setup tables provided - and calculate the time required for Pin 7 to go high. The Setup tables on both schematics are interchangeable. They're just two different ways of expressing the same equation. 

For example, if you want a period of 9 Hours - the Range table shows that you can use the output at Pin 2. You need Pin 2 to go high after 9 x 60 x 60 = 32 400 seconds. The Setup table tells you to divide this by 512 - giving about 63 seconds. Adjust R4 so that the Yellow LED lights 63 seconds after power is applied. This will give an output at Pin 2 after about 9 Hours. 

Important
Do not use the "on-board" relay to switch mains voltage. The board's layout does not offer sufficient isolation between the relay contacts and the low-voltage components. If you want to switch mains voltage - mount a suitably rated relay somewhere safe - Away From The Board


Schematic Diagram No.2


Ideally C3 should be non-polarized - but a regular electrolytic will work - provided it doesn't leak too badly in the reverse direction. Alternatively - you can simulate a non-polarized 10uF capacitor by connecting two 22uF capacitors back to back - as shown.

If you need a longer period than 24-hours - increase the value of C3.

The reset button is optional - but it should NOT be used during setup. The time it takes for the Yellow LED to light MUST be measured from the moment power is applied.

Although R1, R2 and the two LEDs help with the setup - they are not necessary to the operation of the timer. If you want to reduce the power consumption - disconnect them once you've completed the setup.

The timers were designed for a 12-volt supply. However - provided a suitable relay is used - both circuits will work at anything from 5 to 15-volts. Applying power starts the timer. And it can be reset at any time by a brief interruption of the power supply.

The Support Material for this circuit includes a step-by-step guide to the construction of the circuit-board - a parts list - a detailed circuit description - and more.


Veroboard Layout No.2




Monday 5 May 2014

A Very Useful Timed Beeper Circuit Schematic

PROJEK BOLEH CUBA....

A Very Useful Timed Beeper Circuit Schematic

Description

This circuit is intended for alerting purposes after a certain time is elapsed. It is suitable for table games requiring a fixed time to answer a question, or to move a piece etc. In this view it is a modern substitute for the old sandglass. Useful also for time control when children are brushing teeth (at least two minutes!), or in the kitchen, and so on.

Circuit diagram:


Circuit diagram


Parts:

  • R1 = 220R
  • R2 = 10M
  • R3 = 1M
  • R4 = 10K
  • R5 = 47K
  • C1 = 100nF-63V
  • C2 = 22µF-25V
  • D1 = 1N4148
  • D2 = 3mm. Red LED
  • Q1 = BC337
  • P1 = SPST Pushbutton (Start)
  • P2 = SPST Pushbutton (Reset)
  • PS = Piezo sounder (incorporating 3KHz oscillator)
  • B1 = 3V Battery (2 AA 1.5V Cells in series)
  • IC1 = CD4081 Quad 2 input AND Gate IC
  • IC2 = CD4060 14 stage ripple counter and oscillator IC
  • SW1 = 4 ways Switch (See notes)

Circuit operation:

Pushing on P1 resets IC2 that start oscillating at a frequency fixed by R3 & C1. With values shown, this frequency is around 4Hz. LED D2, driven by IC1A & B, flashing at the same oscillator frequency, will signal proper circuit operation. SW1 selects the appropriate pin of IC2 to adjust timing duration:
  • Position 1 = 15 seconds
  • Position 2 = 30 seconds
  • Position 3 = 1 minute
  • Position 4 = 2 minutes
When the selected pin of IC2 goes high, IC1C drives Q1 and the piezo sounder beeps intermittently at the same frequency of the LED. After around 7.5 seconds pin 4 of IC2 goes high and IC1D stops the oscillator through D1. If you want to stop counting in advance, push on P2.

Notes:

  1. SW1 can be any type of switch with the desired number of ways. If you want a single fixed timing duration, omit the switch and connect pins 9 & 13 of IC1 to the suitable pin of IC2.
  2. The circuit's reset is not immediate. Pushing P2 forces IC2 to oscillate very fast, but it takes some seconds to terminate the counting, especially if a high timer delay was chosen and the pushbutton is operated when the circuit was just starting. In order to speed the reset, try lowering the value of R5, but pay attention: too low a value can stop oscillation.
  3. Frequency operation varies with different brand names for IC2. E.g. Motorola's ICs run faster, therefore changing of C1 and/or R3 values may be necessary.
  4. You can also use pins 1, 2, 3 of IC2 to obtain timings of 8, 16 and 32 minutes respectively.
  5. An on-off switch is not provided because when off-state the circuit draws no significant current.

Safety Guard.. LITAR KESELAMATAN

Safety Guard

Description

Protect your home appliances from voltage spikes with this simple time delay circuit. Whenever power to the appliances is switched on or resumes after mains failure, the oscillator starts oscillating and D5 blinks. This continues for three minutes. After that, Q14 output of IC CD4060 goes high to trigger the gate of the SCR through D4. At this moment, the voltage is available at the cathode of the SCR, which energizes the relay coil to activate the appliance and D6 glows. Switch SW1 is used for quick start without waiting for delay.

Circuit Diagram:


Circuit Diagram

Parts:

  • R1 = 1M
  • R2 = 470R
  • R3 = 820R
  • R4 = 56K
  • R5 = 470R
  • R6 = 1K
  • R7 = 10K
  • C1 = 1kuF-25V
  • C2 = 100nF-63V
  • C3 = 0.02uF-63V
  • C4 = 10uF-25V
  • C5 = 10uF-25V
  • D1 = 1N4007
  • D2 = 1N4007
  • D3 = 1N4007
  • D4 = 1N4148
  • D5 = Red LEDs
  • D6 = Red LEDs
  • RL1 = 12V Relay
  • IC1 = AN7809
  • IC2 = CD4060
  • SW1 = Switch
  • T1 = 24V-AC Centre Tapped Transformer

Circuit Operation:

At the heart of the circuit is IC CD4060, which consists of two inverter gates for clock generation and a 14-bit binary ripple counter. Here the clock oscillations are governed by resistor R1 and capacitor C1. In this circuit, only two outputs of the IC (Q5 and Q14) have been used. Q5 is connected to an LED (D5) and Q14 is used to trigger the gate of the SCR through D4 as well as reset the counter. The anode of the SCR is connected to +9V and the cathode is connected to the relay coil. The other pin of the relay coil is connected to the negative supply, while its contacts are used for switching on the appliances.



How to Understand IC 4017 Pin Outs - Explained in Simple Words

NOTA RUJUKAN....


How to Understand IC 4017 Pin Outs - Explained in Simple Words

The IC 4017 can be considered as one of the most useful and versatile chip having numerous electronic circuit applications. Technically it is called the Johnsons 10 stage decade counter divider.

The name suggest two things, it’s something to do with number 10 and counting/dividing.

The number 10 is connected with the number of outputs this IC has, and these outputs become high in sequence in response to every high clock pulse applied at its input clock pin out. It means, all its 10 outputs will go through one cycle of high output sequencing from start to finish in response to 10 clocks received at its input.

So in a way it is counting and also dividing the input clock by 10 and hence the name.



Let’s understand the pin outs of the IC 4017 in details and from a newcomer’s point of view:

Looking at the figure we see that the device is a 16 pin DIL IC, the pin out numbers are indicated in the diagram with their assignment names.

The pin out which are marked as output are the pins which become logic high one after the other in sequence, meaning the first in the order is 3, so this pin is the one which first becomes high, then it shuts off and simultaneously the next pin #2 becomes, then this pin goes low and simultaneously the preceding pin #4 becomes high and so on until the last pin #11 becomes high and reverts to pin #3 to repeat the cycle.

Please note that the word “high” means a positive voltage that may be equal to the supply voltage of the IC, so when I say the outputs become high in a sequential manner means the outputs produce a positive voltage which shifts in a sequential manner from one output pin to the next, in a “running” DOT manner.

Now the above sequencing or shifting of the output logic from zero to high and back to zero, happens only when a clock signal is applied to the clock input of the IC which is pin #14.

Mind you, if the no clock is applied to this input, it must be assigned either to a positive supply or a negative supply, but should never be kept hanging or unconnected, as per the standard rules for all CMOS inputs.

The clock input pin #14 only responds to positive clocks or a positive signal and with each consequent positive peak signal, the output of the IC shifts or becomes high in sequence, the sequencing of the outputs are in the order of pin outs #3, 2, 4, 7, 10, 1, 5, 6, 9, 11.

Pin #13 may be considered as the opposite of pin #14 and this pin out will respond to negative peak signals, if a clock is applied to this pin, producing the same results with the outputs as discussed above.

 However normally this pin out is never used for applying the clock signals, instead pin #14 is taken as the standard clock input.

However, pin #13 needs to be assigned a ground potential, that means, must be connected to the ground for enabling the IC to function. In case pin #13 is connected to positive, the whole IC will stall and the outputs will stop sequencing and stop responding to any clock signal applied at pin #14.

Pin #15 of the IC is the reset pin input. The function of this pin is to revert the sequence back to the initial state in response to a positive potential or supply voltage, meaning the sequencing comes back to pin #3 and begins the cycle afresh, if a momentary positive supply is applied to pin #15. 

If the positive supply is held connected to this pin #15, again stalls the output from sequencing and the output clamps to pin #3 making this pin-out high and fixed.

Therefore to make the IC function, pin #15 should always be connected to ground. If this pin out is intended to be used as a reset input, then it may be clamped to ground with a series resistor of 100K or any other high value, so that a positive supply now can be freely introduced to it, whenever the IC is required to be reset.

Pin #8 is the ground pin and must be connected to the negative of the supply, while pin #16 is the positive and should be terminated to the positive of the voltage supply.

Pin #12 is the carry out, and is irrelevant unless many ICs are connected in series, we will discuss it some other day. Pin #12 can be left open.

IC 4047 Datasheet, Pinouts, Application Notes

SEBAGAI NOTA....


IC 4047 Datasheet, Pinouts, Application Notes

The IC 4047 is one of those devices which promises an unlimited range of circuit application solutions. The IC is so versatile that on many occasions it easily outsmarts it's close rival, the IC 555, let's study the datasheet and pinout details of this versatile chip.


Main Datasheet and Specifications of the IC 4047:

In-built oscillator with variable frequency option through an external RC network.

Complementary push-pull outputs with a separate active clock output, the clock output is actually an extension of the internal oscillator frequency output.

Duty cycle locked to 50% for precision, fail proof operation of the external stages.

The IC 4047 can be configured as a free running astable MV, and also as a monostable MV.

In the astable mode the chip provides the option of integrating external triggering inputs, also called true gating and compliment gating modes.

The monostable mode enables positive edge triggering as well as negative edge triggering of the IC. It further alows retriggerable feature for extending the output timing to the desired calculated level. Meaning after the normal trigger is applied to the IC, more number subsequent triggers can be applied so that the output adds up the timing, generating further delay at the output.

The following explanation suggests how the pinouts of the IC 4047 may be configured for implementing the above discussed operating modes:

 In the free running astable mode, connect pins 4, 5, 6, 14 to positive or Vdd, connect pins 7, 8, 9, 12 to ground or Vss.

In gated astable mode connect pins 4, 6, 14 to positive or Vdd, connect pins 7, 8, 9, 12 to ground or Vss, connect pin 5 to the reset pin of the external trigger IC, while output of the external chip to pin 4 of the IC 4047.

For the above modes, the output may be obtained across pin 10, 11 (push-pull) while clocks at pin 13.

In positive trigger monostable mode, connect pins 4, 14 to positive or Vdd, connect pins 5, 6, 7, 9, 12 to ground or Vss, connect pin 8 to the reset pin of the external trigger IC, while output of the external chip to pin 6 of the IC 4047.

For the above modes, the output may be obtained across pin 10, 11.

Fundamental Free Running Astable Mode Circuit Diagram Using IC 4047



As shown in the figure above, the IC 4047 can be used as a free running astable multivibrator or oscillator by configuring the chip in the above suggested method.

Here R1, P1 and C1 determine the oscillator frequency of the IC and the output at pin10, 11 and 13.

Basically R1, P1 togeter must not be less than 10K, and above 1M, while C1 should not be less than 100pF (higher value have no restrictions) in order to maintain proper functioning of the chip.

Pin 10 and 11 are complementary outputs which behave in a  push-pull manner, meaning when pin10 is high pin11 is low and vice versa.

Pin 13 is the clock output of the IC 4047, each high pulse measured at this output enables pin10/11 to change positions with their logic levels, while low logics does not influence any response on pin10/11.

Pin13 is normally kept open when not in use, it may be applied in cases where a frequency or pulsed output may be required for the other stages of the circuit for enhancing purposes, such as for making modified PWM based inverters etc.

Application Notes:

The IC is best suited for all types of inverter, converter, SMPS and timer applications.

One typical simple square wave inverter application using the IC 4047 can be witnessed below:




The formula for calculating the frequency or the RC components are:

f = 1/8.8RC at pin10 and 11

f = 1/4.4RC at pin 13

Where f is in Hz, R in Ohms and C in Farads.

Pulse time may be obtained by solving:

t = 2.48RC where t is in seconds, R in Ohms and C in Farads

WIRING ASAS TIMER 24JAM - HAGER

WIRING ASAS TIMER 24JAM - HAGER

12VDC power supply

12V/120mA switch mode power supply circuit.

Transformer less switch mode power supplies have become very popular these days. The circuit shown below is of a 12V/120mA output, 85 to 230V AC input transformerless switch mode power supply using LNK304 IC. Applications of a power supply based on this IC includes hand held devices, timers, small appliances, LED drivers, industrial gadgets etc.
LNK304 is a low component count, efficient off-line switcher IC that can support buck, buck-boost and flyback topologies. The IC has a built in auto start circuit for short circuit and open loop fault protection. Other features of LNK304 includes low temperature variation, thermal shut down,high break down voltage, good line & load regulation, high band width , wide input voltage range (85 to 230V AC) etc. In general the LNK304 has a better performance when compared to the many other discrete buck regulators.


LNK304 pin configuration and typical application
The pin configuration and the typical application diagram of LNK304 are shown above. Drain (D) pin the drain connection of the built in power MOSFET. The external by pass capacitor (0.1uF) is connected to the BYPASS (BP) terminal. FEEDBACK (FB) pin controls the switching of the built in power MOSFET. A current above than 49uA delivered to this pin will inhibit the switching. The internal power MOSFETs source is connected to the SOURCE (S) pin.

LNK304 based switch mode power supply circuit.

12V switch mode power supply
12V /120 switch mode power supply circuit
The circuit diagram of a practical 12V/120mA transformerless switch mode power supply is shown above. Resistor R1, capacitors C1 and C2, diodes D1 and D2 and inductor L1 forms the input stage. D1 and D2 forms the rectifier section while C1 and C2 are input filters. Resistor R1 which is a fusible resistor limits the inrush current, increases differential mode noise attenuation and also serves as an input safety fuse.
The next stage is the regulator stage which consists of IC LNK304, diodes D3 and D4, capacitors C3, C4 and C5, resistors R3, R4 and R5 and inductor L2. D3 is the freewheeling diode while L2 is the output choke. C5 is the output filter capacitor which limits the output ripple voltage to a value as low as possible. The IC LNK304 is so configured that the power supply operated in the most discontinuous mode and that’s why a fast recovery diode (UF4005) is used as the freewheeling diode (D3). UF4005 has a reverse recovery time of around 75nS and it is well enough for the given situation.
The voltage drop across diodes D3 and D4 are practically same and so the voltage across C4 tracks the output voltage and this voltage is picked by the network comprising of resistors R2, R3 and is fed to the feedback pin. R2 and R3 sets the output voltage and for 12V output the voltage at the feedback pin must be 1.65V DC. The circuit attains regulation by skipping the switching cycles. When the output voltage rise, the current at the feedback pin also rises and when the current rises above the threshold value, subsequent cycles are skipped until the current at the feedback pin goes below the threshold and thus a constant output voltage is maintained.
The IC will auto restart if no cycles are skipped during a 50mS time period and this limits the maximum output power to 6% of the maximum over load power. That’s how over load protection is attained. Resistor R4 serves as a small preload which nullifies the effects of tracking error.

Notes.

  • Assemble the circuit on a good quality PCB.
  • LNK304 is a very high efficiency switching regulator IC that has a hand full of applications.
  • LNK304 is commonly available in SMD package (DIP is also available) and care must be taken while soldering it.
  • D1 and D2 are standard 1N4007 silicon rectifier diodes.
  • D3 (UF4005) is a fast recovery diode.
  • D4 (1N4005GP) is a glass passivated diode.
  • C3 can be a ceramic capacitor.
  • C1,C2 and C4 are polyester capacitors.
  • C5 can be electrolytic or polyester capacitor.
  • Voltage ratings of the capacitors are shown in the circuit diagram.
  • R1 is a fusible, fire proof resistor.
  • Maximum possible output current is 120mA.
  • Input voltage range is 85 to 230V AC.

Few switching regulator circuits that may be useful to you.

  1. 3A Switching regulator : A simple 3 ampere switching regulator circuit designed based on the popular LM317K IC. Output voltage range is 1.8 to 32V DC and it can be adjusted using a POT. Input voltage range is from 8 to 35V DC.
  2. 5V buck regulator: A buck regulator is a regulator which produces output voltage less than the input voltage. This circuit uses the famous LM2678 from Natinal Semiconductors. The circuit produces a steady 5V@ 5A from an input voltage range of 8 to 40V DC.
  3. 1oV switching regulator: A 10V buck regulator using the IC LM5007 from National Semiconductors.Input voltage range can be from 12V to 72V DC. Its output voltage can be also adjusted.