24 VAC adjustable timer circuit

Thread Starter

JCapron

Joined Jul 4, 2016
11
I am attempting to design an adjustable time delay circuit that will energize a relay after an adjustable delay of 1 to 5 minutes. It will be used in a control system that uses 24 VAC power, which is a standard in the heating and cooling industries.

My rough parts list looks like this:
(a) An LM555 timer and associated RC components. The timer has to be latching, with two LEDs - one to indicate initiation of the countdown window and one to indicate the latched alarm condition at the end of the countdown window. A momentary push button will reset the timer.
(b) Qty 3 (or maybe 4) power relays, PCB type, Omron G2R-2DC12 or equal, with diodes. The relays are needed to connect to the real world building controls. Each relay coil is rated at approximately 0.52 W. At least one of the relays will have 24 VAC coil from an external source.
(c) A power supply circuit to get to 12 VDC for the rest of the circuit. I am having trouble sourcing a PCB step down power transformer and I have no experience in the design of a step down circuit using an IC. I tried to use the TI design tool for the LM2596 without success.
(d) A PCB for all the above, with thru hole wiring terminal blocks. Also required for real world interface.
(e) A DIN rail mounted case to house the PCB and mount the PB and LEDs.

I have bread boarded the timer circuit with an adjustable potentiometer. However, that approach will not be acceptable in the field because it takes too much time to set the pot and time the result. So I am thinking that I could replace pot with a dip switch and fixed resistors. The circuit would have to be able to set the time from one minute to five minutes in approximately 30 second steps. The accuracy would have to within + or - 5 seconds for the DIP switch to be acceptable.

Any advice on this approach would be appreciated.
 

crutschow

Joined Mar 14, 2008
34,431
The accuracy would have to within + or - 5 seconds for the DIP switch to be acceptable.
That accuracy is problematic with a 555 circuit.
You'd likely have to calibrate each time interval, and you probably do not want to do that.

You could go with a digital approach using a counter such as this.

Are you at all familiar with programming (?), because a single-chip microcontroller is another alternate approach that could likely do all the timing.
 

AnalogKid

Joined Aug 1, 2013
11,043
1 minute to 5 minutes in 30 second steps smells like a CD4017:

32.768 kHz pre-packaged crystal oscillator (why bother with a crystal circuit when oscillators are so cheap?)
CD4521 24-stage counter/oscillator - pick off the 32 second tap
CD4017 Johnson counter
10 position DIP switch - select only 1 position at a time
Transistors to drive the LEDs and relays
Reset switch

What initiates the time sequence?

If you go with 32 seconds per tap, the accuracy is way better than 1%. If you really want 30 seconds per tap, then you have to go with an RC oscillator (same chip) and adjust it. Even with 1% R and C, the transition levels in the CMOS oscillator gates are not tightly controlled to within a few %.

Or, as Wally noted, all of this fits in a 16-20 pin PIC.

ak
 

Thread Starter

JCapron

Joined Jul 4, 2016
11
Unfortunately, the 4060 timer suggested by Crutschow only has a range of 1 to 3 minutes or 4 to 6 minutes. I could use 0 to 5 or 6 minutes but not the other two. I have only programmed some Fortran in college but I would not be adverse to trying to learn enough C or C++ if it was not too complex. I am considering another GPS project, so I will have to go there anyway.

AnalogKid's suggestion with 32 second stages sounds interesting. I will look at those parts to see how all that goes together. I will likely be back with further questions.

The time sequence is initiated by an external safety to protect the equipment from freezing. On equipment startup, or on a stepped transition in operating conditions, the safety may trip. If it resets within the time limit, all is good. However, if the freeze condition is sensed for more than the specified time period (usually 2 to 3 minutes), the equipment is shut down and locked out. The operator has to check out the equipment before he or she allows the unit to operate by hitting the reset button.
 

AnalogKid

