# I made a Relay Delay circuit using LM393 Comparator, how do I increase Delay time?

#### Kim-JiHoon

Joined May 3, 2020
133
hello, i made a simple circuit that uses a comparator to drive a relay

D2 is 3.3V Zener Diode so Q1 base is charged when the voltage at D2 is over 3.3V

but i don't know how to apply the calculation formula I found on the web ( https://www.build-electronic-circuits.com/rc-delay-element/ )

i don't know if this circuit is best. i want to increase the delay time, what should I do? (i want set C2 value under 100u)

#### crutschow

Joined Mar 14, 2008
33,331
When do you want the delay to occur, and how much delay do you need?

#### Kim-JiHoon

Joined May 3, 2020
133
When do you want the delay to occur, and how much delay do you need?
i want Off-delay(turning off delay) and time about 10 Sec (10 ~ 15 Sec)

#### crutschow

Joined Mar 14, 2008
33,331
What triggers the relay to turn off?

What is the relay coil resistance?

#### Kim-JiHoon

Joined May 3, 2020
133
What triggers the relay to turn off?

What is the relay coil resistance?
:: Relay Features ::
- Nominal Voltage:24VDC
- Coil Resistance:1600ohm +-10%
- Nominal Current:15mA
- Must Operate Voltage:18VDC
- Must Release Voltage:2.4VDC
- Max Voltage:31.2VDC
- Nominal Power:360mW
- Size:19x15.5x15(h)mm Max
- Contact Arrangement:1 form C
- Contact Rating:10A, 120VAC

i set 24V / 1600R in proteus program

relay turns on and off Comp in AC system

when the temperature rises, the relay turns on, and the temperature is low, the relay turns off

#### Jerry-Hat-Trick

Joined Aug 31, 2022
446
i made a simple circuit that uses a comparator to drive a relay
Actually, I think your circuit is more complicated than it needs to be. Without looking too carefully at the component values, if you put a capacitor in parallel with R1, when you turn the switch on the +ve input of the comparator will be lower than the -ve input so the output of the comparator will move towards ground. The voltage into the +ve input will rise as current flows through RT1, so after a delay the output of the comparator will go high. Take out R4 and C2, short out D2 and R8. R7 should maybe be changed to 1K - the transistor needs to turn off reasonably quickly when the comparator output goes low when you open the switch.

The values of components to the left of the comparator will determine the delay. The larger the value of RT1 the longer the delay as current needs to flow through it to charge the capacitor until the +ve input exceeds the -ve input set by the potential divider R5/(R2 +RV1). You could just short out RV1. Note that R1 has to be bigger than RT1 (which it is) so the capacitor can reach a voltage greater than the -ve comparator input. You also need R1 to discharge the capacitor when the 5V is switched off or the delay to turn on the relay will be reduced if the capacitor is only partially discharged. Also, it helps reduce the value of capacitor needed for a specific delay time as current through RT1 is leaking through it so the voltage rise is slower.

You can do some calculations but I recommend breadboarding this simplifed approach and experiment with different capacitor values. You certainly should not need a 100uF capacitor.

#### Kim-JiHoon

Joined May 3, 2020
133
Actually, I think your circuit is more complicated than it needs to be.
You can do some calculations but I recommend breadboarding this simplifed approach and experiment with different capacitor values. You certainly should not need a 100uF capacitor.
thank you for your answer. as you said, my circuit is more complicated than necessary, and now I'm testing with various circuits
i think it should be preceded by understanding delay circuits using capacitors and resistors, not just working circuits
and i just figure out it's much simpler to give a delay in the LM393 Voltage Comparator part than to give a delay in BJT base

#### ericgibbs

Joined Jan 29, 2010
18,216
Hi Kim,
Is this project a College assignment.?
Moderation.

#### MisterBill2

Joined Jan 23, 2018
16,497
Actually, I think your circuit is more complicated than it needs to be. Without looking too carefully at the component values, if you put a capacitor in parallel with R1, when you turn the switch on the +ve input of the comparator will be lower than the -ve input so the output of the comparator will move towards ground. The voltage into the +ve input will rise as current flows through RT1, so after a delay the output of the comparator will go high. Take out R4 and C2, short out D2 and R8. R7 should maybe be changed to 1K - the transistor needs to turn off reasonably quickly when the comparator output goes low when you open the switch.

The values of components to the left of the comparator will determine the delay. The larger the value of RT1 the longer the delay as current needs to flow through it to charge the capacitor until the +ve input exceeds the -ve input set by the potential divider R5/(R2 +RV1). You could just short out RV1. Note that R1 has to be bigger than RT1 (which it is) so the capacitor can reach a voltage greater than the -ve comparator input. You also need R1 to discharge the capacitor when the 5V is switched off or the delay to turn on the relay will be reduced if the capacitor is only partially discharged. Also, it helps reduce the value of capacitor needed for a specific delay time as current through RT1 is leaking through it so the voltage rise is slower.

You can do some calculations but I recommend breadboarding this simplifed approach and experiment with different capacitor values. You certainly should not need a 100uF capacitor.
The comparator does not affect the delay time at all, as far as I can see. The output of the comparator is either close to zero or close to 5 volts, depending on the resistance of Rt. If others disagree, I ask them to explain how they reach that conclusion.
The transistor operation is controlled by the Vbe of the transistor, which depends on the charge on the capacitor C2. I see no capacitor associated with the inputs to the comparator, and so other than being a part of the timing voltage supply, it could be replaced by a switch selecting between V+ and common.
A comparator with no negative feedback does not function at all like an op-amp. The output is either "high" or "low."

#### AnalogKid

