SmartphoneGarage-6

Old garage doors often have large, clunky remote control clickers. While purchasing additional remotes for old systems is possible, it’s a bit of an affront to my Maker spirit.

Rather than buy, I decided to brainstorm a DIY solution. I have a few basic system requirements.

  • Use in multiple vehicles
  • Small remote clicker so I can stash it in my pocket
  • Low cost
  • Secure
  • Minimal effort

Then it hit me! I always have my phone with me and perhaps I could leverage the phone’s built-in Wi-Fi or Bluetooth to communicate with the door. That’s when I stumbled on Blynk, a cloud platform that facilitates connection of development boards with their customizable iOS or Android app interface.

Deciding on the development board to use with Blynk was the easy part: The Particle Core! Unlike many of the supported Blynk devices, the Particle Core has built-in Wi-Fi and doesn’t require any extra, expensive shields to get online. Many devices on Blynk’s site support architectures that do not natively have Wi-Fi, Bluetooth, or on-board ethernet, but the Core is basically a Wi-Fi chip first.

Steps

Step #1: Modify the enclosure

PrevNext
Open Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle Core
  • First we'll cut two holes in the project enclosure to allow for wiring your relay and powering the Particle Core.
  • On one of the small sides of the project enclosure mark a 1/2" square with masking tape or feel free to freehand cut with the rotary tool. Then do the same on the opposite side of the enclosure.

Step #2: Mount the boards

PrevNext
Open Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle Core
  • Layer the bottom of the relay breakout board with double-sided foam tape and adhere the board to the top of the enclosure. Make sure that the screw terminals on the relay board are facing the edge of the enclosure.
  • Tape the mini breadboard to the enclosure top. Most mini breadboards come with an adhesive backing, but if yours does not, simply use the foam tape as you did with the relay board.
  • Stick the Particle Core in the middle of the mini breadboard and allow access for wiring to the GPIO pins.
  • Cut off one end of four female-to-female jumper wires. If you prefer, you could use a row of header pins and then you'd not have to cut your jumper wires at all.
  • Then wire the relay module to the Particle Core in the following way:
    • GND to GND (violet wire)
    • IN1 to D0 (yellow wire)
    • IN2 to D3 (purple wire)
    • VCC to 3V3 (red wire)

Step #3: Install Blynk on your smart phone

PrevNext
Open Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle Core
  • Grab your smart phone and install a copy of the Blynk app. Basically, the software makes a connection between your phone and your development board by sharing an auth token between the two devices. Once you flash your device with the Blynk code and auth token, it's easy to control the GPIO pins on your board from your phone.
  • Note: If you're worried about the security of a cloud-based service, you'll be happy to learn that it's possible to roll your own Blynk server. While that's way beyond the scope of this Weekend Project, it's a nice bonus that not all cloud platforms offer.
  • For iOS devices grab the software here.
  • For Android devices use this link.
  • Once the software is installed on your phone, load the application and create a Blynk account using your phone.

Step #4: Blynk project configuration

PrevNext
Open Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle Core
  • Once you login, tap on Create New Project, give it a name, and select Particle Core from the hardware model field.
  • Take a quick look at the Auth Token field below. Don't worry, you don't need to memorize the token. Instead, quickly hit the e-mail to send the token to the e-mail address associated with your Blynk account.
  • Finally, tap the Create Project button to save your configuration.

Step #5: Configure your garage program

PrevNext
Open Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle Core
  • Tap the screen to open the Blynk widget box. There are four types of actions available in Blynk: controllers, displays, notifications, and other. You'll only be using a controller action, but you can quickly see how extensible and easy it is to use Blynk to extend a program's functionality.
  • Click on the Button, change the pin assignment to D0, and ensure that momentary is toggled. When all that is configured, hit OK to save the configuration.

Step #6: Particle programming

