Controlling the delay of a relay's output.

Thread Starter

Courtesy Flush

Joined Jun 1, 2018
17
About a month ago I started this thread: https://forum.allaboutcircuits.com/threads/intermittent-electromechanical-relay-operation.149282/
In that thread you kind folks helped me see a relay latching problem and provided not only a solution but a very good explanation. For all of that I'm grateful and give my thanks again.

I have gotten myself in trouble again I'm afraid. I hesitate to put this out here because it would appear I'm just asking to be spoon fed and that's not my intention. I've beat my stupid head against this for a week and I'm not getting anywhere. If I can't get past this problem the whole thing is going nowhere. So there it is.

I need a way to disable the output of the humidifier controller (C1) while the fridge controller (C2) is powering the refrigerator AND for several more minutes after the fridge turns off.

Here's the basic circuit: At least enough to understand this situation.


It works exactly as it appears it would, but... Here's the problem. Controller 1 (C1) controls a humidifier, Controller 2 (C2) controls a refrigerator that contains the humidifier. The fridge comes on, the RH inside plummets as the moisture in the air condenses on the cooling coils, the humidifier comes on and pumps water vapor into the fridge, the fridge turns off and the RH slowly rises again because of the output of the humidifier and the evaporating water off the warming cooling coils. Water drips off the warming coils for a while then the fridge comes back on, the remaining water freezes on the cooling coils. This whole process just feeds on itself with no good end.

The fridge only runs for a couple of minutes at a time. I tried to use a time delay relay but that's not working to keep the humidifier from running while the fridge is running and then for several minutes more. It's coil is powered by the output of C2 and it's out put is interrupting the line voltage supplied to the output of the humidifier controller (C1)

I got relays. That's what I got. I need a way to disable the output of the humidifier controller (C1) while the fridge controller (C2) is powering the refrigerator AND for several more minutes after the fridge turns off.

I didn't create the schematic above so I can't easily or quickly produce the currently included time delay relay, but I hope you can see it in your minds eye based on my description.
 

-live wire-

Joined Dec 22, 2017
959
If I understand you correctly, you need a relay to be turned off when a signal is high for over a few minutes. So here is what you may want to do. Get a logic signal for when the fridge is on. If it is high, it turns on a transistor which charges a capacitor within a few minutes (large R and large C). If a comparator finds that the capacitor is above a certain votlage, it turns its output low. The capacitor voltage goes to the inverting input, the reference to the non-inverting input, and they both must have a common ground. This can cut off power to a mosfet, turning off your relay. The capacitor also must be discharged with a resistor across it or when the fridge is off, a transistor turns on and discharges it quickly.
 

crutschow

Joined Mar 14, 2008
38,316
I know this is not related to your problem, but I have to know why you are trying to humidify the refrigerator air with added moisture, just so the refrigerator can turn around and remove it? :confused:
Seems like a good way to increase your electric bill.
 

Thread Starter

Courtesy Flush

Joined Jun 1, 2018
17
The background of this thing is contained in the original thread which is linked at the beginning of my first post. It's a small refrigerator being converted to cure meats.

An example of an environment that might be needed to be maintained would be say, 55F @ 75%RH. As stated in my first post, I have relays. what's already existing contains 5 electromechanical relays and 3 solid state relays, 3 cheap electronic controllers and five electrical outlets. The schematic only shows what could be the humidity and refrigerator controllers and the outlet at the top runs a fan. The rest of the schematic would be mearly identical, just repetitions of what is shown. What is shown is more than enough to illustrate the problem.

I would prefer to keep it all relay logic as I know little of things like arduino and coding.

Somehow I feel as if this can be done with a latched relay arrangement maybe, but I can't figure it out. I'm hoping someone here can help me out.

I need the humidifier to stay off any time the refrigerator is running and for some adjustable amount of time after it shuts off. The relative humidity in the refrigerator is just too unreliable while the fridge is running and for several minutes after it shuts off so I don't want the humidifier running when the numbers it's controller uses are entirely too inaccurate.
 

-live wire-

Joined Dec 22, 2017
959
The background of this thing is contained in the original thread which is linked at the beginning of my first post. It's a small refrigerator being converted to cure meats.

An example of an environment that might be needed to be maintained would be say, 55F @ 75%RH. As stated in my first post, I have relays. what's already existing contains 5 electromechanical relays and 3 solid state relays, 3 cheap electronic controllers and five electrical outlets. The schematic only shows what could be the humidity and refrigerator controllers and the outlet at the top runs a fan. The rest of the schematic would be mearly identical, just repetitions of what is shown. What is shown is more than enough to illustrate the problem.

I would prefer to keep it all relay logic as I know little of things like arduino and coding.

Somehow I feel as if this can be done with a latched relay arrangement maybe, but I can't figure it out. I'm hoping someone here can help me out.

I need the humidifier to stay off any time the refrigerator is running and for some adjustable amount of time after it shuts off. The relative humidity in the refrigerator is just too unreliable while the fridge is running and for several minutes after it shuts off so I don't want the humidifier running when the numbers it's controller uses are entirely too inaccurate.
The way I see it, you have two options: learn about advanced circuitry or learn to code.

