4060 chip for seconds and hours

Discussion in 'The Projects Forum' started by Danielpalfrey, Mar 29, 2016.

  1. Danielpalfrey

    Thread Starter Member

    Mar 29, 2016
    75
    3
    OK. I am working on designing and building an automatic irrigation system for a propergator. It should activate for 6 seconds every 6 hours.

    Is this possible to do with the above chip? I have never used this chip before so I'll be needing to do a lot of research but one thing that keeps cropping up is the use of a relay? I honestly thought the chip could do this?

    Thanks for any help

    Dan
     
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,984
    3,722

    How accurately do you need your 6 seconds to be?
    (a) +/- 0.01 second
    (b) +/- 0.1 second
    (c) +/- 1 second

    How accurately do you need your six hours
    (a) +/- 2 seconds,
    (b) +/- 20 seconds
    (c) +/- 3 minutes
    (d) +/- 30 minutes


    Also, do these times need to be 6 seconds and 6 hours or can they be some other consistent interval? And, do you mean 6 hours between starts of the 6 second time (5h 59m 54sec between runs) or do you need six hours off and 6 seconds on?

    NOTE, a little chip like the CD4060 can only drive about 10 mA (maybe less, check the datasheet). A motor, or relay will need more current than the few milliamps the chip can drive without burning out the chip.
     
  3. DickCappels

    Moderator

    Aug 21, 2008
    2,647
    632
    Yes, but you will need some decoding.

    The drip/sprinkler timer below runs for 34 minutes every 24 hours.

    [​IMG]
    Below is a brief description of the circuit.

    The Circuit
    CMOS 24.055 Hour Timer
    The resulting timer circuit is made from a CD4060, includes an oscillator and a 14 stage binary counter, two CD4040's, which are 12 stage binary counters, a CD4012 Dual Nand gate and a CD4013 Dual D Latch.

    The CD4060 is connected to a 32768 Hz ECS 3X8 tuning form crystal. The 10 Meg Ohm resistor between CD4060 pins 10 and 11 are to bias the internal inverter into its analog region, and the 330 K resistor in series with the crystal is to limit the power to the crystal. This setup is directly from the ECS data sheet. The output of the 14th flip flop in the CD4060 appears on pin 3, and it is a 2 Hz square wave. A 2N4401 buffer drives a green LED with this square wave. When I see it blinking through the plastic window of the Irrigation System Controller housing, I know that power is on, and that at least the oscillator and first 14 counter stages are working.

    The CD4040's that follow the CD40406 divide the 2 Hz pulses to get the 24 hour cycle and the 34 minute watering period. When the counter counts up to 24.0355 hours, as decoded by the CD4012, both of the CD4040's are reset and the output of the CD4013 (pin 1) is set high to turn on the valve solenoid. To get a wide enough pulse to assure that all of the flip-flops inside the CD4040's are reset, the reset pulse from CD4012 pin 13 is passed through a low pass filter made of a 10k resistor and a 6 pf capacitor.

    A momentary push button, labeled "Resync" is connected to the output of the 10k and 6 pf low pass filter. When the button is pressed, it pulls the reset inputs of the CD4040's and the clock input of the CD4013 high to start a 24 hour timing cycle. The additional l0k resistor in series with the output of the 10k and 6pf low pass filter it to further limit current from the pushbutton to the input of the CD4012, which normally spends all but a few microseconds each day sitting at ground. I use the Resync button to set the time of day that the watering cycle starts.

    The CD4013 latch, the output of which (pin 1) goes high to turn on the valve , is reset 34 minutes after the CD4040's are reset, thus turning off the valve . The pulse to turn off the valve 34 minutes after the watering cycle starts, appears on Q1 of the second CD4040. If I wanted to the watering period to be 68.264 minutes, I would use Q2 (pin 7) of the second CD4040. If I wanted 16 minutes, I would have used Q12 of the first CD4040. Moving the connection to the reset input of the CD4013 (pin 4) one flip-flop to the left in the CD4040 counter chain cuts the watering period in half. Moving the connection to the right one flip-flop doubles the watering period.

    Valve Solenoid Power Control

    A full-wave bridge rectifier is placed effectively in series with the 24 VAC from the power transformer and the watering valve. The AC signal passes through the AC terminals of the bridge, while the negative terminal is connected to chassis ground and the positive terminal is connected to the drain of a BUZ-73 MOSFET. While the BUZ-73 is off, current does not pass though the valve, and the water is off. When the output of the CD4013 (pin 1) goes high, turning on the BUZ-73, current also passes through the AC terminals of the diode bridge and through the valve solenoid.

    The gate of the BUZ73 is connected to the output of the CD4013 (pin 1) through two switches, which allow me set valve solenoid OFF, ON, or connected to the daily watering cycle timer. This last position is the normal operating position. The OFF and ON positions are for maintenance and troubleshooting. The output of the two switches also connects to a 2N4401 buffer, a dropping resistor, and a yellow LED. The yellow LED is on whenever the valve solenoid is on. A 100k resistor connects the gate of the BUZ-73 to chassis ground to keep the gate from floating in case one of the switches does not get slid all the way to one position or another, on in case a switch becomes intermittent. T

    There are two series connected 14 VAC metal oxide varistors across the AC terminals of the diode bridge and another pair of series connected 14 VAC metal oxide varistors across the drain and source of the BUZ-73 MOSFET. The purpose of these metal oxide varistors is to protect the diode bridge and the BUZ-73 MOSFET from voltage surges that might appear in either the AC line or the wiring to the valve solenoid. We get a lot of lightning here.

    A 1k resistor between the gate of the BUZ-73 MOSFET and the rest of the circuit limits current that might capacitvely couple from a fast rising voltage spike on the drain of the FET to the gate. A zener diode from the gate to ground will limit the gate voltage in the case of such a voltage spike. The .015 mircofarad mylar film capacitor across the drain and source of the BUZ-73 MOSFET is there to reduce the amplitude of induced spikes.


    5.1 Volt Zener Power Supply

    One end of the 24VAC power transformer secondary connects to chassis ground through one of the diodes in the full wave diode bridge when that end of the transformer secondary swings through the negative half of the power supply line cycle. At the same time, the other end of the secondary swings positive. The voltage on this second end of the transformer secondary is rectified by a 1N4007, and passed through a 728 Ohm 2 Watt resistor to supply current to the sprinkler timer circuit. A zener diode limits the voltage at this point to 5.1 volts. Three 220 microfarad capacitors mounted around the circuit board provide plenty of filtration so that there is negligible ripple on the 5.1 volt power supply.
     
    Willen, absf and Sinus23 like this.
  4. Danielpalfrey

    Thread Starter Member

    Mar 29, 2016
    75
    3
    I am not to worried about the times I'll allow 30 mins on the 6 hours and then 10 secs max on the 6 second. Yes that is what I meant 6hours between starts of the 6 second time.

    How do I get around the ma issue?
     
  5. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,969
    744
    Here's a repeating timer using a cd4060 R8, C2 set the on time (6seconds) the long time period is set using the desired output pin, R3,R4, C3.
     
    Last edited: Mar 29, 2016
  6. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,984
    3,722
    That is the easy part. A MOSFET transistor will convert your ON and OFF of your CD4060 (or what ever additional "glue logic" chips that are needed to get your timing result) to the necessary current handling needs of your valves.

    Cheers.
     
  7. Danielpalfrey

    Thread Starter Member

    Mar 29, 2016
    75
    3
    I was thinking of using a pnp to activate the circuit for the motor. Or an npn always get mixes up between these two
     
  8. Danielpalfrey

    Thread Starter Member

    Mar 29, 2016
    75
    3
    Excellent information here. I did forget to mention that this is a 12v set up. Leisure battery charges via solar panel. Pump is also 12v
     
  9. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,969
    744
    The cd4060 will work from 5 to 15v.
     
  10. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,984
    3,722
    Lets worry about the cheap but more complicated logic chips and timer first, then the power (P-Channel MOSFET, PNP transistor or Relay or a combination) can all be figured out after that.
     
  11. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    12 V DC means the output of the timer can drive directly either an n- or p-channel power MOSFET to power the irrigation device. If you already have a bipolar transistor you want to use, that is an easy adjustment. but CMOS parts love to drive MOSFETs.

    With those tolerances, the timer is a pretty simple circuit. 1 event in 6 hours is one part in 21,600 seconds. It would be easier if the ratio were an even binary ratio like 16,384 or 32,768, but the decoding still is pretty direct. Actually, since the 4060 has an oscillator built in, consider this: If you adjust the 4060 oscillator to 0.759 Hz (I know, not easy), then the Q14 output bit will cycle once every 6 hours. Unfortunately, the first few bits of the counter are not brought out to pins, so bit 3, which is high for 10.5 seconds, is not available. Also, if you adjust the oscillator such that the first available output, Q4, cycles every 12 seconds (6 seconds high and 6 seconds low), the Q14 output cycles every 12,288 seconds which is only 3.4 hours. So to do the task with only one 4060 you will need for the 4060 oscillator to be set to a very low frequency *and* the Q14 output drives an external monostable timer to make the 6 second output pulse to drive your irrigation device. Not a problem, people on this forum *love* the 555 timer chip.

    One drawback to this approach is the very slow oscillator frequency needed. Even with your +/-30 minute tolerance, something between 1.21 Hz and 1.43 Hz is not an easy number to adjust to, and requires a relatively large timing capacitor that will increase the circuit's frequency drift with changes in temperature. If you connect two 4060's in series, things improve. First, you can have higher frequency oscillator components that are more stable. Second, you can decode the 6-second ON time directly from the counter. Third, you can get rid of the oscillator altogether and use the 60 Hz power line as the timing clock (if available).

    Also, pre-made timer modules to do this are on ebay for under $6, but where's the fun?

    ak
     
    Last edited: Mar 29, 2016
    absf likes this.
  12. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,984
    3,722
    An XR2240 is essentially like a CD4060 but, instead of having a bunch of outputs with divide by 2^n, you can set a bunch of inputs that allow division by any number from 1 to 256. An RC pair makes an astable oscillator. A 555 monostable can be used to time the 6 seconds. Tying the inputs of the XR2240 high or low will determine the divide-by on the output of that a-stable oscillator. All done with two chips (xr2240 and a 555). Check the datasheet for the proper R and C selection for an 8.2 second cycle. 8.2 seconds x 256 = 6 hours.

    If the OP needs an XR2240 chip, I will gladly send one his way if he is in the US (otherwise, they are available on eBay).
     
    atferrari likes this.
  13. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    8.2 x 256 = 2099.2 seconds, or 35 minutes. With an XR2240, the timebase would have to be 84.375 seconds, or 0.01185 Hz, for an output period of 6 hours.

    With the 4060, 0.759 Hz equals a 1.381 second cycle. x 16384 (2^14) = 21600 s, or 6 h. Still a 2-chip solution. 0.759 Hz is a very low frequency for a CMOS oscillator, but still much better than 0.012 Hz.

    A better alternative would be the CD4521, which is a 24-bit counter. You still would need an external 555 or some other 6-second timer, but the timebase would be 776.7 Hz, a much easier frequency to achieve with reasonable accuracy and stability. Again, still a 2-chip solution

    For the true digital loony, an all-digital solution is a CD4521 with a watch crystal setting an accurate timebase, followed by a 5-bit counter of any flavor (like a CD4024) to get enough bits to reach 6 hours. Decoding 6 seconds requires either a few signal diodes or a 4011 quad NAND gate to make an output Set-Reset flipflop. So three chips, no adjustments, crystal accuracy and stability.

    ak
     
    Last edited: Mar 29, 2016
    GopherT likes this.
  14. Danielpalfrey

    Thread Starter Member

    Mar 29, 2016
    75
    3
    Ok, I have got a bag of 4060's coming, I have no other chips available at this time so might try connecting a pair in serial, but I have no idea how to do this?
     
  15. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,984
    3,722
    Oops, I slipped a decimal point. Good catch.
     
  16. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,984
    3,722
    What else do you have in terms of electronics as a hobby? breadboards & jumper wires? PCB prototyping? What is your plan to put these chips together and make a device that you can count on?

    Also, before you plug it in and walk away, some things to consider are...
    Imagine the worst case of the device not turning off, is this an indoor device or outdoor? If indoor, what kind of safety over-ride do you plan to use? Are there any issues in your insurance policy about experimental (non-UL listed) devices? Is water damage is covered by your insurance? are your floor drains working?
     
  17. Danielpalfrey

    Thread Starter Member

    Mar 29, 2016
    75
    3
    I will be using a pretentionar so there is a little adjustment for lets say the summer months, more frequent watering may be necessary, But I can do this, already found a good schematic to help with this one
     
  18. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    First chip - oscillator connections and components per datasheet schematic and equation. Output is pin 3, Q14.
    Second chip, input is pin 11. Pins 9 and 10 are not connected.

    ak
     
  19. Danielpalfrey

    Thread Starter Member

    Mar 29, 2016
    75
    3
    No safety features have yet been thought out, I use pcb prototype. I have a collection of resistors and capacitors, PNP, transistors and the 4060 chips I ordered
     
  20. Danielpalfrey

    Thread Starter Member

    Mar 29, 2016
    75
    3
    So, just to clarify Some information Some from here some from google

    Live = Pin 16
    Ground = 8

    To connect in Serial

    Output (Chip 1) = Pin 3

    Input (Chip 2) = Pin 11

    Is this correct?
     
Loading...