Spencer hacks: automating our garage doors

profile picture

Geert

Hardware engineer

15 Jul  ·  3 min read


Our hardware team created a useful remote control hack for our office garage!

We love Particle products and their cloud service because it’s so easy to set up IOT devices in no time. This way, we can start working on a new device every time we spot an opportunity around the office. We’re always eager to add new little things to our in-house office assistant app, Spencer, and these products make that process pretty smooth.

This time, we’ll talk about one of those office domotics solutions we built: a garage door Spencer integration!

The problem: our office building has a small underground garage, and a few of those spots are ours to use. Our team members can park there when they’re heading out for external meetings, for instance. Unsurprisingly, however, we don’t have remotes for the garage doors for all of our 50-odd employees… Which mean everyone’s required to exit their car, open the doors manually with a normal key, and then enter. It’s one of those small nuisances (especially when it’s raining) that we’d want Spencer to solve.

We started with some research, looking up details for our specific make and type of garage door, in order to figure out whether we could achieve what we wanted: opening the doors with a simple tap of a button in our app. And of course, we couldn’t mess with the existing system…

Spencer integration

After finding the right documentation for our doors, we noticed that we could buy and use universal remotes to work with the door, so we ordered a number of those. They came with a straightforward set of instructions, and we could add one of the remotes to the existing system without much hassle. So far, so good!

We’d come to the conclusion that the easiest way of reaching our goal without tinkering with the door’s controls directly, was to hack a remote – in other words, to remotely trigger the remote.

To do that, we opened up the remote, and soldered 2 wires onto the button pins. We used a simple 2N3904 transistor that we had lying around as the switch schematic. To connect the upgraded remote to Spencer, we then added the Photon. Around this time, we also figured out that one of our meeting rooms is right above the garage door’s receiver, making it the perfect (safe, weatherproof) place to place our remote-controlled remote.

Schematic

We created a simple switch application code, that we could trigger with a cloud function. In these things, showing is better than telling, so you can check out the code below!

// Use D0 as trigger pin for the remote
static const int remotePin = 0;

// Default the remote is off
bool remoteOn = false;

void setup() {
    // Set D0 as the output pin
    pinMode(remotePin, OUTPUT);
    // Expose cloud function
    Particle.function("openGarage", triggerRemote);
}

void loop() {
    // Do we need to activate the garage in the current loop?
    if (remoteOn == true) {
        // Fake 2 presses on the button to make sure it is triggered
        digitalWrite(remotePin, HIGH);
        delay(1000);
        digitalWrite(remotePin, LOW);
        delay(300);
        digitalWrite(remotePin, HIGH);
        delay(1000);
        digitalWrite(remotePin, LOW);
        remoteOn = false;
    // Publish an event so we can capture it with a hook for the IOT slack channel
    Particle.publish("garage opened");
    }
}

// Cloud function for the remote
int triggerRemote(String param) {
    // Set boolean true so we can activate the garage in the next loop
    remoteOn = true;
    return 1;
}

With this in place, we integrated the remote with Spencer, using the Particle API. And to be able to follow up on the use of the Spencer integration in a quick and easy way, we created a simple Slack hook for good measure.

Slack hook

Do you like reading about our hardware endeavours? Then you’ll love this post about our custom-made coin dispenser! Or read all about Spencer on our case page.


profile picture

Geert

Hardware engineer

15 Jul  ·  3 min read