GazonkFoo
Posts: 11
Joined: Mon Jul 07, 2014 4:22 pm

Interfacing 24v Gate Controlboard

Mon Jul 07, 2014 5:10 pm

Hey!

I want to be able to control a sliding gate with my rpi.
The motor has a controlerboard of the following type: http://www.faacusa.com/uploads/media/746___780D.pdf

Now what i need to do is trigger the input labeled "Open A" (Pin 1) and read the state of the output "W.L." (Pin 12).
The only problem is really the 24V environment (see attached the connections from the gate controlunit).

I found this thread: http://www.raspberrypi.org/forums/viewt ... 44&t=42938
For reading the state of the gate i got a bunch of 4N28 optocouplers but i'm a bit unsure if the circuit shown in the thread (first post by Tage) will work for me (6.8k resistor for the optocoupler with a 10k pull down resistor).
I know i could probably use a simple voltage divider but i think that's more than risky.

For the ouput i got both a UDN2981 and a ULN2803A. One is apparently used for high-side and the other for low-side switching.
Looking at the diagram i would say i need the high-side switching one (udn2981) because there's a common ground but i'm totally unsure about that...
Also do i need anything else for interfacing the UDN2981 / ULN2803A? Or just connect a GPIO pin from my raspi to Pin 1 of the IC, connect Pin 18 from the IC to Pin 1 of the gate board, connect VCC and GND and that's it!?

Thanks for your help!
Attachments
FAAC_780D.png
FAAC_780D.png (48.96 KiB) Viewed 3421 times

User avatar
Burngate
Posts: 6006
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Interfacing 24v Gate Controlboard

Tue Jul 08, 2014 11:28 am

First off, I'm not qualified to pronounce on any safety issues regarding the gate.

I've had a look through the pdf, but couldn't find anything regarding interfacing requirements in terms of currents or impedances of switches etc.

For the switch input, I would try to keep the Pi isolated from the gate electroncs, so would advise against directly connecting either of those chips between the Pi and the gate. You may find a relay the most convenient interface.

Regarding the "W.L" output, the only information about what it will supply seems to be "24 Vcc max. 3W". I would use Tage's diagram,Image
with the 6k8 and opto connected from pin10 to pin 12 on the control board. The other side, to the Pi, is exactly as in that diagram

GazonkFoo
Posts: 11
Joined: Mon Jul 07, 2014 4:22 pm

Re: Interfacing 24v Gate Controlboard

Tue Jul 08, 2014 12:18 pm

Thanks for taking the time looking through the pdf!!
I know i'm the only one responsible when screwing things up and burning down my house, killing the entire neighborhoud and those things that usually happen when experimenting :D

I will build the optocoupler circuit now but i'm still a bit lost with the relais :(
Maybe you can point me to a relais i can use directly on the rpi GPIO.
I'm googling like crazy (thanks to my total lack of knowledge in the hardware department) and from what i read i still would need some kind of a relais driver, e.g. transinstor circuit or again something like the ULN2803

Thanks again!

User avatar
Burngate
Posts: 6006
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Interfacing 24v Gate Controlboard

Tue Jul 08, 2014 4:50 pm

I don't know of any relays that can be directly driven from the Pi - they generally need more current and/or more voltage than a GPIO can supply, so, yes, a transistor or similar would be necessary, and the ULN2803 seems ideal.

As an alternative, you could try using an optoisolator instead, but it depends on whether the board would accept an opto output as a switch closure. If it's happy with less-than-perfect-0Ω and doesn't put too much current through it, it would be easier.
But the advantage of a relay is that it's a mechanical switch - when it's off, it's off with infinite ohms, and when it's on it's 0Ω, though like all switches it may be subject to corrosion, sticking, etc.

bbodin
Posts: 70
Joined: Sat Jun 28, 2014 3:23 pm

Re: Interfacing 24v Gate Controlboard

Tue Jul 08, 2014 7:33 pm

The 4N28 optoisolator you have and a resistor are maybe what you need to drive pin 1 of the gate control board. To determine whether the 4N28 is suitable to be used in place of a mechanical switch, you need to make a few measurements with a multimeter.

1) Measure the voltage at pin 1 relative to pin 7 (when the switch is open). This voltage should be less than the CE breakdown voltage of the optoisolator (which is 30 V minimum).

