

DrivewayGateControl
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
1README
README.mdRemote 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.

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

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| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 1n4001 | Diode_THT:D_A-405_P7.62mm_Horizontal | D3, D4, D5, D6, D7, D9 |
| 4 | 0.1uf | Capacitor_THT:C_Disc_D4.7mm_W2.5mm_P5.00mm | C3, C4, C6, C8 |
| 4 | 1k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R5, R6, R8, R9 |
| 4 | 2N3904 | Package_TO_SOT_THT:TO-92_Inline_Wide | Q1, Q2, Q3, Q4 |
| 4 | MountingHole_Pad | MountingHole:MountingHole_3.2mm_M3_Pad_Via | H1, H2, H3, H4 |
| 2 | 0.1 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R7, R10 |
| 2 | 3k3 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R3, R4 |
| 2 | 470uf | Capacitor_THT:CP_Radial_D12.5mm_P5.00mm | C5, C7 |
| 2 | Fuse | Fuse:Fuse_Blade_Mini_directSolder | F1, F2 |
| 2 | INA219BIDCNR | Package_TO_SOT_SMD:SOT-23-8 | U4, U5 |
| 2 | LED | LED_THT:LED_D5.0mm | D1, D2 |
| 2 | R | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1, R2 |
| 1 | 100uf | Capacitor_THT:CP_Radial_D7.5mm_P2.50mm | C9 |
| 1 | 22uf | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C1 |
| 1 | AMS1117-3.3 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U1 |
| 1 | ArduinoProMini_a | MainWorking:ArduinoProMini_a | U2 |
| 1 | D | Diode_THT:D_A-405_P7.62mm_Horizontal | 1n4001 |
| 1 | LOGO | MainWorking:cateyes_small_ears | G*** |
| 1 | LOGO_MWM_med | MainWorking:LOGO_MWM_med | G*** |
| 1 | LoRa_Ra-02 | MainWorking:LORA_SX1278_Module | U3 |
| 1 | Motor_Connects | TerminalBlock:TerminalBlock_bornier-4_P5.08mm | J4 |
| 1 | close | Button_Switch_THT:SW_PUSH_6mm_H8.5mm | SW1 |
| 1 | gpio1 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J5 |
| 1 | gpio2 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J6 |
| 1 | magnetometer | TerminalBlock:TerminalBlock_bornier-4_P5.08mm | J2 |
| 1 | open | Button_Switch_THT:SW_PUSH_6mm_H8.5mm | SW2 |
| 1 | power | TerminalBlock:TerminalBlock_bornier-2_P5.08mm | J3 |
| 1 | relay1 | Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_C | K1 |
| 1 | relay2 | Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_C | K2 |
| 1 | relay3 | Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_C | K3 |
| 1 | relay4 | Relay_THT:Relay_SPDT_SANYOU_SRD_Series_Form_C | K4 |
| 1 | serial_header | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J1 |
Similar boards
- 2 layers290.1 × 130 mm

- 2 layers26.2 × 45.5 mm

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 mm

PSLab
fossasia/pslab-hardware
PSLab Hardware Design and Schematics https://pslab.io
199 parts1.7kApache-2.0 - 4 layers85 × 56 mm

- 4 layers100 × 54 mm

32Bit shift register
MaltWhiskey/Mega-Cube
16x16x16 PL9823 Cube with Teensy 4.0 and FlexIO driver
64 parts766 - 2 layers44.2 × 29.3 mm

- 2 layers78 × 60 mm

- 2 layers59.1 × 99.9 mm

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).