Skip to the content
2 layers99.7 × 99.1 mmDrivewayGateControl, the printed circuit board in 3D

A relay-driven dual DC motor controller for a double-swing gate opener. Uses Arduino and LoRa. This repo is a mirror for:

Size
99.7 × 99.1 mm
Copper layers
2
Thickness
1.6 mm
Parts
56
Nets
51
Pads
219
Tracks, vias
325, 28
Pours
6
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
14 Jan 2020
Updated
5 Jun 2026

Overview

DrivewayGateControl is an open-source printed circuit board by motivemachine, from the motivemachine/dual_swing_gate_controller repository on GitHub, published under the MIT licence. It is a 2-layer board of 99.7 × 99.1 mm with 56 parts on 51 nets, routed with 325 tracks and 28 vias.

It is built around the AMS1117-3.3. Its parts include 10 resistors, 8 capacitors, 8 diodes, 6 connectors and 6 switches. It belongs with the robots and motor control and radio and wireless boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md
Remote linear actuator controller, for a diy open-source gate opener.

Having built a custom driveway gate and hinge setup I found myself shocked at what a quality dual-swing gate opener costs these days. More importantly, they have rather a lack of customization available in how you control or communicate with them, so I've set out to build my own with a pair of 12v linear actuators and a Semtech SX1287 LORA radio module. This is a work in progress.

I'll be building a custom PCB for the whole thing, but I've tried to design this in such a way that any number of Arduino and related modules would work if hand-wired with jumpers, perfboard, breadboard, etc. Most parts are through-hole, and the ones that are surface mount are large enough hand soldering should be easy. Also makes for easy customization.

Current Status

Schematic and first soldered board is complete. Code testing has begun, and has been mostly reliable with a few adjustments needed in error handling functions and long-term robust-ness.

gate control board

Parts list and design criteria
  • 2x 16" stroke linear actuators (12v) - commercial gate openers are often much larger than this, but so often are the gates larger and heavier. My gates are quite lightweight tubing on ball-bearing hinges, so not much force is needed to open them. The two actuators I have claim a full load current of 3 amps, though I don't expect them to need much more than 1 to open and close these gates
  • 2x 8Ah SLA batteries - the driveway is long enough that trenching AC power out there would be a chore, so I'll be running this off a pair of ~$16 12v batteries and a small solar panel instead.
  • Arduino Pro mini 8Mhz/3.3v - chosen so that I can avoid level shifting the SPI/I2C modules. An arduino Uno or Nano would work fine with proper level shifting
  • AI-thinker RA-02 Lora radio - I've come to like these for designs that may be put in varied enclosures, as the IPX connector built-in means I can place the radio anywhere that's convenient and pipe the RF via coax to an optimal antenna placement.
  • 4x 12volt SPDT relays of proper current rating- The relays are in an H-Bridge topology that allows reversing of current through a DC motor(see below). This could be done a little cleaner with a pair of DPDT relays, but using these means the design will also work with the standard 4-place relay modules that are so popular. They are a 12v coil powered off the battery, switched with a PNP from the Atmega328p.
  • 2x INA219- These can be had in SOT23-8 package, or available in several types of breakout boards. These will be the primary safety, which will watch the current going to each actuator. We'll test for a baseline current it usually takes to open a given gate (perhaps in a light breeze) and set that as our upper limit of motor current. If this current is exceeded, it likely means a gate is jammed or attempting to close on an object; so stop and reverse the gate.
    • Most of the pre-built modules I've seen for sale us a 2010 0.1ohm shunt resistor, allowing a maximum current of 3 amps. If your motors draw more than that, recalculate the needed resistor value
    • There will be enough exposed pins to add an electronic-eye, but I haven't planed for that yet.
  • 2x mini ATM fuse- the INA219 will handle over-current due to obstructions in the motor, these are just extra safety in case of a major hardware or wiring failure. Size appropriately to your wire sizes and motor current requirements.
  • AMS1117-3.3 regulator- For the 3.3v circuitry.
  • A MAG3110 or similar magnetometer- this is optional, but I've decided to build-in my magnetometer driveway alarm into this same enclosure and power supply. It is described here: magneto-driveway-alarm
    • The magnetometer from a more common IMU package (i.e. mpu9250) would likely also work well.
H-Bridge description

hbridge schematic
Shown here is the relay configuration in a simple H-Bridge. By switching seperate relays, any leg can be made positive, while the other remains grounded, causing the DC motor to be able to turn in two directions. This is very fault tolerant too- if any relay became stuck or failed, the motor would have either both leads grounded, or both leads at 12 volts, neither one of which would allow current to flow, therefore the motor will remain stopped. If the linear actuator is moving, it will of course stop when it reaches the built-in limit switches. Avid home DIY'ers might recognize this as similar to wiring a 3-way light switch, but backwards. The other difference is that AC power has no single direction of current flow, nor does a lightbulb care which way the current flows.

Homelink Integration (v2.0)

Added support for the TOPENS HLR01 Homelink-compatible receiver using a single-button toggle on pin A0.