PrevNext
Open Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle Core
  • Fire up your web browser and point it to the Particle IDE. If you've not setup a Particle Core before, check out their solid documentation.
  • Create a new sketch and give it a memorable title — I used "garage".
  • On the left side of the Build system, click the icon that looks like a bookmark or chimney — it all just depends on your perspective. This loads the library browser that's built into the Particle system.
  • Scroll down to the Community Libraries section and input Blynk in the search field. Then click on the Blynk result.
  • Tons of libraries will populate your browser, but don't worry. Look for the Include in App button and click it. All this does is adds the #include "blynk/blynk.h" to your sketch.
  • Copy the following code into the sketch or download it, but make sure you don't remove the include line. // This #include statement was automatically added by the Particle IDE. #include "blynk/blynk.h" char auth[] = "authtoken"; void setup() { Serial.begin(9600); Blynk.begin(auth); pinMode(D0, OUTPUT); } void loop() { Blynk.run(); }
  • Replace authtoken with the custom auth token generated by your cell phone app. Check out Step 4 if you need a reminder on how to get the auth token.
  • Once the sketch is completely input into the Build system, click the lightning bolt icon on the left to flash the Particle Core.

Step #7: Install the project

PrevNext
Open Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle CoreOpen Your Garage Door with a Smart Phone and Particle Core
  • Cut one small length of wire and bridge the two relays on their common pin. With this particular relay breakout it's not possible to simply wire one relay. If you did, anytime that the power went out to your Particle Core, the garage door would open. While it's an unlikely scenario, it's not so far fetched to not provide a solution. No unannounced free garage sales!
  • Then connect a red wire to the outside most left terminal of the relay and a black wire to the outside most right terminal. Refer to the first image of the step for visual explanation.
  • Note: The red and black wires should be long enough to run from the project enclosure and connect to the garage door motor terminals.
  • Turn off the power to your garage door either by throwing the breaker or unplugging the entire motor unit. Once power is safely off, open the motor house of your garage door and take out any bulbs that might prevent you from seeing the wiring terminals.
  • Wire the black wire from your relay to the ground wire in your garage motor and the red wire from the relay to the antenna terminal.
  • Mount your project box on the door opener using velcro tape, then plug your Photon into wall-wart power.
  • Now whenever you roll up to your garage door, just hit your Garage button in the Blynk app and you’re in!
Tyler Winegarner

Tyler Winegarner

Video producer for Make:, also tinkerer, motorcyclist, gamer. Reads the comments. Uses tools, tells stories. Probably a human. Tweets @photoresistor