Learning to code is actually incredibly easy. In an application that is not at all demanding (just a few relays and one or two buttons), you can use a very basic code. You just need to get a USB cable, plug the arduino into your computer, download the arduino IDE, and you can start coding. The code is very intuitive. You can learn all of the basics in about 30 minutes. And we could certainly help you.

If you have a background in electrical engineering or are a more serious hobbyist, you could certainly design a circuit to give you that delay. While you can learn, if you have very little knowledge, you will be confused and your circuit will probably not work.
 

crutschow

Joined Mar 14, 2008
38,316
Here's my take on doing it with an added SPDT relay and a time-delay relay (no coding required).
When the refrigerator controller has the refrigerator on, there is no power to the humidifier.
When the refrigerator controller turns off the refrigerator, the time-delay relay starts the delay to turn on the power to humidifier controller after the delay.
Sound like what you want?
upload_2018-7-13_20-6-5.png
 
Last edited:

Thread Starter

Courtesy Flush

Joined Jun 1, 2018
17
Thanks for the replies. Dew point is a real problem as that's why all the moisture in the air in the refrigerator is condensing on the cooling coils.

This is just a small, simple dorm size refrigerator. Like 2.5 cubic feet. There is a freezer compartment in the upper corner inside and the compartment itself is the evaporator of the cooling system that cools the refrigerator. When the refrigerator runs this entire compartment gets very cold and it just sucks all the moisture out of the air in the refrigerator where it condenses on the walls of the freezer compartment. It melts and drips off when the refrigerator isn't running, making a mess.

Thanks very much for the solution using relays crutschow. After I get some other stuff done around here I will put your solution in place and see what happens.

I am glad I found this place. You folks have been wonderful.
 

Thread Starter

Courtesy Flush

Joined Jun 1, 2018
17
I wired it up. Nothing immediately unpleasant happened. No sparks and smoke! It operates as expected. There are still a lot of other things that need to be addressed before I can really determine if this set up is going to solve the humidify/condensation/freezing/dripping cycle issues. Time will tell and thanks to all again!
 

cspwcspw

Joined Nov 8, 2016
78
I'm from a Comp Sci background, so I gravitate towards -live wire-'s suggestion that code is good! At the moment it sounds like your refrigerator and humidifier are independent systems each with their own controllers, and you're trying to impose some extra indirect "system control" when they're both independently doing their own thing. At the end of the day, a single controller in charge of both components would be "cleaner".

If you go the software route, I'd leap-frog over the Arduino: the Atmel chip is about 20 years old now. Newer toys like the ESP32 are priced about the same, have tons more memory and capability, including WiFi and Bluetooth. So if one day you want to have the temperature and humidity monitored remotely, or you need to add some "curing probe" stuck into each item in the fridge, or you decide you need an air circulation fan that runs once a minute every 10 minutes, your system will be more adaptable.

One of the nicest things about the ESP32 is that we can still develop and run our code in the Arduino IDE, with the same programming language and constructs as an Arduino board. Most Arduino programs (they like the word "sketches") run out-the-box on an ESP32 board. So the Arduino IDE and its support libraries, projects, and forum groups remain a hugely valuable resource.

The ESP32 is from Espressif - they also provide their own operating system and IoT Development Framework (IDF) for more advanced software scenarios. But for hobbyist-type applications, I'd avoid IDF - the Arduino route is a lot easier to install and to get your flashing LEDs or your "Hello World!" program going. (I only learned that I didn't need IDF after a fairly tedious install process that tried to make my Windows laptop behave like a *nix box.)

Peter
 
I need a way to disable the output of the humidifier controller (C1) while the fridge controller (C2) is powering the refrigerator AND for several more minutes after the fridge turns off.
I am a bit confused about the outlets 1-3 in the pictorial and what constitutes the controllers. Not knowing what modifications you have performed to the existing wiring. Are you monitoring and controlling the temperature externally and activating the AC into the refrigerator? Or perhaps, you keeping power to the refrigerator and use the internal temperature controls as the cooling "control #2"?
It seems to me that there might be many hours that you will not need either of these operations to be active. The temperature is cold enough and the RH is within the tolerances also. If this is true then here is my input:
I would approach this with an external RH controller and the temperature would be it controlled by the original thermostat. The output of this thermostat would be rewired to activate the main relay. When it is too warm the thermostat would close the NO contacts of the cooling relay to apply AC to the compressor motor. Once the temperature is cool enough the relay turns back OFF and the NC contacts close, sending the AC voltage to RH controller to tell it that it could turn ON that section if the other conditions have been met. Yes you will need to modify this AC signal to a small DC voltage the RH controller MCU can utilize. This "Compressor_OFF" signal would be monitored and it would start a count-down timer (delay you have determined). Along with the output of your RH sensor looking for an "Out_of_Tolerance" condition.
If all three of these conditions are correct then the RH relay will be activated. As soon as one of these conditions have changed states the the RH fan will be deactivated.
 

Picbuster