Wiring:

  • HLR01 PORT 1 COM → Arduino GND
  • HLR01 PORT 1 NO → Arduino A0
  • Power the HLR01 from the 12V battery/solar bus (12-24V OK).

Pressing the assigned Homelink button in your vehicle will toggle the gate state (open ↔ close). Includes debounce and LED2 visual feedback. No PCB rework needed — uses the existing A0 breakout header.

Note: Magnetometer code is commented out in v2.0 but can be easily re-enabled.

Parts

56
QtyValueFootprintReferences
61n4001Diode_THT:D_A-405_P7.62mm_HorizontalD3, D4, D5, D6, D7, D9
40.1ufCapacitor_THT:C_Disc_D4.7mm_W2.5mm_P5.00mmC3, C4, C6, C8
41kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR5, R6, R8, R9
42N3904Package_TO_SOT_THT:TO-92_Inline_WideQ1, Q2, Q3, Q4
4MountingHole_PadMountingHole:MountingHole_3.2mm_M3_Pad_ViaH1, H2, H3, H4
20.1Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR7, R10
23k3Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR3, R4
2470ufCapacitor_THT:CP_Radial_D12.5mm_P5.00mmC5, C7
2FuseFuse:Fuse_Blade_Mini_directSolderF1, F2
2INA219BIDCNRPackage_TO_SOT_SMD:SOT-23-8U4, U5
2LEDLED_THT:LED_D5.0mmD1, D2
2RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2
1100ufCapacitor_THT:CP_Radial_D7.5mm_P2.50mmC9
122ufCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC1
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1ArduinoProMini_aMainWorking:ArduinoProMini_aU2
1DDiode_THT:D_A-405_P7.62mm_Horizontal1n4001
1LOGOMainWorking:cateyes_small_earsG***
1LOGO_MWM_medMainWorking:LOGO_MWM_medG***
1LoRa_Ra-02MainWorking:LORA_SX1278_ModuleU3
1Motor_ConnectsTerminalBlock:TerminalBlock_bornier-4_P5.08mmJ4
1closeButton_Switch_THT:SW_PUSH_6mm_H8.5mmSW1
1gpio1Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ5
1gpio2Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ6
1magnetometerTerminalBlock:TerminalBlock_bornier-4_P5.08mmJ2
1openButton_Switch_THT:SW_PUSH_6mm_H8.5mmSW2
1powerTerminalBlock:TerminalBlock_bornier-2_P5.08mmJ3
1relay1Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CK1
1relay2Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CK2
1relay3Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CK3
1relay4Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_CK4
1serial_headerConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ1

Similar boards

  • 2 layers290.1 × 130 mmPro V2, the printed circuit board in 3D

    Pro V2

    kata0510/Lily58

    6×4+4keys column-staggered split keyboard.

    312 parts2.3k
  • 2 layers26.2 × 45.5 mmPL18 multiprotocol, the printed circuit board in 3D

    PL18 multiprotocol

    pascallanger/DIY-Multiprotocol-TX-Module

    Multiprotocol TX Module (or MULTI-Module) is a 2.4GHz transmitter module which controls many different receivers and models.

    24 parts1.9kGPL-3.0
  • 4 layers99 × 53.3 mmPSLab, the printed circuit board in 3D

    PSLab

    fossasia/pslab-hardware

    PSLab Hardware Design and Schematics https://pslab.io

    199 parts1.7kApache-2.0
  • 4 layers85 × 56 mmPslab mini, the printed circuit board in 3D

    Pslab mini

    fossasia/pslab-mini-hardware

    PSLab Mini Hardware https://pslab.io

    182 parts1.2kApache-2.0
  • 4 layers100 × 54 mm32Bit shift register, the printed circuit board in 3D

    32Bit shift register

    MaltWhiskey/Mega-Cube

    16x16x16 PL9823 Cube with Teensy 4.0 and FlexIO driver

    64 parts766
  • 2 layers44.2 × 29.3 mmI2c tiny usb, the printed circuit board in 3D

    I2c tiny usb

    harbaum/I2C-Tiny-USB

    Cheap and simple I²C to USB interface

    27 parts454
  • 2 layers78 × 60 mmIce viz, the printed circuit board in 3D

    Ice viz

    muni-works/vcad

    BRep CAD kernel in Rust/WASM

    44 parts442Apache-2.0
  • 2 layers59.1 × 99.9 mmCheap FOCer 2 60mm, the printed circuit board in 3D

    Cheap FOCer 2 60mm

    shamansystems/Cheap-FOCer-2

    Low-Cost Motor Controller based on the VESC 6

    193 parts407

Questions

How big is the DrivewayGateControl PCB?

It measures 99.7 × 99.1 mm and has 2 copper layers, 1.6 mm thick.

What parts does the DrivewayGateControl use?

56 parts, built around the AMS1117-3.3. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the DrivewayGateControl KiCad files?

From the motivemachine/dual_swing_gate_controller repository on GitHub, at the commit this page was made from: the board is hardware/DrivewayGateControl.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the DrivewayGateControl design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).