Advertisement

  • Andrew Wilson

    Would there be any difference in doing this project on a Particle Pulse? It seems like Particle has discontinued the Core.

    • Tyler Winegarner

      Do you mean the Photon? At present, it doesn’t look like it. I don’t want to speak for Blynk, but I have to imagine that they would be supporting it n the future. In the meantime, there are still retailers selling the core, like Seeed.

      • lugose

        The photon is the “spiritual successor” of the core and is backward compatible.

      • Andrew Wilson

        Yes sorry, Photon. Not sure how I did that.

      • Blynk already supports Photon by Particle ;) It’s not in listed the app, but you can choose Particle Core – the pinout is the same, so it’s working.

        • Dalton Hall

          When I try to use Particle Core in the Bylnk app, and I have the Photon, I get error message “Your Particle Core is not in network”, so how do I use Blynk with a Phonton, won’t send auth code either.

          • Jay

            There is some sort of Blynk glitch that causes the Photon to go off line and throw the above error message. If you go in to Blynk and redo your button(s), it starts working again. Not sure I understand why, but it fixes the problem. Pulled my hair out for a long time until I discovered this. BTW, I did not change any setting.

  • fillyfanatical

    Any links to the products needed for a novice?

  • steveb9124

    Links to the parts would be greatly appreciated. I did find the Photon via Google easily (it sells for $19 FYI).

    This is slightly beyond my expertise, and I’m a little concerned that the video fly-though is a little too fast and not explained enough for beginners. It kinda has me wondering if someone feels like building this for me and then I’ll just buy it from you… :)

    • romanol

      i have idea’s makezi… < I've made $71,000 so far this year working online and I'm a full time student. Im using an online opportunity I heard about and I've made such great earning. It's really user friendly and I'm just so happy that I found out about it.

      Heres what I do…. SmallBusinessBigIncome

  • bwente

    Why the relay board? Wouldn’t be simpler to use an extra remote and hookup the Photon to the button or keypad? BTW I love my Spark and photon!

    • shalfjif

      JOBs AT  HOME SPECIAL REPORT………After earning an average of 19952 Dollars monthly,I’m finally getting 98 Dollars an hour,just working 4-5 hours daily online….It’s time to take some action and you can join it too.It is simple,dedicated and easy way to get rich.Three weeks from now you will wishyou have started today – I promise!….HERE I STARTED-TAKE A LOOK AT….giy…

      ➤➤➤➤ http://googleworldonlinemploymentsstartwork/start/earning/…. ⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛⚛

    • Nate Bohman

      The only reason I can imagine is the playback attacks that even rotating code openers are susceptible to (capture first code while jamming signal, capture second code while jamming signal, play back first code, use second code for entry). Bypassing wireless remotes and using a wifi connected particle board would make this system secure against those attacks though more susceptible to Internet based shenanigans.

    • lugose

      Doesn’t the relay protect the particle board from the power of the opener? BTW, the relay listed takes 5V power. In order to get it to work consistently I had to use the VIN pin on the photon instead of the 3v3 pin. I also found that one of the 2x relay shields could control two garage door openers if you don’t connect them together. You can use pin D0 and D1 as the two inputs to the relay and connect an opener to each (middle pin to the + side and the left most pin to the -)

      Anyway great idea. Thanks for getting me into it.

      • skyw33

        Thanks for the tip about the VIN vs 3v3. My understanding is that VIN can be used as a power input unless you have the unit hooked up to USB, in which case VIN becomes a power source. So my question for you is are you using usb for power? Thanks again!

        • lugose

          I do use USB to power the photon. Here is a picture of my latest configuration. I have added a couple of reed switches to check door states.

          So here is what I found that might help if you are trying to do this. And it might be the difference between the photon and the core, but this is what I did to make it work.

          1. The phone vin needs to power the relay shield and the ground from the shield needs to go to the gnd next to the vin.

          2. The relay sheild has two relays and I have two doors, so I used one relay per door and they seem to work fine. I am using D0 and D3 as OUTPUT on the photon to IN1 and IN2 on the relay shield.

          3. I added 2 reed switches which I use as input_pulldown on the photon connecting them to D1 and D4(wire1) and 3v3(wire2). In the picture it looks like the wire is going to D3, but it is actually going to D4 (there is only one wire on each).

          I plan on cleaning it up and creating a write up at some point with code and web interface, but I haven’t done it yet. I’ll update this post when I get it done. I got a lot of information from: https://community.particle.io/t/completed-garage-door-and-web-interface-schematic-and-code-included/4121 .

          I also added a bit of code on the photon side to close the door if it is open in the middle of the night, and a disable button on the web interface so that I can disable it if I need it to stay open for some reason.

  • Dave A

    Here’s what I did for my garage opener a few months ago. Also uses Blynk + has a fingerprint scanner: http://www.plastibots.com/index.php/2015/06/11/iot-garage-monitor-with-finger-print-sensor/

  • Trevor Fox

    This project looks awesome. I tried to follow the parts links, but they don’t link to a place I can buy the parts. Is there a resource you recommend to get the supplies from?

  • skyw33

    Public service announcement: The code will not work as-is. Please add the following line so that both D3 and D0 have a “pinMode” command:

    pinMode(D3, OUTPUT);

    I completed this project using the Particle Photon and everything worked as expected, other than the code change above.
    Cheers!

    • skyw33

      I also added a magnetic reed switch to sense when the garage door was open or closed. You can find it here:

      http://www.amazon.com/Directed-Electronics-8601-Magnetic-Switch/dp/B0009SUF08

      I changed the code significantly so that now I have a status LED in the Blynk app showing whether the garage is open or closed. I also removed the garage toggle button and add 2 other buttons: open and closed. Here’s the code:

      #include “blynk/blynk.h”

      char auth[] = “change this”;

      const int reedSwitch = D2;

      const int relaySwitch1 = D0;

      const int relaySwitch2 = D3;

      int reedStatus = 0;

      int ledStatus = 0;

      void setup()

      {

      Serial.begin(9600);

      Blynk.begin(auth);

      pinMode(relaySwitch1, OUTPUT);

      pinMode(relaySwitch2, OUTPUT);

      pinMode(reedSwitch, INPUT);

      }

      //add button in Blynk app corresponding to V0

      BLYNK_WRITE (0){ //close garage

      if (reedStatus == HIGH) {

      digitalWrite(relaySwitch1, HIGH);

      delay(1000);

      digitalWrite(relaySwitch1, LOW);

      }

      }

      //add button in Blynk app corresponding to V1

      BLYNK_WRITE (1){ //open garage

      if (reedStatus == LOW) {

      digitalWrite(relaySwitch1, HIGH);

      delay(1000);

      digitalWrite(relaySwitch1, LOW);

      }

      }

      //add LED in Blynk app corresponding to V3

      BLYNK_READ(3) //report garage status

      {

      Blynk.virtualWrite(3, ledStatus);

      }

      void loop()

      {

      Blynk.run();

      //constantly monitor the reed switch status (garage open or closed)

      reedStatus = digitalRead(reedSwitch);

      if (reedStatus == HIGH) {

      ledStatus = 1023;

      }

      else {

      ledStatus = 0;

      }

      }

      • 23

        Hello Skyw33, thanks for sharing! What would the code look like if I kept the initial code with garage toggle button and just wanted to add a status LED in Blynk? Thanks for the help!

        • skyw33

          You should just be able to have a toggle button in the app assigned to D0 (just like the original). Add the LED in the app associated with V3 and then the code below should work. There’s a significant change in the code below that involves “#including” SparkCorePolledTimer just like you added the Blynk library. After that, the code below should work…

          #include “blynk/blynk.h”
          #include “SparkCorePolledTimer/SparkCorePolledTimer.h”

          char auth[] = “change this”;

          SparkCorePolledTimer updateTimer(1000); //Create a timer object and set it’s timeout in milliseconds
          void garageStatus(void);

          const int reedSwitch = D2;
          const int relaySwitch1 = D0;
          const int relaySwitch2 = D3;

          int reedStatus = 0;
          int ledStatus = 0;
          int openTimer = 0;

          void setup()
          {
          Serial.begin(9600);
          Blynk.begin(auth);
          pinMode(relaySwitch1, OUTPUT);
          pinMode(relaySwitch2, OUTPUT);
          pinMode(reedSwitch, INPUT);
          updateTimer.SetCallback(garageStatus);
          reedStatus = digitalRead(reedSwitch);
          }

          void garageStatus(void)
          {
          reedStatus = digitalRead(reedSwitch);
          if (reedStatus == HIGH) {
          ledStatus = 1023;
          openTimer++;
          }
          else {
          ledStatus = 0;
          openTimer = 0;
          }
          }

          BLYNK_READ(3)
          {
          Blynk.virtualWrite(3, ledStatus);
          }

          void loop()
          {
          Blynk.run();
          updateTimer.Update();
          }

          • 23

            Thank you! As soon as I get the reed switch I am going to try this… I was also surprised to learn that you can open the garage door from anywhere you have internet access on your phone through the blynk app. I wrongly assumed that it only worked when you where on your home wifi that the photon was connected to.

          • 23

            I works perfectly!!! Thanks Skyw33!!!

          • Jay

            What is the wiring on the reed switch and what type of cable did you use?

          • Fefen

            Thanks skyway! Can you just share how you wired up the reed switch?

      • Dalton Hall

        I tried this code it all works except the LED in Blynk flashes when the switch is not made, works fine with switch made. I even removed the switch from board, it still flashes on Blynk. If I connect a wire to D7, the LED on the Photon, the LED in Blynk works great, if D7 is High, Blynk is on, D7 Low Blynk is off, no flashing. Could I be getting some kind of feed back or something else, I tried different pins for the LED, did not Change anything.

        • skyw33

          I’m not sure I understand. Are you trying to use the LED on the photon D7 or the LED in the app. See the code I posted in response to “23” in this thread — it’s a much better solution.

          • Dalton Hall

            I saw that code, have not tried it yet, but the led I was talking about is the one in Blynk, I only connected it to D7 when I was having trouble with it flashing in Blynk. I just used D7 as a power source, but it worked as intended as long as the switch is made.

          • Dalton Hall

            I do like that other code, but the LED in Blynk still blinks when the switch is not made. I connected a jumper from D3 and D7, now no blinking LED in Blynk. I fixed a button for D7, so when I click it the the LED on the Photon and the one in Blynk light, a test button to verify it is all working. The only thing I can figure is I am getting some feedback or something but with D7 connected it is keeping it from doing that, and gives me a test button.

          • skyw33

            I’m not sure what’s going on… Maybe someone else will see this and have a similar issue…

      • Jay Bremner

        This code posted above and the referred to significantly changed code are not nearly the same! Not saying anything about either one, but they both have completely different coding and neither works as is. Here is what I have so far, but I cannot get the LED to light in Blynk even if I take a jumper wire from 3V3 to D2 on Photon!:

        #include “blynk/blynk.h”

        #include “SparkCorePolledTimer/SparkCorePolledTimer.h”

        char auth[] = “authcodehere”;

        SparkCorePolledTimer updateTimer(1000); //Create a timer object and set it’s timeout in milliseconds

        void garageStatus(void);

        const int reedSwitch = D2;

        const int relaySwitch1 = D0;

        const int relaySwitch2 = D3;

        int reedStatus = 0;

        int ledStatus = 0;

        int openTimer = 0;

        void setup()

        {

        Serial.begin(9600);

        Blynk.begin(auth);

        pinMode(relaySwitch1, OUTPUT);

        pinMode(relaySwitch2, OUTPUT);

        pinMode(reedSwitch, INPUT);

        updateTimer.SetCallback(garageStatus);

        reedStatus = digitalRead(reedSwitch);

        }

        void garageStatus(void)

        {

        if (reedStatus == HIGH) {

        ledStatus = 1024;

        openTimer++;

        }

        else {

        ledStatus = 0;

        openTimer = 0;

        }

        }

        BLYNK_WRITE(1)

        {

        if (reedStatus == LOW) {

        digitalWrite(relaySwitch1, HIGH);

        delay(1000);

        digitalWrite(relaySwitch1, LOW);

        }

        }

        BLYNK_WRITE(0)

        {

        if (reedStatus == HIGH) {

        digitalWrite(relaySwitch1, HIGH);

        delay(1000);

        digitalWrite(relaySwitch1, LOW);

        }

        }

        BLYNK_READ(3)

        {

        Blynk.virtualWrite(3, ledStatus);

        }

        void loop()

        {

        Blynk.run();

        updateTimer.Update();

        }

        I physically have an LED plugged into D2 and it IS LIT, but cannot get V3 to light in Blynk. What am I doing wrong?

      • satish

        Can you please add comments to the code so we can understand what is being done? Also can you add instruction on how you setup the buttons in Blynk?

    • Tyler Winegarner

      Great feedback! I’d understood that the Photon would work in theory, but I hadn’t had a chance to work with one until a day or so ago. This explains why I was having so much trouble with it. Thanks for the find.

    • 23

      THANK YOU!!! I was losing my mind!

  • Trevor Fox

    I am trying to build this using the Photon unit. I got everything wired up and the Blynk button works perfectly. The problem comes when I kill the power to the unit. No matter how I wire the relay, it always triggers the door to open when the power is killed or when power gets restored. Anyone know why this might be happening?

    • Trevor Fox

      Thanks to skyww33 – you need to add pinMode(D3, OUTPUT); to the code in order for this to work when power is cut. Now it won’t open the door if it loses power and starts up again. Thanks guys.

      • BreakingBlynk

        @skyw33 @disqus_opWvJcDsfE
        Can you share a sample of the code you got working? I am still not able to get it to work properly. Each time my garage door has a power loss and then power comes back, the garage door opens. My code is below and I don’t know what I am doing wrong. – Thanks

        #include “blynk/blynk.h”
        char auth[] = “AuthCodeHere”;

        void setup()
        {
        Serial.begin(9600);
        Blynk.begin(auth);
        pinMode(D0, OUTPUT);
        pinMode(D3, OUTPUT);
        }

        void loop()
        {
        Blynk.run();
        }

  • muspdx
  • Mike Kuhn

    Great project…….If you like your garage door randomly opening and closing. Setup exactly as described using Photon and using the comments from user updates below, door was opening and closing like a champ then 2 hours later began opening and closing at random. Doesn’t seem like a secure solution at this time.

  • Dalton Hall

    I like this project, but was thinking of putting a photo electric cell on it so the door would close when it gets dark, and the light stays on for a little while when you open the door, then it would close when the light goes out, like a timer. I have a light I can turn on that will keep the door open if I wanted. I am not sure how to program that into it, l welcome any advice, I think I could figure it out. But what I don’t understand is the phone side of this, I see code, but how do I put that into the blynk app.

  • Jason Karl

    Cool project idea! I use a nodeMCU esp8266 unit instead of the Particle Core. From eBay I bought the nodeMCU, relay shield, 5v wall wart, and a temp/humidity sensor (b/c it was a buck fifty) for less than $15. Took a bit of monkeying to get it all working with the Arduino IDE and Blynk, but it’s working like a champ now. Thanks for the inspiration!

    • Armando E.

      Jason, I was so glad to see you did this with an esp8266. Would you mind sharing some of your experience. What was different using the 8266. What kind of “monkeying” was needed. I’d like to use an esp8266 -12 dev kit. It has the usb connection onboard, etc. Thanks.

      • Jason Karl

        Hi Armando-

        The set up that worked for me was to flash the esp8266 with its most recent firmware and then use the ESP8266 Core for Arduino addon to the Arduino IDE to write to my unit. You have to ground out the flash pin of the ESP8266 before you plug it into your computer in order to get it to start in bootloader mode (this is well described, but I didn’t initially realize exactly what that meant). The other issue I ran into is that I included a DHT11 temp/humidity sensor and had it hooked up to one of the RX pins. If the sensor was plugged in, it interfered with loading the code onto the board. Simply unplugging the sensor did the trick. I would imaging that this would be the case for anything plugged into one of the RX/TX pins.

        I was also originally having some trouble getting the Arduino code to write to the esp8266 (I’m using a NodeMCU version). It would work intermittently but occasionally fail and throw a write error after writing about half of the code to the board. If it started to fail, the only way I could get it to work again would be to reflash the firmware onto the board. After downloading the newest version of the Ardiuno IDE and reinstalling the ESP8266 Core for Arduino, however, I haven’t had any problems.

        I hope this helps!

        Jason

        • Armando E.

          Thank you, Jason. Yes, very helpful. I will also use a NodeMCU (ESP-12E). I am waiting for it to arrive. Thanks for your reply.

  • Ncross

    Is it possible to do this project with a garage door that looks like this? I have all the parts configured and couldn’t figure out which terminals I had to bridge to make the garage door open. Thank you

    • Dalton Hall

      What I did to find the correct pair of wires, I just disconnected one of the wires and hit the button on the wall, the first one I tried was not correct, the door started and then stopped, so I tried one of the other wires and noticed the light in the button was off and nothing happen when I hit the button. I connected my photon to those two wires and it worked great. Both sets were red and black, one set was the safety wires, and the other two was the button.

  • Garadget

    Great post! I’d suggest adding a sensor so it can be remotely controlled and monitored. I’m working on the similar project using Particle Photon P1 module: http://www.garadget.com/ I use laser to check the status of the door, but simple magnetic security sensor is a good option for DIY solution.

  • Stuart Moore

    I’m new to this and need some help. I think I’ve got it put together correctly but there doesn’t seem to be any signal sent through the connecting wires. I moved the red wire to the 3v3 connector (green box) and got 2 lights on the relay. The one marked with the red arrow turns off and on when I push the button I created in Blynk. The one marked with the green arrow stays on all the time. I also added the line of code mentioned by skyw33. Any help would be appreciated.

  • rhino

    FYI – I did the exact same project with the following modifications. 1. I only wired up D0 to one relay, nothing with D3. 2. I used a NPN transistor to invert the signal from D0 to the relay input. (Relay input on the collector, GND on the emitter, D0 & 1K resistor to the base). 3. wired the garage door connections to the normally open terminals on one of the relays. This leaves the other one open to switch something else. I found with this configuration, that you only use one relay, and you get the benefit of inverting the control signal to the relay board so when D0=HIGH, the relay is on. Also you do not get false triggers from power loss cycles because of the transistor setup.

    • andrew76092

      hi Rhino, great workaround. Would you mind posting your code that you used? I’ve been working on this for several weeks now and am pulling my hair out. Also, any photos you can attach would be great! Thanks in advance.

      • rhino

        The code is dead simple. Only thing I would add is pinMode(D0, OUTPUT); in the setup but it works for me without it. I’ll get some pictures tonight of the setup and maybe a napkin schematic. I do plan to add reed switches to detect the state of the door (open/closed), but not implemented yet. Here’s the code I use, but with my real Blynk auth code of course.

        // This #include statement was automatically added by the Particle IDE.

        #include “blynk/blynk.h”

        char auth[] = “Your_Blynk_Auth_Code_Here”;

        void setup()

        {

        Blynk.begin(auth);

        }

        void loop()

        {

        Blynk.run();

        }

        • rhino

          Couldn’t seem to get a good picture of the setup. But you can follow the red wire from the relay board to the bread board, this is where the transistor is.

          • andrew76092

            rhino I never followed up with a thank you! My apologies! Great setup, I’m still in the middle of mine but your responses have been of great value…thanks again.

            I (and i’m sure others) would be grateful to see what your setup and code looks like when you add the magnetic sensors to the unit. This is the part where I’m at with my project.

            As for my project, I’m going to bypass Blynk altogether and just use the Particle with IFTTT, I like the simplicity of that route and the fact it can be programmed via the DO button option. Ideally, when I’m 50 yards from home, I’ll have the garage door open up, designated lighting in the house turned on along with the TV turned on and my electronic lazy boy heated up! Work in progress.

      • rhino

        Here’s a schematic of the logic inverter for the relay board. I happen to be connected to only relay #2. This will turn on the relay only when D0 is HIGH. I think problems people were seeing with the power cycles is that the photon/core output would go low during a reboot and if there was power to the relay board it would trigger the relay. Which is why they tied in the other relay to invert the logic. But this seems like a waste of a perfectly good relay output to me. I’ll upload a picture of my setup tonight.

  • Scott Beckstead

    Why is it so hard to find out where to get a particle core?

    • andrew76092

      Scott, I was able to find mine at a local Micro Center in Dallas (the only one in the metroplex). I bought 4 of them which wiped them out….at $20 +/- per unit, these things are GOLD! Also, I highly recommend the book “Make: Getting Started with the Photon” by Simon Monk. You can find it on Amazon. It’s really helpful to gain a solid understanding the not only the Photon, but general coding as well.

      • Scott Beckstead

        Thanks, no Micro Center here in California. But I found the Photon from another link that was finally posted here. I was more complaining about the links that were labeled Particle Core but linked right back to this article instead of info on the Particle Core.

  • Scott Beckstead

    Thank you those who added the parts links. I was also commenting on the fact that the text that said “Particle Core” was just a link to the top of this article. Seemed a bit circular.