Joined Dec 2, 2013
1,057
About a month ago I started this thread: https://forum.allaboutcircuits.com/threads/intermittent-electromechanical-relay-operation.149282/
In that thread you kind folks helped me see a relay latching problem and provided not only a solution but a very good explanation. For all of that I'm grateful and give my thanks again.

I have gotten myself in trouble again I'm afraid. I hesitate to put this out here because it would appear I'm just asking to be spoon fed and that's not my intention. I've beat my stupid head against this for a week and I'm not getting anywhere. If I can't get past this problem the whole thing is going nowhere. So there it is.

I need a way to disable the output of the humidifier controller (C1) while the fridge controller (C2) is powering the refrigerator AND for several more minutes after the fridge turns off.

Here's the basic circuit: At least enough to understand this situation.


It works exactly as it appears it would, but... Here's the problem. Controller 1 (C1) controls a humidifier, Controller 2 (C2) controls a refrigerator that contains the humidifier. The fridge comes on, the RH inside plummets as the moisture in the air condenses on the cooling coils, the humidifier comes on and pumps water vapor into the fridge, the fridge turns off and the RH slowly rises again because of the output of the humidifier and the evaporating water off the warming cooling coils. Water drips off the warming coils for a while then the fridge comes back on, the remaining water freezes on the cooling coils. This whole process just feeds on itself with no good end.

The fridge only runs for a couple of minutes at a time. I tried to use a time delay relay but that's not working to keep the humidifier from running while the fridge is running and then for several minutes more. It's coil is powered by the output of C2 and it's out put is interrupting the line voltage supplied to the output of the humidifier controller (C1)

I got relays. That's what I got. I need a way to disable the output of the humidifier controller (C1) while the fridge controller (C2) is powering the refrigerator AND for several more minutes after the fridge turns off.

I didn't create the schematic above so I can't easily or quickly produce the currently included time delay relay, but I hope you can see it in your minds eye based on my description.
The best way to get an overview of your desire is to draw a timing diagram.
each line present an unit Y=0 means not running and use the x axis for time.
Start from nothing is running than build the desired action with all the units involved.

Now you know what to do and what to avoid.
When is goes too complex you might use a mpu building a status machine to achieve the wanted functions.

Picbuster
 

-live wire-

Joined Dec 22, 2017
959
I'm from a Comp Sci background, so I gravitate towards -live wire-'s suggestion that code is good! At the moment it sounds like your refrigerator and humidifier are independent systems each with their own controllers, and you're trying to impose some extra indirect "system control" when they're both independently doing their own thing. At the end of the day, a single controller in charge of both components would be "cleaner".

If you go the software route, I'd leap-frog over the Arduino: the Atmel chip is about 20 years old now. Newer toys like the ESP32 are priced about the same, have tons more memory and capability, including WiFi and Bluetooth. So if one day you want to have the temperature and humidity monitored remotely, or you need to add some "curing probe" stuck into each item in the fridge, or you decide you need an air circulation fan that runs once a minute every 10 minutes, your system will be more adaptable.

One of the nicest things about the ESP32 is that we can still develop and run our code in the Arduino IDE, with the same programming language and constructs as an Arduino board. Most Arduino programs (they like the word "sketches") run out-the-box on an ESP32 board. So the Arduino IDE and its support libraries, projects, and forum groups remain a hugely valuable resource.

The ESP32 is from Espressif - they also provide their own operating system and IoT Development Framework (IDF) for more advanced software scenarios. But for hobbyist-type applications, I'd avoid IDF - the Arduino route is a lot easier to install and to get your flashing LEDs or your "Hello World!" program going. (I only learned that I didn't need IDF after a fairly tedious install process that tried to make my Windows laptop behave like a *nix box.)

Peter
I think the ESP32 is great in general, but it is more expensive and may be unnecessary. You can get an Arduino nano for $2-3, but an ESP32 for $10. And for $1, you could get an ATtiny85 or something with a few IOs. More features comes at a cost.
 

Thread Starter

Courtesy Flush

Joined Jun 1, 2018
17
I R so downlevel. I haven't messed with this set up in several weeks because of family things. If I was starting with a foundation of knowing the language required to make these things work, this project would be entirely different. But I'm not. I am not a writer of code.
 

crutschow

Joined Mar 14, 2008
38,316
I am not a writer of code.
I relate to that.
Contrary to what some say, learning to code is not "incredibly easy" for many of us, any more than learning analog or digital circuit design is.
I write this because I think it's a disservice to imply that it is to a newbie.
It may seem easy for those that already know how to code or have a particular aptitude for it, but it's generally not when you start from scratch (at least it certainly was not for me, and that was just learning Basic, not some cryptic language such as C).

Just understanding the basics of coding, before you learn a language, is not trivial.
Then you have to learn the syntax of a particular language along with its many command words, how to generate the code for a particular task, program the code into the μP with a development system that has its own learning curve, and finally troubleshoot the code when it likely doesn't work as planned.
And that's true, even if the code for the desired task ends up being very simple.

So if you want to learn how to code, (and that's certainly a handy thing to know if you have an electronics hobby) don't feel stupid if you find it more difficult and time-consuming than some would have you believe.
 
Top