Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. mckenzi
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    mckenzi

    @mckenzi

    0
    Reputation
    16
    Posts
    221
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    mckenzi Follow

    Best posts made by mckenzi

    This user hasn't posted anything yet.

    Latest posts made by mckenzi

    • RE: How to connect QUIP300 to Domoticz

      Relay is working correctly, checked with multimeter. Now i'm study about debugging.
      Below is the code i'm using (4 PIRs).
      Problem with sleep mode?

      
      // Enable debug prints
      // #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      #include <MySensors.h>
      #define MY_NODE_ID AUTO
      unsigned long SLEEP_TIME = 5000 ; // 120000 Sleep time between reports (in milliseconds)
      #define DIGITAL_INPUT_SENSOR1 2   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define DIGITAL_INPUT_SENSOR2 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define DIGITAL_INPUT_SENSOR3 4   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define DIGITAL_INPUT_SENSOR4 5   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      
      #define CHILD_ID_PIR1 21   // Id of the sensor child
      #define CHILD_ID_PIR2 22   // Id of the sensor child
      #define CHILD_ID_PIR3 23   // Id of the sensor child
      #define CHILD_ID_PIR4 24   // Id of the sensor child
      
      // Enable repeater functionality for this node
      #define MY_REPEATER_FEATURE
      
      // Initialize motion message
      MyMessage msg1(CHILD_ID_PIR1, V_TRIPPED);
      MyMessage msg2(CHILD_ID_PIR2, V_TRIPPED);
      MyMessage msg3(CHILD_ID_PIR3, V_TRIPPED);
      MyMessage msg4(CHILD_ID_PIR4, V_TRIPPED);
      
      void setup()
      {
        pinMode(DIGITAL_INPUT_SENSOR1, INPUT);      // sets the motion sensor digital pin as input
        pinMode(DIGITAL_INPUT_SENSOR2, INPUT);      // sets the motion sensor digital pin as input
        pinMode(DIGITAL_INPUT_SENSOR3, INPUT);      // sets the motion sensor digital pin as input
        pinMode(DIGITAL_INPUT_SENSOR4, INPUT);      // sets the motion sensor digital pin as input
       }
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("PIR Sensor", "0.1");
      
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID_PIR1, S_MOTION);
        present(CHILD_ID_PIR2, S_MOTION);
        present(CHILD_ID_PIR3, S_MOTION);
        present(CHILD_ID_PIR4, S_MOTION);
      }
      
      void loop()
      {
      // Read digital motion value (PIR1)
        bool tripped1 = digitalRead(DIGITAL_INPUT_SENSOR1) == HIGH;
        if(digitalRead(DIGITAL_INPUT_SENSOR1) == HIGH)
          tripped1 = true;
         else 
          tripped1 = false;
      // Read digital motion value (PIR2)
        bool tripped2 = digitalRead(DIGITAL_INPUT_SENSOR2) == HIGH;
        if(digitalRead(DIGITAL_INPUT_SENSOR2) == HIGH)
          tripped2 = true;
         else 
          tripped2 = false;
      // Read digital motion value (PIR3)
         bool tripped3 = digitalRead(DIGITAL_INPUT_SENSOR3) == HIGH;    
         if(digitalRead(DIGITAL_INPUT_SENSOR3) == HIGH)
          tripped3 = true;
         else 
          tripped3 = false;
      // Read digital motion value (PIR4)
        bool tripped4 = digitalRead(DIGITAL_INPUT_SENSOR4) == HIGH;
        if(digitalRead(DIGITAL_INPUT_SENSOR4) == HIGH)
          tripped4 = true;
         else 
          tripped4 = false;
        
      
        
        Serial.println(tripped1);
        send(msg1.set(tripped1?"1":"0"));  // Send tripped value to gw
        
        Serial.println(tripped2);
        send(msg2.set(tripped2?"1":"0"));  // Send tripped value to gw
      
        Serial.println(tripped3);
        send(msg3.set(tripped3?"1":"0"));  // Send tripped value to gw
        
        Serial.println(tripped4);
        send(msg4.set(tripped4?"1":"0"));  // Send tripped value to gw
        
      // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR1), CHANGE, SLEEP_TIME);
          sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR2), CHANGE, SLEEP_TIME);
            sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR3), CHANGE, SLEEP_TIME);
              sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR4), CHANGE, SLEEP_TIME);
      
      
      }
      
      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      If my understanding is correct it works as follows:
      (HIGH : when relay is closed, connected to digital pin & 5V VCC)
      1- HIGH->TRUE-> msg.set 1
      2- LOW->FALSE->msg.set 0

      It works but it's very unstable. Sometimes working sometimes not.
      Is it necessary to add some resistors to this circuit?

      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      Hi Gohan,

      This is the way i should follow ?:

      	// Read digital motion value
      	
        if(digitalRead(DIGITAL_INPUT_SENSOR) == HIGH){
          tripped = true;
        } else {
          tripped = false;
        }
      

      Not so easy to set 🙂

      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      Hi GOHAN,

      Finally i've build my serial gateway ( Arduino UNO + nRF24) + node (Arduino Nano + nRF24) but i failed with PIR conection to my NODE. How should i connect PIR's relay to Nano ? ( digital input + GND ) ?
      Now i know that relay is normally closed ( 0, 1 state, no power on it)
      I was trying to connect this way and it was working for few second ( i saw in the serial monitor , 1 , 0) but after some time NODE was sending weird data to GW.
      How connect it corectlly and how to mod the sketch for more sensors? (4 pcs). ```
      This is the way ?

      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 1   // Id of the sensor child
      #define DIGITAL_INPUT_SENSOR 4   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 2   // Id of the sensor child```
      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      THank you Gohan. Now everything is more clearer. 🙂 Will try today to wire everything.

      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      Last question: one pin of each PIR's relay must be connected to common Arduino GND pin, right ?

      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      So how to connect 4 PIRs to one node to be able to see in Domoticz which was acivated ?

      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      Yellow cable is connected to PIR's relay. And this cable i'm going to conect to digital input of arduino.
      Second cable from PIR's relay will be connnected to arduino's GND pin. ( not shown on this photo).
      There is no voltage on PIR's relay ( works as simple switch).
      Is my understanding correct ?

      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      Hi, panel will be use as a power supply only.

      posted in Hardware
      mckenzi
      mckenzi
    • RE: How to connect QUIP300 to Domoticz

      Hi Gohan, please see my set up i more details.
      Each of PIR is conected to old/not used alarm control panel.
      Now it is used as power supply. I've just ordered Arduino Nano + nRF24L01 to conect all motion sensors. I would like to use one of free port to power my node (thru voltage step down : 12V->5V)
      0_1497296131460_sensors.JPG
      How should i conect sensors to node?

      posted in Hardware
      mckenzi
      mckenzi