Advice Needed: How to Control a Sliding Gate Opener?


(Angelos) #1

Hi All,

I am about to embark on a new mini-project having the aim of implementing a button within my OpenHab2 sitemap for controlling remotely my NICE SpA ROBO 500 Sliding Gate Opener (RO500.Manual.pdf (917.6 KB))

I checked the user manual and I found the embedded ROA37 motherboard accepts a wired control input on pins 9 (Common = 24V AC) & 12 (Step-Step). No external voltage is needed to trigger the switch. I just need to short circuit the 2 pins for a few milliseconds to send a control command to the unit.

It is supposed to work as an input for sequential movement (Open -> Stop -> Close -> Stop etc).

I was originally thinking to:
a) Install a Raspberry Pi 3 in the gear motor cover (it fits) and link it to my WLAN
b) provide power to the RPi3 with the 2A official Raspberry power supply (I have 230V mains in the case),
c) connect the Raspberry GPIO to the control input of the motor motherboard,
d) configure something like gpio-admin to use a script to short circuit the control pins
e) configure a switch button in openhab2 with exec binding (maybe?) to call the script everytime I press the switch

simplified diagram below:

I have never done this kind of hardware setup before, so I need some opinions/advices please :slight_smile:

Is it an overkill to use a Raspberry Pi 3 device to control the Gate?
Could I use something simpler (like ESP8266?)

My main OpenHab 2 instance will be running on a Linux Laptop on the same (W)LAN.

Any ideas are welcome :slight_smile:

BR,
Dim
Ps: The Gate Opener accepts now remote control commands using the Nice INTI2B RF unit operating at 433,92Mhz… Could I leverage RF here?


[OH2] Control ESP8266 Relay using MQTT Eventbus
(Rich Koshak) #2

I would say use what you are comfortable with. Over all though unless you plan on adding more stuff to this Pi I would say it is probably overkill. An ESP8266 or Arduino with a wireless shield (or some other wireless transceiver attached, I use RFM69) would be more appropriate. Since these do not run an OS there is so much less potential for something to go wrong.

For an anecdote I have to reboot my Pis every few months at least (usually more often) and I can’t remember ever having to reboot my Arduinos for anything more than I needed to move it to another plug. I’d also me concerned about the wide temperature changes and such impacting the Pi more so than an ESP9266 or Arduino.

Besides, both will be way cheaper than a Pi, maybe not a Pi Zero.

You might want to look into a 3.5v relay to wire to the actual pins on the gate. I use one to simulate a button press to my garage door openers and it works great. Then you just need to send one pin high or low and the relay makes the circuit.

I imagine you can make something work with the 433 Mhz but you will have to do some research on the content and formatting of the commands that unit accepts.


(Tommy Sharp) #3

I have this scenario and used a Wemos D1 Mini with the “Relay Shield” to tackle it. About $10 all up and I could even share my Arduino script with you if that helps…
You do need to have an MQTT broker running as that is how it communicates.

Plus you need to make sure you get good wifi signal at the gate or run a simple cable into your house first.


(Angelos) #4

I think that I will go with the ESP8266 + Relay Shield based solution like @TommySharp and @rlkoshak recommended. The Voltage is 29V AC for the control circuit and I don’t think that the RPi3 GPIO would be able to handle that…

I do run a Mosquitto MQTT Broker in my OpenHab 2 Host and I will use that for communicating events.

WiFi coverage is pretty good at the location since I recently installed an outdoor AP for my general use.

It would be great if you could share your Arduino script @TommySharp :slight_smile: Thanx!

More news soon, as the project develops.

BR,
Dim
Ps: “What I cannot create, I do not understand” - Richard Feynman


(Rohnny Swennen) #5

why not use something like http://www.globalcache.com/products/itach/wf2ccspecs/ and use the global cache binding. I never used the contact version of the itch but used several other itch (ir and serial) in irule and simple control projects and they are very reliable.


(Angelos) #6

That’s not a bad idea… It is a bit larger than what I need (only 1 relay switch) and it costs 120 USD on Amazon…

I think that I could get away with 10-15 USD using this shopping list:
a) WEMOS D1 mini Pro - 5 USD or Wemos D1 mini V2 - 4 USD
b) Wemos Relay Shield v2 - 2.10 USD
c) Power Supply with Micro USB Cable - 2.51 USD or Battery Shield For WeMos D1 mini - 2.5 USD + 3.3V Lithium Battery 5 USD
d) Some small plastic box to host the Wemos mini and the shield 3-5 USD

I will also learn more stuff with the ESP8266 :slight_smile:


(Rohnny Swennen) #7

Absolutely agree more fun and cheaper, I mostly have to reach a certain “wife acceptance level” and hence cost is les important and reliability, ease of implementation and time to fix (replace spare) when something goes wrong is critical :slight_smile:

Have fun.


(Angelos) #8

Can’t argue with that :slight_smile:

I think that I am safe (!?!) for now since I got her a new cool RF remote control for the Gate. This will act as a WAL Backup in case my IoT implementation is not stable enough… :sunglasses:


(Tommy Sharp) #9

Let me know when you get your Wemos and I’ll dig out my arduino sketch.
Worth noting that most gate motors will have an “output” of 12v or 24v… So with a small transformer you could power your esp8266 Wemos off that potentially…


(Angelos) #10

Thanx @TommySharp