Joined Aug 1, 2013
11,043
Unfortunately, the 4060 timer suggested by Crutschow only has a range of 1 to 3 minutes or 4 to 6 minutes.
Not correct. That circuit was suggested as something to be modified to your needs. The 4060 has a count range from 1 to 16,384 clock cycles (14 bits). Adjusting the clock frequency (changing R3, R4, R5 and/or C3 to other component values) adjusts the real-time range of the outputs. In fact the CD4521 basically is an expanded version of the 4060. It is a 24-bit counter with only the last 7 bits brought out. If it didn't exist, I'd have suggested two 4060's in series.

And above, the 4521 output counts in 32 second ticks only if the oscillator uses a commonly available watch crystal.Going back to two 4060's in series, there are crystal frequencies that will yield something very close to a 30 second tick.

ak
 

crutschow

Joined Mar 14, 2008
34,431
Unfortunately, the 4060 timer suggested by Crutschow only has a range of 1 to 3 minutes or 4 to 6 minutes.
You have to add some additional gates.
Here's how it works:
  • You Adjust R4 to give a clock period of 3.75s which gives a timeout of 30s at pin 7
  • For a 30s timeout, select pin 7 output.
  • For 1 minute, select pin 5 output.
  • For 1.5 minute, AND pin 5 and pin 7 and select that output.
  • For 2 min, select pin 4 output.
  • For 3 min, AND pin 4 and pin 5, and select that output.
  • For 4 min. select pin 6 output.
  • For 4.5 min, AND pin 4 and pin 7, and select that output.
  • For 5 min. AND pin 5 and pin 6 and select that output.
By select I mean connect that output to where the "Range" arrow is shown on the schematic.

You need just one quad CD4081 package for the 4 AND gate functions.

Make sense?
 

Sensacell

Joined Jun 19, 2012
3,447
It really wants to be done with an MCU.

Cost- the MCU can be had for $1.00

Parts count is minimal

Accuracy - most internal MCU oscillators are 1% accurate - for zero cost

The discrete CMOS logic approach is workable, but so much more difficult and complicated.
 

JohnInTX

Joined Jun 26, 2012
4,787

AnalogKid

Joined Aug 1, 2013
11,043
The discrete CMOS logic approach is workable, but so much more difficult and complicated.
No, it isn't. It is so easy it is the only sensible approach, based on the posts in this thread.

