# Need some direction on relays and limit switches for greenhouse roof window control

#### bastoe

Joined Mar 27, 2017
12
We have an up/down roof vent/window control I put together in our greenhouse to help keep things cool in there. Currently I put the windows up in the morning, and then later at night, I put the windows down (all 4 windows are driven with a gearbox and rack system at the same time via a up/down switch and motor). Right now to stop the motor (ether direction), I have to watch closely and move the switch to "off".

Our main problem is wind and rain: if it gets really windy or it starts raining, there may be some damage caused which we want to avoid so we'd like to tie in sensors to automate closing the windows if either of those two things happen. We would also like to automate the windows to open at daybreak (maybe with delay, but not if it's raining or too windy), and close at night (also with delay).

While this project has many similarities with chicken coop doors (which kept coming up when I searched and searched), I have yet to find one with all the moving parts and to be honest I'm just not up to speed on these types of controls to just add stuff in. I do have one of the night watchman day/night sensors ready to be hooked up. I have no relays, limit switches (for stopping the windows), or diodes.

I'm pretty good at figuring out mechanical hookups, soldering, and following schematics. I just need some direction on parts and wiring them into what we have (to maintain manual control as well as automate)

Because of the environment of the greenhouse, we would need to keep it to as few hearty parts as we can, it's usually 100+ in there with 80% or better humidity. I can order online etc...and this may take a week or so to get the parts.

I've included an attachment with details, thanks in advance for any assistance. I can try to take a video tomorrow.

Mike

#### Attachments

• 209.7 KB Views: 28

#### Sensacell

Joined Jun 19, 2012
2,582
On the basic mechanical side, be sure to consider that the spinning motor stores considerable energy, be sure to allow for "over travel" as the motor stops. The moving parts may come to rest significantly beyond the switch point.

Make sure the parts cannot move PAST the limit switches, nor crush them before stopping.

The simplest circuit is a DPDT relay used to reverse polarity, and heavy current diodes across the limit switches.
The diodes allow the motor to move off an open limit switch when the polarity reverses.
Wire the limit switches in series with of the motor, with diodes back-to-back across the switches.

Your controller merely needs to send an on - off signal to the relay to open or close the window.

#### #12

Joined Nov 30, 2010
18,210

Cheers,
Mike

#### KeepItSimpleStupid

Joined Mar 4, 2014
4,147
Non-condensing is pretty much a universal electronics requirement. Even your ECM in your car should work at high temperatures, but water on it is not a good idea. You have a lot of stuff going on and I pulled something out of my hat.

There is a dew point sensor, e.g.http://www.emersonclimate.com/en-us/Products/Electronics_Systems/sensors_and_transducers/Pages/Dew_Point_Sensors.aspx but it looks like you would need to measure temperature too. Hot and humid generally means no condensation. When the surface is cold and the air is moist, then you get condensation.

One way of making a PCB more hardened is to put a conformal coating on it.

With the controller, it looks as if you might be able to have WIFI access to the greenhouse and keep tabs on it. WIFI could be a line of sight link.
You can go Ethernet to wifi and wifi to ethernet as a bridge.

It has the astronomical timer which would be useful for you too.

Electrical enclosures have IP ratings: https://en.wikipedia.org/wiki/IP_Code The ways of cooling an enclosure are power hungry: vortec cooler, and thermoelectric.

There's the option of putting the enclosure outside too or even pumping in outside air to cool the enclosure with the primary purpose of dewpoint control.

#### bastoe

Joined Mar 27, 2017
12
Good news on the two sensors, they are just used for triggering relays and can work with 12vdc systems.
Wind:
http://www.sprinklerwarehouse.com/Hunter-Irrigation-Wind-Sensors-p/wind-clik.htm
Rain:
http://www.sprinklerwarehouse.com/Hunter-Irrigation-Sprinkler-Rain-Sensors-p/mini-clik.htm

Together with the day/night sensor, I think I have the triggering devices. Unless yall see an issue I will order them tomorrow.

Night Watchman day/night sensor (already have it):
http://www.flexcharge.com/NWHC-Night-Watchman.html

As far as a PLC, if one had wifi built in, it would be worth it. Otherwise I just need to keep this really simple and robust.

The condensation happens at night and in the morning before the temp rises.

The window open/shut sensors, would anyone suggest the exact model I would need to get?

Much appreciated!

#### KeepItSimpleStupid

Joined Mar 4, 2014
4,147
I have a migraine now, so I can't comment further on the other stuff, but it's NOT that the smart relay has WIFI built in, BUT if you can receive WIFI in the greenhouse, you can add an external access point to your network in the greenhouse. This ftp://ftp2.dlink.com/PRODUCTS/DAP-1650/REVA/DAP-1650_REVA_MANUAL_1.00_EN.PDF (I'm not suggesting this product though) you can connect the Ethernet wired device (e.g. Smart Relay) to WIFI. This manual calls it a Media Bridge mode. The smart relay has a web server. So, it's an option.