I just ordered my shopping list and I expect the hardware to arrive to me in 2-3 weeks max (they are shipped from China :()

I will let you know when I am ready to start playing with sketches on the Arduino IDE.

Regarding Power: I found this: http://www.hlktech.net/product_detail.php?ProId=59 and I am planning to use the 230V AC Mains and this module to feed the Wemos mini… it should work… :slight_smile:

BR,
Dim


(hazymat) #11

Hi @Dim, I have automated the NICE Robus 500 for a client of mine. There have been some challenges, mostly specific to the NICE motor unit and its operation.

(Note, you mentioned NICE “robo”, the one I worked on was a “Robus” 500, maybe the name is different because the product is sold in a different market? I’m in the UK…)

The gates installer told me that I just need to connect a relay to the OPEN port on the motor, and close the relay (i.e. make the connection) when I want to open the gate. So I set up an Arduino nano with a relay and a W5100 board for networking, then wrote a sketch to listen to MQTT messages for open and close.

However it wasn’t as simple as that.

Here were the two problems I encountered:

  • I close the relay (make connection), and the gate opens. If I leave the connection closed, it remains open. This is good. If I open the connection again during the period that the gate opens (about 25 seconds in my case), the gate continues to open, then shuts again after a timeout period set on the Robus 500. This is good. HOWEVER, if I close the relay momentarily to open the gate, THEN close the relay again whilst the gate is opening, the gate STOPS opening and stays that way. It never closes or opens after that, it just stays half open.

This is a problem when, e.g. someone uses OpenHAB to open the gate, the and at the same time someone drives up and keys in the code on the keypad near the gate.

So I changed the sketch to respond to an open message by checking that 30 seconds has elapsed since the last output to relay (to ensure the current action finishes, i.e. gate open or gate close) then changes the state of the relay.

  • I haven’t solved this one. Sometimes, when my relay is connected to the system, the gate goes into some random “go horribly slow” mode. Nothing resolves this until I completely resent the Robus (delete all data, rescan locations, rescan bluebus, set up all the speeds and locations and settings again).

I contacted NICE about this issue as it seems to be related to the unit. They talked down to me on the phone, said some basic stuff, then told me to go away until I understood the problem some more. Which, to be honest, I don’t.

By the way, I’m using the O-View device to program the gate motor controller. This is invaluable.

The reason for setting this up for the client was so they could have a Google Calendar control the gates, to allow visitors access at times when the site is open.

I got around the latter by ensuring they set the opening time an hour before anyone is likely to turn up. It’s not ideal.

The client has 3 sets of gates, 1 set of sliding (Robus 500) and 2 sets of swing gates. The swing gates have proved even more of a problem!

Let me know if you want to see my Arduino sketch or OpenHAB settings, or whatever. Happy to show you more info.

Mat

p.s. I used Arduino Nano and W5100 breakout board because I had loads of Nanos from ebay (2 quid each) and loads of W5100 (4 quid each), and I’ve had great success integrating Arduino with MQTT for my own home automation so far. The relay I used was some Ebay thing for a few quid as well, consisting of 2 small relays on a breakout board with inputs and power connectors.


(tcgerhard) #12

I agree that an Arduino or ESP8266 would work well here.

Since it came up, I’ll mention that I’ve had a rPi 2 in the controller box on my gate for two years and haven’t had any temperature-related issues with outdoor temps ranging from about -10F to 95. I’m in Connecticut, USA.

I use my pi to monitor gate openings and take photos of the outside of the gate whenever it opens; I haven’t needed to control the gate from the pi.

I did lose one Pi to a nearby lightning strike, but the gate controller was also fried, so I can’t fault the Pi.


(Avner) #13

My friend who build such gates says that in the menu of the gate controller there is a function to ignore incoming commands while the gate is openning.
So the solution is not to change the sketch but to change the configuration of the gate controller. You have to check the manual for the Robus 500


(John Cocula) #14

You might be able to use the Garadget, which lets you work like a momentary contact button, but also measures whether the door/gate is open or closed using reflected laser light. There is a binding for it. The product is also open source, so you could take the specs and firmware and build your own from parts.


(hazymat) #15

@Avner Yes it’s called “Apartment Block 2” or something like that. I tried that - it still didn’t work.

BUT - I called the gates installer out, and he found a problem with a sensor that was interfering. So - it now works beautifully!


(Angelos) #16

Reviving this topic since I just received my shopping list with the ESP8266s
More news soon. I will write up a full manual on how to solve this case later on :slight_smile:


(Rich Koshak) #17

Please post the writeup as a new topic in Examples and link to it from here. It will be easier to find that way.


(Gopi A) #18

I just got a NICE 400 in India. My installer wired up a CAT6 and left it for me to hook up my ESP8266 with individual functions to open,close and hold.

I’m having some trouble getting things to work though… What relays did you use, and would you be open to sharing your sketch please?

Thanks!!


(Angelos) #19

Hi @gopi_ar,

I just started this project. I haven’t configured anything yet.
I will record every step (with instructions and pictures) for this deployment and I will share it in this community.
Stay tuned :slight_smile:

This is what I will be using (see also post above with links)

BR,
Dim
Ps: @TommySharp & @hazymat had some sketches for this solution that they may be able to share. It would help me to get started also


(Gopi A) #20

Hey @Dim
I got this to work with:

  • Relay switch (instructions on working with the relay here). Relay switch from here
  • Nodemcu + ESP8266 (flashed with Arduino)
  • Cat6 using 2 pairs from the Robus for Open and Close functions.

If you close the loop in the Relay switch, the command should work.
I used the Blynk library to make this work though, haven’t tried openhab yet. It’s literally 2 lines of code to get this to work with Blynk!