I agree that a uC is a good way to go, IF you have the time and money, but you have *way* undersold the difficulties of a first uC project. The discrete logic approach can be up and running on a solderless proto board in less than 1 hour. There is no way a beginner (post #1, post #4) could read about and understand a PIC's I/O configuration registers in that time, let alone write the code to initialize them correctly - - - on a brand new compiler for a programming language he has never written anything in, ever. And after those days he still has to write the code that does the actual job. The datasheet for a small PIC or AVR is what, 100 pages? 150? For an 18 pin part? That is a good working definition of difficult and complicated. Code that doesn't crash and code that is safe to control someone else's refrigeration equipment are two very different things.

ak
 

Sensacell

Joined Jun 19, 2012
3,447
No, it isn't. It is so easy it is the only sensible approach, based on the posts in this thread.

I agree that a uC is a good way to go, IF you have the time and money, but you have *way* undersold the difficulties of a first uC project.

ak
I concur that the learning curve for an MCU is steep.

What we don't know is how many of these things are going to get made- if it's a product, I would be embarrassed to sell a device based on a 1980's design approach, but if it's a one-off, the story is different.
 

AnalogKid

Joined Aug 1, 2013
11,043
It's 1960's technology, and proud of it. While at Fairchild Semiconductor, Frank Wanlass wrote a paper describing CMOS in 1962, and patented the idea in 1963. Fairchild didn't pursue the idea, but RCA was desperate to show they still were as good as those uppity newcomers, TI and their TTL. Albert Medwin bought into CMOS big time, and his group introduced the first gates in 1968.

Embarrassed? Not even close. My MIL customers are quite happy that things I designed for them over those decades, including this decade, still work.

And, be careful who you dis. While you used "1980's" as a term of disparagement, remember, young'un, that the PIC was introduced in 1976. Why anyone would put that ancient piece of crap in something as wizzy as a sports car key fob is completely beyond ... What? Who? Accura? Lexus? Corvette?

ak
 

Thread Starter

JCapron

Joined Jul 4, 2016
11
Thanks for all the comments and suggestions. I took a look at a PIC solution but I worry about the quality of the power in commercial buildings. We often have to install recovery mechanisms for microprocessors that locked up after a brownout or thunderstorm. Besides, a PIC solutions would still need the power supply and relay interfaces, so I am not sure the parts count would be that much less.

I have taken Crutschow's and AnalogKid's suggestions and I think I have worked through the math and logic. I have also incorporated a much easier way to set up the timer in the field. The timing circuit now includes a 32,768 xtal -> cascaded 4040's to get to a 1 second pulse -> 4017 counter to get a 10 second pulse -> a TI CD40102BE (presettable down counter), which I think can be "preset" via two rotary BCD switches. My thinking is that with this setup, the commissioning of the timer in the field will be a lot quicker. The two rotary switches would preset the down counter to the number of 10 second intervals before the timer would trip and lock (via the relays), e.g., a setting of 15 (decimal) would give a 150 second delay, or 2.5 minutes.

I have attached a very rough schematic layout file. Trying to learn how to draw shapes in KiCad has slowed the project considerably. That is why I stopped to get your opinions on whether this approach is at all feasible. I hope this makes sense. The schematic is missing a lot of components, so I hope the concept makes sense.
 

Attachments

crutschow

Joined Mar 14, 2008
34,431
I don't understand the Reset connections of the two 4017 counters.
What are the two unconnected capacitors on the left for?

Also never leave any unused inputs open.
They must be connected to ground or V+ as appropriate.
 

AnalogKid

Joined Aug 1, 2013
11,043
A 4040 cannot operate with a bare crystal, only an external crystal oscillator. However, a 4060 can use a bare crystal, as shown on its datasheet. That plus 1/2 of a 4013 D flipflop gets you 1 Hz. Or, one 4060 plus one 4024 plus two diodes and one resistor gets you 0.1 Hz without the additional 4017.

Think through the down-counter operation. Remember that "0" is a valid count state. If you are relying on the counter's internal borrow/carry logic to give you an end-of-cycle flag, it might be off by one count (10 seconds).

ak
 

Thread Starter

JCapron

Joined Jul 4, 2016
11
Rev 3. Hopefully, this is nearly ready for breadboarding. A copy of the latest schematic is attached. Any advice is appreciated.

The application has been extended to accommodate more precise timing up to approximately 5 minutes via a 4 pole DIP switch selector with 0.5, 1.0, 2.0 and 3.0 second steps. The BCD encoders allow for 99 steps. If the timing range is low, smaller steps is more accurate. This is a significant leap from my original 555 timer, but should allow very little setup time in the field.

Still unresolved is the statement by AnalogKid that the 40102 down counter can be off by one count (now only 3 seconds). I spent quite a bit of time trying to research a fix for that issue. I am guessing at a latching circuit using 1/4 of a 4011 might be able to delay the output until the clock signal was high. Does this approach look right? I am certainly in over my head.

I plan to bench test the circuit with a 12 VDC power supply. I will then know the power requirements exactly in order to design the 24 VAC to 12 VDC supply.
 

Attachments

Bordodynov

Joined May 20, 2015
3,179
Hey. If you did many similar timers, then I would recommend using the CSS555C chip.
Unfortunately I do not know where you can buy single copies. Those vendors that sell this chip do not want to deal with buyers for a total purchase amount of less than $ 300. True, they sell everything.
CSS555C.png
 

Sensacell

Joined Jun 19, 2012
3,447
The unused OUTPUTS must be left floating- it's the INPUTS that need to be set to a defined state.
By grounding the outputs of the 4060, you have effectively shorted out the chip.

This thing has become crazy complicated.
I reiterate that a micro is a far better way to do this- and will be more reliable than what you have here.

You could even use the AC line as a the clock source, as the timer will be AC powered.
 
Top