2) Measure the current flowing from pin 1 through the switch when the switch is close. With the multimeter set to measure current, connect the positive lead to pin 1 and the negative lead to pin 7 (with the switch open of course). If this current is higher than 1 mA, the 4N28 is not suitable because it has a low linear current transfer ratio (CTR) (10% at IF = 10mA, VCE = 10V and Tamb = 25 degC). Its saturated CTR at Tamb = 70 degC is even lower (about 6% at VCE = 0.4V and IF = 10mA). For a collector current of 1 mA, the input LED needs to be driven by a current of 16 mA (1/0.06) which is the maximum current that a Pi's GPIO pin can source or sink. You need to use an optoisolator with higher CTR such as the CEL PS2501-1.

3) Instead of closing a switch to active pin 1, connect a low-ohm resistor (10 - 50 ohms) across the switch and see if you activate it. If you can activate pin 1 with a low-ohm resistor, it means that the optoisolator's transistor doesn't need to be driven into saturation for the controller to recognize a logic low on pin 1. In this case, the 4N28 might be usable.
Binh Bui

GazonkFoo
Posts: 11
Joined: Mon Jul 07, 2014 4:22 pm

Re: Interfacing 24v Gate Controlboard

Wed Jul 09, 2014 10:47 am

Using a optoisolator would be awesome of course so i measured everything you told me:

1) 22.5V ... should be OK!?
2) 1.25mA ... this is problematic for the 4N28 i guess? But i also have a bunch of 4N35 and according to the datasheet those have a CTR of 100, right? so those should work?
3) Using a 10 Ohm resistor the gate closes

So i can use the 4N35?

Thanks

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Interfacing 24v Gate Controlboard

Wed Jul 09, 2014 11:10 am

GazonkFoo wrote:Using a optoisolator would be awesome of course so i measured everything you told me:

1) 22.5V ... should be OK!?
2) 1.25mA ... this is problematic for the 4N28 i guess? But i also have a bunch of 4N35 and according to the datasheet those have a CTR of 100, right? so those should work?
3) Using a 10 Ohm resistor the gate closes

So i can use the 4N35?

Thanks
Hi

A simple relay board costing a few dollars, driven by the Pi will do.

Also consider SSR for a lot more dollars.

It only has to close pin 7 to pin 1, and will give electrical isolation, and can have a manual switch added.

To read pin 12 a relay is shown as being an option to connect. So connect a relay (FaaC pin 10 and 12) and hook the volt free contacts into the Pi.



W.L. - Power supply to indicator light / timed exit / electric lock
/ 'traffic lights' (terminal 12)
Connect any 24 Vdc - 3 W max indicator light, timed exit,
command device for electric lock or 'traffic lights' between
this terminal and the +24V (see advanced programming
in Chap. 5.5.2). To avoid jeopardizing correct operation
of the system, do not exceed the indicated power.
(NB: I have adjusted the spelling of "geopardising" to one to suit the spell checker)

bbodin
Posts: 70
Joined: Sat Jun 28, 2014 3:23 pm

Re: Interfacing 24v Gate Controlboard

Wed Jul 09, 2014 12:41 pm

The 4N35 is good. Its saturated CTR at 70 degC and IF = 4 mA (LED current) is 50% minimum. So with a 4 mA LED current, the collector current is 2 mA minimum, plenty for driving the transistor into saturation over a wide temperature range. Here are the connections to the Pi and control board:

4N35 pin 1 (A) ===> 470 ohm resistor (1/4 W) ===> a GPIO pin of Pi (e.g. pin 11)
4N35 pin 2 (C) ===> GND pin of Pi (pin 6)
4N35 pin 4 (E) ===> pin 7 (-) of control board
4N35 pin 5 (C) ===> pin 1 (OPENA) of control board

You can use a second 4N35 to read the status from the control board. Here are the connections:

4N35 pin 1 (A) ===> 10 Kohm resistor (1/4 W) ===> pin 10 (+) of control board
4N35 pin 2 (C) ===> pin 12 (W.L.) of control board
4N35 pin 4 (E) ===> a GPIO pin of Pi (e.g. pin 12) ===> 3.3 Kohm resistor (1/4) ===> GND pin of Pi (pin 6)
4N35 pin 5 (C) ===> 3.3 V pin of Pi (pin 1)
Binh Bui

GazonkFoo
Posts: 11
Joined: Mon Jul 07, 2014 4:22 pm

Re: Interfacing 24v Gate Controlboard

Wed Jul 09, 2014 2:26 pm

