Is my wiring diagram correct to have nano run garage door lock via zwave switch

UPDATE: 7/20/2017

Well, I built the Garage door lock I was trying to make with the Arduino. I did notice I had some errors with the wiring diagram originally attached. I had the 5v- ground going to the ZFM-80 and the Limit switch, and not the 5v+. Also, I needed a pull-down 10k resistor from pin 2 to ground to take care of the debouncing. Everything is working perfectly so far, to my surprise. I have never worked with tiny electronics like these or microprocessors and only understand half of what I read. But this came out better than expected!! I’m extremely happy. I replaced the old incorrect wiring diagram with the New Correct one in case this helps anyone in the future. I’ve also attached the code I used to Program the Nano, and will attach a video on the Next post.

-Original Post-

Hello Arduino word, I just discovered the Arduino 3 days ago after watching a YouTube video and discovered it might be exactly what I’m looking for. Im building a zwave Garage door lock to be controlled via smartthings. I have yet to figure out how to program the Nano. I will worry about that later. Right now I’m focused on getting the wiring correct. Attached is what I have so far.

Here’s the breakdown.

The nano will be triggered by a ZFM-80 momentary relay switch. The relay switch is powered by 110-120v house power which activates a secondary switch that runs the nano’s ground to send a single to the nano.

The nano will then be connected to a 4 relay module (only 3 of the 4 are needed for my project). 2 of the relays will be used to control the polarity of the power being supplied to the actuator. The third will be used to provide power to the garage door motor only when the limit switch is activated (signaling that the lock is disengaged).

I have 1 - 12v/3a power supply that will power the actuator. The same power supply will also split off a separate line of power to be ran through a 5v/3a buck converter that will power the nano (and thus power the relays, limit switch signal, and ZFM-80 signal as well).

I’m not an electrician, and I’m sure I’m missing many things on my diagram. If some one can take a look at the attached file and advise me where I can correct or improve my layout I would greatly appreciate it.

Please Google "electronic schematic". Those are not schematics.

Paul

Ah, sorry. I'm very much new to this. I've corrected the title and language to reflect I'm requesting review of my wiring diagram and not a schematic. Thanks.

Here's the Code I used on the Arduino Nano. The ZFM-80 Zwave relay is not Momentary, but I have set up the code to respond to the ZFM-80 being activated as if it was a Momentary switch by comparing the current state of the Switch on every loop. The ZFM-80 switch has a little led that lights up when its on, which I like. I will be using this led to give me the status of the lock when I enter the garage. On = Garage Door Locked, Off = Garage Door UnLocked.

Note: The Code does not include any programing for Limit Switch just yet. The Limit switch has not arrived in the mail yet, so I'm unable to test it's set up.

 /* 
  Connect 5V on Arduino to VCC on Relay Module
  Connect GND on Arduino to GND on Relay Module 
  Connect 10k resistor from Pin 2 to GND */

 #define ZFM80 2   // Connect Digital Pin 2 on Arduino to ZFM80 Relay Module, And connect opposite end to 5v+ pin
 #define LIMIT 3   // Connect Digital Pin 3 on Arduino to Limit Switch on Door Lock
 
 #define CH1 4   // Connect Digital Pin 4 on Arduino to CH1 on Relay Module
 #define CH2 5   // Connect Digital Pin 5 on Arduino to CH2 on Relay Module
 #define CH3 6   // Connect Digital Pin 6 on Arduino to CH3 on Relay Module
 #define CH4 8   // Connect Digital Pin 8 on Arduino to CH4 on Relay Module
 
 #define LED 13 

 // variables will change:
 int buttonPushCounter = 0;   // counter for the number of button presses
 int buttonState = 0;         // current state of the button
 int lastButtonState = 0;     // previous state of the button
 
 void setup(){
   //Setup all the Arduino Pins
   pinMode(ZFM80, INPUT);
   pinMode(LIMIT, INPUT);
   
   pinMode(CH1, OUTPUT);
   pinMode(CH2, OUTPUT);
   pinMode(CH3, OUTPUT);
   pinMode(CH4, OUTPUT);
   pinMode(LED, OUTPUT);
   
   //Turn OFF any power to the Relay channels
   digitalWrite(CH1,HIGH);
   digitalWrite(CH2,HIGH);
   digitalWrite(CH3,HIGH);
   digitalWrite(CH4,HIGH);
   digitalWrite(LED,LOW);
   
   // initialize serial communication:
  /// Serial.begin(9600);
   
   delay(2000); //Wait 2 seconds before starting sequence
 }
 
 void loop(){

  // read the state of the pushbutton value:
  buttonState = digitalRead(ZFM80);
 /// Serial.println(buttonState);
  delay(1);

  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // went from off to on:
      buttonPushCounter++;
     /// Serial.println("on");
     /// Serial.print("number of button pushes:  ");
     /// Serial.println(buttonPushCounter);
      // turn RELAY 1 on for half a second and then off again:
      digitalWrite(CH1,LOW);
      digitalWrite(LED,HIGH);
      delay(500);
      digitalWrite(CH1,HIGH);
     // delay(100);
    } else {
      // if the current state is LOW then the button
      // went from on to off:
     /// Serial.println("off");
      // turn RELAY 2 on for half a second and then off again:
      digitalWrite(LED,LOW);
      digitalWrite(CH2,LOW);
      delay(500);
      digitalWrite(CH2, HIGH);
      //delay(100);
    }
    // Delay a little bit to avoid bouncing
    delay(50);
  }
  // save the current state as the last state,
  //for next time through the loop
  lastButtonState = buttonState;
    
 }

Here's the Video of the Lock working. Please let me know if I'm doing something wrong. Thanks :).

I LIKE IT!

Sent you a PM; looking to build one of these myself!

Thanks for your work and the info!