I have used D-link repeaters/AP products for a long time. A 802.11b version and a 802.11 b/g/n version. In my case, the range extender has 4 Ethernet ports on it that I could use. My AP runs off of 5 V wall-wart.

If the WIFI is weak, you may be able to use a directed antenna. I have an app on my phone that does signal levels etc.

#### bastoe

Joined Mar 27, 2017
12
Yes, I understand how it works, but is there a DC version? I don't have A/C out there, nor an inverter

#### KeepItSimpleStupid

Joined Mar 4, 2014
4,147
Back to the limit switches. You have that greenhouse thing again and the no or low power thing too.

An SPDT micro switch is only a few dollars. These http://static6.arrow.com/aropdfconversion/ddba595775ff08a145b78d677b288f9f22af1eea/pgurl_1.pdf however aren't even close to a few dollars, but they are sealed, somewhat anyway.

How you activate the window matters too. The design I would have in mind would require that the controller uses a contact to ground. The smart relay has relay outputs (good) or active high transistor outputs (bad, somewhat), but we can switch that,

So, the idea as before is to use two automotive relays close to the motor, some nice SPDT sealed limit switches and when the window is fully closed or fully open no power would be drawn.

The signal OPEN or CLOSE can be momentary or permanent, so partial opening is possible if timed.

If necessary a MOVING signal can be generated by putting a full wave rectifier across the motor.

Furthermore, relay coils always need a reverse biased diode across the coils, A 1n4001 would be fine.

This https://www.parts-express.com/12-vdc-bosch-type-dual-relay-socket-for-door-lock-unlock-circuits--330-078 is a relay socket that is wired for two Bosch style automotive relays. There are two different pin outs, so be careful.

So picture a drive circuit (e.g. OPEN) being a contact closure to ground *** which would activate the Open automotive relay. The limit switch COMMON would go to +12 (low power ~100 ish mA), the NC (Normally Closed) contact would go to the other end of the OPEN coil.

For status, the (NO) Normally Open contact would go to +12 V (low current). Thus when the window is OPEN, +12 (low current) would be signal that the relay is OPEN. That signal would be OFF if it was somewhere in the middle.

That *** contact closure to ground can be from a relay output (certain smart relay models). The +12 transistor output from the smart relay would have to be inverted. It's doable in a number of ways. Low power would be with an OPTOMOS relay (an IC that uses a 2 mA LED) or a MOSFET and a few resistors.

Having a "MOVING" signal allows one to possibly save power and turn off the drive when the desired position is reached.

In any event, manual control like you have momentary can still exist with limits being observed with auto-cut off.

www.polycase.com has a lot of sealed enclosures where the relays, MOVING can be developed and the limit switches can be wired. Your manual switch can be wired to that box too.

Sealtite flex conduit can be used for the limit switches.

So, you have at least:

+12 and GND for fused power for the motor.
Two leads (possible current limited) for Motor running

OPEN WINDOW (contact closure to ground)
CLOSE WINDOW (contact closure to ground)
WINDOW OPEN (+12 (possibly current limited) when OPEN and infinity)
WINDOW CLOSED (+12 (possibly current limited when CLOSED, and infinity)
These four can be referenced to the controller ground.

If you decide to run the manual switch to the box at the window, you may want to run a ground to the controller, so it goes from the controller to the box in the ceiling and back down to the manual switch. This just keeps the reference in one place.

#### bastoe

Joined Mar 27, 2017
12
Wow, lots of info there, will have to take it bite by bite. Just now ordered the wind sensor and rain sensor (opted for a different rain sensor since I want faster control of reactivation after rain, since it rains everyday at some times of the year, but not all day)

So here's what I have:
Rain- http://store.hydreon.com/shop/rain-sensor/RG-11.html (this may have the ability of day/night lol)
Wind- https://www.amazon.com/gp/product/B00FYRW3PO/ref=ox_sc_act_title_2?ie=UTF8&psc=1&smid=ACR5CS8C4ZH0Y
Day/night- http://www.flexcharge.com/NWHC-Night-Watchman.html
Some of the 1n4001 diodes (ordered a variety pack)

So I know it looks like a lot of $so far, so I need to keep the rest of the budget low, much lower. Would like to do this without a$ controller if it's cheaper. Since adding the controller requires, the PCB controller, and wireless hub (and a battery backup), and me running cat6 from my shop (where i'd have to put the wireless hub due to distance) to the greenhouse and the controller.

What I figure is needed:
2ea. limit switches for the window low stop/high stop: still looking (low cost) - do they need to be snap action, momentary, or ???
A bosch relay or two to control those. -how many and what type to go with the socket below please
Sockets for the limit switch relays: https://www.parts-express.com/12-vdc-bosch-type-dual-relay-socket-for-door-lock-unlock-circuits--330-078
A relay or two to control how the rain/wind/day-night control the motor. Advice needed please.
a container or two for all the parts including my manual switch (once I get all the parts I can go get one).

Thanks!!