Joined Aug 1, 2013
10,778
Besides being overly-complex, the circuit has three problems.

1. The total resistance between the Q1 base and Vcc is over 67K. This, plus the voltage drop across the zener, means the Q1 base current is very small; almost certainly not enough to saturate the transistor when turned on.

2. The zener diode is shown backwards.

3. The current turning on Q1 ramps down very slowly. This will cause overheating in the Q1 and it will cause the relay contacts to chatter. The circuit needs some form of hysteresis. One way to do this is to use the other half of the LM393 to "square up" the C2 voltage ramp.

ak

#### Kim-JiHoon

Joined May 3, 2020
133
Hi Kim,
Is this project a College assignment.?
Moderation.
this is not a College project. i am studying AVR by myself, and I am also studying hardware, not software
Since it's summer soon, I'm going to make an air conditioner controller by myself

#### Kim-JiHoon

Joined May 3, 2020
133
Besides being overly-complex, the circuit has three problems.

1. The total resistance between the Q1 base and Vcc is over 67K. This, plus the voltage drop across the zener, means the Q1 base current is very small; almost certainly not enough to saturate the transistor when turned on.

2. The zener diode is shown backwards.

3. The current turning on Q1 ramps down very slowly. This will cause overheating in the Q1 and it will cause the relay contacts to chatter. The circuit needs some form of hysteresis. One way to do this is to use the other half of the LM393 to "square up" the C2 voltage ramp.

ak
1. i've tried running a real circuit. The LED is working, but the relay is not working
2. depending on the Zener diode direction, ON/OFF delay can be given
(Am I wrong? because now i've removed the Zener diode from the circuit.)
3. I'm not sure about "square up" (i don't know)

#### Jerry-Hat-Trick

Joined Aug 31, 2022
446
thank you for your answer. as you said, my circuit is more complicated than necessary, and now I'm testing with various circuits
i think it should be preceded by understanding delay circuits using capacitors and resistors, not just working circuits
and i just figure out it's much simpler to give a delay in the LM393 Voltage Comparator part than to give a delay in BJT base
You are welcome. Sounds like a plan. I'd suggest building the circuit piece by piece, checking it works and that you understand it along the way. Firstly this.

When you throw the switch measure the value of Vout and watch it increase to about 3.0V due to the potential divider 5 x 15/(10+15)

Then this.

V1 should be about 2.5V due to the potential divider 5x22/(22+22) Measure the voltage between V1 and V2 and watch it change sign as V2 rises from 0V to 3.0V

Then add the comparator and watch the output swing from low to high when V2 > V1

Finally add the rest of the components. Increasing the capacitor value will increase the delay time. as will increasing the 10K resistor value so long as it's less than 15K - a 5K pot in series would be a way of adjusting the delay.

#### crutschow

Joined Mar 14, 2008
33,331
Then add the comparator and watch the output swing from low to high when V2 > V1
He won't see much using the LM393 comparator without a pullup resistor on the output.

#### AnalogKid

Joined Aug 1, 2013
10,778
Finally add the rest of the components.
If the active device in the 4th schematic is a comparator, not an opamp, then its output will need a pull-up resistor to source current into the output transistor.

Also, there is no asymmetrical delay for the output.

Reference designators - !

ak

#### Alec_t

Joined Sep 17, 2013
14,005
10-15 seconds delay is going to need a high value capacitor and a high value resistor! Since the input impedance of the comparator inputs is high, any delay components should be added there rather than at the comparator output if the relay driver is a bjt. Replacing the bjt by a MOSFET would give more flexibility in delay component placing.

#### Jerry-Hat-Trick

Joined Aug 31, 2022
446
He won't see much using the LM393 comparator without a pullup resistor on the output.
Also, there is no asymmetrical delay for the output.
Fair points, I guess the LM393 is an open collector output. And I overlooked that the original cicuit was intended to introduce a delay turning on and a delay turning off. I very much prefer the switching to be controlled by the comparator rather than driving the transistor on and off with the rising and falling of voltage across a capacitor as this transition will be slow which is not good for the relay. I think a simple way to add delay to the turning off would be to put the switch in the line with the 10K resistor and leave the rest of the comparator circuit going left permrnantly connected?

#### Jerry-Hat-Trick

Joined Aug 31, 2022
446
when the temperature rises, the relay turns on, and the temperature is low, the relay turns off
I really should read the whole thread more carefully. I do wonder if you are looking for on/off control with hysteresis rather than delays? So when the temperature reaches T1 the aircon turns on and when it falls to T2 which is lower than T1 it turns off.

Without hysteresis you may end up turning the aircon on and off too frequently which can wreck the compressor. This is a control circuit I built for turning on and off an electric car radiator fan a while ago - not exactly the same, but it shows how to put hysteresis into an op amp. I wanted the relay grounded which is why I used two transistors.

#### MisterBill2

Joined Jan 23, 2018
16,497
If the active device in the 4th schematic is a comparator, not an opamp, then its output will need a pull-up resistor to source current into the output transistor.

Also, there is no asymmetrical delay for the output.

Reference designators - !

ak
The specified LM393 has been a dual OPEN COLLECTOR comparator for as long as I can recall. A comparator has two states, output high and output low. An attempt to use it as an op-amp will yield low performance in most circuits.

#### AnalogKid

Joined Aug 1, 2013
10,778
I am familiar with the 393/339. My point was that none of the schematics in post #13 say what that triangle-thingy is, the post he was responding to mentioned the 393 explicitly, and yet there is no pull up resistor.

The LM324 / 358 / 339 / 393 was (were) released in 1971 or 1972.

ak