Electric Gate Controller

I am about to embark on a project, and need some help starting off.

My electric gate PCB has malfunctioned, and I am wondering how feasible it is to use an Arduino to control the opening and closing. It is a single gate system.

The pieces that still work are:

LYN400 24V actuator arm. This is 24V 48W. It has 6 wires. 2 for power (reb/blue) and the other 4 are "sensors" (brown/green/white/yellow)
24V Flashing Light (2 wires)
24V Maglock (2 wires)
Add On Fob controller (4 wires, 2 for power and 2 for the "button pushed" sensor)
Video Intercom system to send a signal to open the gate (2 wires)
A key switch (2 wires)
2 x InfraRed sensors (2 wires on each)
2 x 12V batteries
Mains transformer

To mimic the functionality of the broken PCB, there will need to be the following:

Buttons:

  1. Learn limits button - press once to set open position, once more to set the close position, and a 3rd time to save the settings
  2. Open Button - used when setting the Open/Close limits to open the arm
  3. Close Button - used when setting the Open/Close limits to close the arm
  4. Single Button Push - to allow the user to press a button on the PCB instead of using the fob

Dip Switches:

  1. Save
  2. Mag Lock On/Off
  3. Sensor On/Off
  4. Phone On/Off
  5. Key On/Off
  6. FOBs On/Off

LEDs

  1. Power
  2. Button Pressed
  3. Set Open Limit
  4. Set Close Limit
  5. Diagnostic
  6. Timer Running

Potentiometer

  1. Force
  2. Delay
  3. Time to close

Relays

  1. Flashing Light
  2. Mag Lock
  3. Gate Arm

I have the following already:
Arduino Uno
6mm x 6mm x 6mm push buttons
5v 4-Channel Relay Module Board (High Power Relays 250V 10A AC)
LEDs

For the potentiometers, I searched on ebay and came up with "Single Turn Finger Preset Trimmer Potentiometer". I am not sure what resistance to get.

So, with the above in mind, I am looking for some advice on a PCB layout of how it all needs to be wired together, and any resistors/capacitors etc that I may need. I am keen to get on and do the programming, but its the wiring side that I will struggle with. Is there anything else that I will need to buy?

Also, I am not sure how the 4 "sensor" wires on the actuator will be plumbed in. Any advice on what these wires will be would be excellent also.

Thanks in advance for any help.

LeeD:
For the potentiometers, I searched on ebay and came up with "Single Turn Finger Preset Trimmer Potentiometer". I am not sure what resistance to get.

Resistance for an input pot like this probably doesn't matter too much. For the Arduino, a 10k pot is a good all-purpose value, but if you happen to have a bunch of some other value lying around, feel free to try them and see if they work. Regardless of the value of the pot, the way an input pot is wired up, voltage will always vary from 0-Vcc. The only difference is how much current is flowing, which the Arduino is relatively insensitive to.

So, with the above in mind, I am looking for some advice on a PCB layout of how it all needs to be wired together, and any resistors/capacitors etc that I may need.

This is an immensely tall order, especially given that we know very little about how the original board operated. A lot of reverse-engineering will be in order to get all the parts working with the Arduino. Even if all necessary conditions were stipulated, designing the circuit is probably not a simple, one-off task. However, much of what you will be doing involves reading switches/buttons--reading the key fob circuit, for example, or the limit set button, and so forth. So if you don't already know how to read a button, that's a good place to start. Here's a useful tutorial:

http://www.ladyada.net/learn/arduino/lesson5.html

One note: that example uses pulldown resistors. There's nothing wrong with that, but the internal pullup resistors in the Arduino are much more convenient. You will want to use pinMode INPUT_PULLUP instead of INPUT, the button will be wired INPUT_PIN -> SWITCH -> GND, and you will look for LOW to indicate that the button is pressed, instead of HIGH.

Also, I am not sure how the 4 "sensor" wires on the actuator will be plumbed in. Any advice on what these wires will be would be excellent also.

This is some of the reverse engineering that you will have to do. Presumably, the wires are paired up, and a switch closes at some point, when some condition is met. In this respect, they will be wired exactly like a push-button switch, but instead of pushing a button, some other condition will cause the contact to close. What that condition is... who knows?

Hi, your actuator will have the 4 wires connected to limit switches, one pair for each end of travel.
Also the motor should be connected to its own limit switches internally to prevent it from destroying itself.

This is where the manual for the actuator is located, but it isn't to forthcoming with wire details.
There is no feedback from the actuator to learn positions.
Did the old controller have a learn procedure?
The gate maybe set up so that maximum and minimum extension corresponds to full closed and full open.
A picture of the old controller would help also.

Tom....... :slight_smile:

I think you will find that these gate openers do not have limit switches - the limits are set by either sensing the motor stall current, or sensing when there is no more movement. How do I know this? Because there is no reference in the mounting instructions to setting limits other than pointing out that the mechanism exerts substantial force on the gate stops.

The "sensor" in the 24V version is an optical quadrature encoder, the pulses from which are counted and the position remembered by the electronics.

According to that manual, the 240V motor assembly does not have the sensor, so it presumably uses stall current sensing.

probably easier to replace the parts unless you fried the main IC as well..

It's a decent sized project but feasible with some time...