Sounds great i will try that and report about the outcome, thanks!

Can you maybe tell me how you calculated the resistor values?
Just want to learn something ;)

I was under the impression that the input of an optoisolator can be treated like a regular LED but i can't figure out how to get to your values :?

bbodin
Posts: 70
Joined: Sat Jun 28, 2014 3:23 pm

Re: Interfacing 24v Gate Controlboard

Wed Jul 09, 2014 4:08 pm

1) 470 ohm resistor -
At 4 mA forward current (IF), the forward voltage (VF) drop across the LED of the 4N35 is about 1.2 V at -55 degC and 0.95 V at 85 degC. This LED is driven by a Pi's GPIO pin which can source about 3.3V when it's on. Using VF value in the worst case (1.2V), the required resistance is: (3.3V - 1.2V) / 4mA = 2.1V / 4mA = 525 ohm. Using a standard 5% resistor, this resistance can be 520 ohm or the more common 470 ohm.

2) 10 Kohm resistor -
The LED of the 2nd 4N35 is driven from a 24V source of the gate control board. We want about 2 mA to flow through this LED. The resistance of the current-limiting resistor is calculated as: (24V - 1.2V) / 2mA = 11.4 Kohm. Using a standard 5% resistor, this resistance can be 11 Kohm or the more common 10 Kohm.

3) 3.3 Kohm resistor -
The LED of the 2nd 4N35 is driven by a 2mA source. Since the worst case saturated CTR is about 50%, the minimum collector current is 1 mA. Assuming a saturated voltage of 0.4V for the output transistor of the 4N35, the load resistance is calculated as: (3.3V - 0.4V) / 1 mA = 2.9 Kohm. To have the transistor saturated at a lower voltage, use a higher resistance value. 3.3 Kohm is a standard 5% value. Its exact value is not critical. If you have a 4.7Kohm resistor, use that.

You're right about the optocoupler input. It's just a LED.
Binh Bui

GazonkFoo
Posts: 11
Joined: Mon Jul 07, 2014 4:22 pm

Re: Interfacing 24v Gate Controlboard

Fri Jul 11, 2014 6:58 pm

Sorry for the delay - i had to wait until the weather got better to try it out.

Everything is now working great. Just awesome - thank you everyone for the support but especially bbodin for the noob-proof solution ;)

Now I'm able to control my gate from a browser. Here's a short video of the final thing in action: http://tinypic.com/r/14m97ax/8
The red/green light indicates if the gate is open or closed (that's the output from the W.L. pin) and the button allows me to open and close it - nothing special i guess :D

Some pics from the circuit and the raspi connected with the control board: http://imgur.com/a/ASrnU

bbodin
Posts: 70
Joined: Sat Jun 28, 2014 3:23 pm

Re: Interfacing 24v Gate Controlboard

Sat Jul 12, 2014 12:00 pm

It's great to see it working. The component placement on the proto board is very well thought-out. You used point-to-point wiring without any jumpers! The web page control is neat.
Binh Bui

sebastianbrandner
Posts: 1
Joined: Mon Jul 16, 2018 2:21 pm

Re: Interfacing 24v Gate Controlboard

Mon Jul 16, 2018 2:25 pm

GazonkFoo wrote:
Fri Jul 11, 2014 6:58 pm
Sorry for the delay - i had to wait until the weather got better to try it out.

Everything is now working great. Just awesome - thank you everyone for the support but especially bbodin for the noob-proof solution ;)

Now I'm able to control my gate from a browser. Here's a short video of the final thing in action: http://tinypic.com/r/14m97ax/8
The red/green light indicates if the gate is open or closed (that's the output from the W.L. pin) and the button allows me to open and close it - nothing special i guess :D

Some pics from the circuit and the raspi connected with the control board: http://imgur.com/a/ASrnU
hi

ich erlaube mir einfach mal gleich auf deutsch zu antworten da ich das UI am Handy gesehen habe :-)
wie hast du die anlage angesprochen? ich überlege nämlich auch irgendwie meinen FAAC 746 zu "verbessern".

der dauert so lange beim öffnen und auf grund von hindernissen kann ich nicht wirklich früher den sender benutzen.
da wäre ein handy per web schon eine nette sache


es sieht so aus als ob du eine webapp aufrufen würdest die am RPi läuft.

lg
sebastian

Return to “Interfacing (DSI, CSI, I2C, etc.)”