Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Shane Tully (

An Arduino-based relay control server and Android client

Note: This project may go long periods of time without being updated, however it is actively used and maintained. Bug reports and pull requests are welcome.


RelayRemote is an Arduino-based server for remotely controlling electrical relays which in turn turn on/off devices run from a standard 120V AC circuit. The project includes three clients, an Android application, a desktop client for control from Linux systems, and an Arduino-based wall switch.

The Android app supports multiple relay servers, relay groups, homescreen widgets, and NFC tags.

A demo video and brief description of how it works is available at:

The original version of this project used an Arduino Uno and Arduino ethernet shield. See the legacy documentation for instructions on using the legacy hardware.



RelayRemote was built and tested on an Adafruit Feather M0 WiFi. A PowerSwitch Tail II is the recommended relay.

Wall Switch

An optional piece of hardware is a wall switch for turning on/off relays more like a traditional light switch.


Setting up the hardware

  1. Connect a wire from the positive terminal of the relay to a pin between 2 and 9 (inclusive) on the Feather. Keep note of the pin you choose. Multiple relays can be connected to the same Feather by connecting them to different pins.
  2. Connect a wire from the negative terminal of the relay to a ground pin on the Feather.

Setting up the software dependencies

These instructions are for Linux (x86_64).

  • Download and extract the Adafruit SAMD library to ~/.arduino15/packages/adafruit/hardware/samd/1.0.9
  • Download and extract the ARM compiler to ~/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/4.8.3-2014q1
  • Download and extract Bossac to ~/.arduino15/packages/adafruit/tools/bossac/1.6.1-arduino.
  • Download and extract CMSIS to ~/.arduino15/packages/adafruit/tools/CMSIS/4.0.0-atmel.

Note: The archives above can be extracted whenever you'd like, but the paths at the top of the Makefile must be adjusted accordingly.

Compiling & Uploading

  1. Create arm/src/secrets.h with the following content:
    #define _SSID "your_ssid"
    #define _PASSPHRASE "passphrase"
  2. Change the network settings (IP, DNS, netmask, and gateway) for the Feather by editing the server header (arm/server.h) in the arm directory of this repo.
  3. Then:
    $ cd arm
    $ make WIFI_SERVER
    $ make upload

Android app

  1. Install the APK provided on the Releases page

Alternatively, the Android app can be compiled by:

  1. Install the Android SDK (
  2. Create in the android/ directory with the following contents: sdk.dir=/path/to/android/sdk.
  3. From the android directory, run:
    $ ./gradlew assembleDebug
    $ ./gradlew installDebug

Desktop client

  1. If desired, build the desktop client in the desktop directory of this repo on a Linux system by running make from that directory.
  2. The desktop client is fairly straightforward. Run it with --help for more info.

Wall Switch

  1. Wire the circuit as follows: On the switch VDD is pin 1 (left most) and LED- is pin 4 (right most).
  2. Then follow the instructions in the "Setting up the software dependencies" and "Compiling & Uploading" sections above.
  3. Use make WIFI_CLIENT to build.


The default port is 2424. Don't forget to add rules to allow communication on this port on any firewalls or gateways between the client and the server.


Copyright (C) 2012 Shane Tully

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see


An Arduino relay control server and Android client



LGPL-3.0, GPL-3.0 licenses found

Licenses found






No packages published