Navigation

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

    Posts made by warmaniac

    • RE: Lightning report - any idea ?

      @sundberg84

      yes , but this solution needs buying of sensor which costs about 25-30 € , this what I write , take a look on it needs only resistors and wires (plus arduino and radio of course)

      posted in Development
      warmaniac
      warmaniac
    • RE: Lightning report - any idea ?

      @gohan

      Yes this is true but these requires of buying sensors for about 30€ for example AS3935 , I think that one , which I mentioned is cheap because it only needs 2x 10 kOhm and 3,3 mOhm resistors . Only problem which I had is bring that code works with mysensors.

      posted in Development
      warmaniac
      warmaniac
    • Lightning report - any idea ?

      Hi ,

      I found this simple setup for lightning detection

      [https://create.arduino.cc/projecthub/runtimeprojects/a-lightning-detector-for-arduino-9f679c](link url)

      is there some way to implement it with mysensors to see it for example in domoticz ?

      posted in Development
      warmaniac
      warmaniac
    • RE: 💬 Sonoff relay using MySensors ESP8266 wifi or mqtt gateway

      @gohan said in 💬 Sonoff relay using MySensors ESP8266 wifi or mqtt gateway:

      is it reachable via IP or is it totally unresponsive?

      I had same problem too.. When is longer not turned on, Sonoff disconnects from wifi , that ip is not in client list, in my case I only turn sonoff on throught black button on the top and than it is okay about day-two.

      posted in OpenHardware.io
      warmaniac
      warmaniac
    • RE: 💬 Sonoff relay using MySensors ESP8266 wifi or mqtt gateway

      After electricity plugged off , it stops working / not connecting to wifi router, but on manual click it turns on and of , it is problem because I don't use haas config ? I dont know where can I place them, can you help me ? 🙂 thanks

      posted in OpenHardware.io
      warmaniac
      warmaniac
    • RE: LED strip remote without relay?

      @mfalkvidd

      And what about 433 mhz way like RFlink as usb gateway ? Will it drain less ?

      posted in Hardware
      warmaniac
      warmaniac
    • RE: LED strip remote without relay?

      @mfalkvidd

      Thanks for reply and interest, but question is : Do I need use Solid state relay or classic relay or how can I switch light on/off ? Thanks

      posted in Hardware
      warmaniac
      warmaniac
    • LED strip remote without relay?

      Hi ,

      I want to help make led strip remote powered trought 3x AAA batteries , which can I turn on/off remotely without relay (it consumes lot of power). I think when it works on 5V battery(3xAA) it may be powered trought arduino , or any ideas ?

      Led strip here

      http://www.ebay.com/itm/282380579023?_trksid=p2057872.m2749.l2648&var=581508983496&ssPageName=STRK%3AMEBIDX%3AIT

      posted in Hardware
      warmaniac
      warmaniac
    • RE: 💬 Sonoff relay using MySensors ESP8266 wifi or mqtt gateway

      @Efflon

      Tried LAN sketch after adding new hardware in domoticz this error occurs

      2017-04-06 06:28:07.230 MQTT: Connecting to 192.168.2.209:5003
      2017-04-06 06:28:07.335 Error: MQTT: disconnected, restarting (rc=2)
      

      after that Sonoff blik twice. What may be wrong ?

      Edit:

      Understand now , it is added as classic mysensor LAN gateway , now working fine ! I tried to do it complicated way , but it was easy 😄

      2017-04-06 06:30:29.756 MySensors: trying to connect to: 192.168.2.209:5003
      2017-04-06 06:30:30.757 MySensors: connected to: 192.168.2.209:5003
      2017-04-06 06:30:30.758 MySensors: Gateway Ready...
      2017-04-06 06:30:30.762 MySensors: Node: 0, Sketch Name: Sonoff ethernet
      2017-04-06 06:30:30.763 MySensors: Node: 0, Sketch Version: 1.0
      2017-04-06 06:30:30.769 (MQTT) Light/Switch (Light)
      2017-04-06 06:30:31.778 MySensors: Gateway Version: 2.1.1
      2017-04-06 06:30:31.779 MySensors: Gateway Version: 2.1.1
      
      2017-04-06 06:31:11.939 User: Admin initiated a switch command (87/Sonoff-1/On)
      2017-04-06 06:31:11.942 (MQTT) Light/Switch (Sonoff-1)
      2017-04-06 06:31:12.789 (MQTT) Light/Switch (Sonoff-1)
      
      posted in OpenHardware.io
      warmaniac
      warmaniac
    • RE: 💬 Sonoff relay using MySensors ESP8266 wifi or mqtt gateway

      @Efflon said in 💬 Sonoff relay using MySensors ESP8266 wifi or mqtt gateway:

      @warmaniac the sonoff works just like any sensor except its configured as a gateway since that is what is needed for esp8266+mysensors . Mqtt or ethernet/wifi is just a matter of taste and your setup, skip mqtt if you don't have anything else using it.

      I want to use standalone Sonoff (one device) than I must install broker (Mosquito) on my raspberry where is Domoticz running ? And how can I add than that device or how can this setup looks like.

      posted in OpenHardware.io
      warmaniac
      warmaniac
    • RE: 💬 Sonoff relay using MySensors ESP8266 wifi or mqtt gateway

      @Efflon

      Can I ask please ? I don't know if I understand correctly principle of working Sonoff under mysensors , I uploaded sketch from here to Sonoff , Sonoff is connected to my WiFi network , now I need to make MQTT gateway connected trought LAN or WiFi to the raspberry where is running Domoticz ? I had nodeMCU will it work ? Thanks much

      posted in OpenHardware.io
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      updated my sketch with new values for SCT-013-00 result is now

      #define MY_DEBUG
      #define MY_RADIO_NRF24
      // EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3  ***/
      #include <SPI.h>
      #include <MySensors.h>
      #include "EmonLib.h"             // Include Emon Library
      EnergyMonitor emon1;             // Create an instance
      
      #define CHILD_ID_CLAMP1 0
      #define PIN_ANALOG_I1 A1 //pince amperemetrique1
      
      unsigned long lastSend_power = millis();
      unsigned long lastSend_c = millis();
      unsigned long SEND_FREQUENCY = 120000; // Minimum time between send (in milliseconds). We don't wnat to spam the gateway.
      unsigned long SEND_FREQUENCY_C = SEND_FREQUENCY / 30;
      int index = 0;
      double Irms1 = 0;
      boolean pcReceived1 = false;
      float nrj1 = 0, old_nrj1;
      
      MyMessage IrmsMsg1(CHILD_ID_CLAMP1, V_WATT);
      MyMessage kWhMsg1(CHILD_ID_CLAMP1, V_KWH);
      MyMessage pcMsg1(CHILD_ID_CLAMP1, V_VAR1);
      
      void before() {
      
      }
      
      
      void presentation()
      {
        sendSketchInfo("Multisensors_Entree", "2.0");  // Send the sketch version information to the gateway and Controller
        present(CHILD_ID_CLAMP1, S_POWER);   // Register this device as power sensor
        request(CHILD_ID_CLAMP1, V_VAR1);
      }
      
      
      void receive(const MyMessage &message)
      {
        if (message.type == V_VAR1)
        {
          nrj1 = old_nrj1 = message.getFloat();
          Serial.print("Received last nrj count from gw:");
          Serial.println(nrj1);
          pcReceived1 = true;
        }
      }
      
      void setup()
      {
        emon1.current(PIN_ANALOG_I1, 111.1);       // Current: input pin, calibration.
        Serial.println("SETUP completed");
      }
      
      void envoi_donnees(double intrms, int id_clamp)
      {
        Serial.print("Envoi des donnees .... clamp="); Serial.println(id_clamp);
        double energie = (intrms * 240.0 * SEND_FREQUENCY / 1000) / 3.6E6;
        switch (id_clamp) //can be modified ...
        {
          case 1:
            {
              send(IrmsMsg1.set(intrms * 240.0, 1));
              nrj1 += energie;
              send(kWhMsg1.set(nrj1, 5));
              send(pcMsg1.set(nrj1, 5));
              old_nrj1 = nrj1;
            }
            break;
        }
      }
      
      void loop() {
        unsigned long now = millis();
        bool sendTime_c = now - lastSend_c > SEND_FREQUENCY_C;
        // Calcul de Irms1 et Irms2
        if (sendTime_c) //calcul Irms moy clamp1/clamp2
        {
          if (index == 0)
          {
            Irms1 = emon1.calcIrms(1480);
          }
          else  
          {
            Irms1 = (index * Irms1 + emon1.calcIrms(1480)) / (index + 1);
          }
          lastSend_c = now;
          index++;
        }
      
      bool sendTime_power = now - lastSend_power > SEND_FREQUENCY;
      
       if (sendTime_power)
      {
        // Envoi ou request Puissance1
        if (pcReceived1) envoi_donnees(Irms1, 1);
        else     {
          request(CHILD_ID_CLAMP1, V_VAR1);
          Serial.println("Request VAR1");
        }
        //on reinitialise les compteurs
        lastSend_power = now;
        index = 0;
        }
      }
      

      0_1490992284051_upload-583cafbf-bd94-4bad-8fd3-8c510f5cfbfc

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @fredok

      I had SCT-013-000 , not SCT-013-030 maybe this is the problem of measuring .

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @gohan

      Because with test sketch from that site I get actual consumption 0,5 kWh but from mysensors sketch I get much higher values look

      0_1490962213606_upload-ed834413-8133-438b-8e2a-95c017b3f33c

      1,7 kWh per one hour is too much , I had only TV and fridge in power on mode, I had total consumption per last year about 2140 kWh , which is about 6 kWh per day.

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @fredok

      Okay 🙂 understand now, and what about calibration for wiring I followig this site

      https://learn.openenergymonitor.org/electricity-monitoring/ct-sensors/how-to-build-an-arduino-energy-monitor-measuring-current-only?redirected=true

      And they calibrate

       emon1.current(1, 111.1); 
      

      And yours calibration

        emon1.current(PIN_ANALOG_I1, 30.0);
      

      Is some difference after this calibrations in measuring ?

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @fredok

      Thank you very much! Only one question left, with multimeter I measured my voltage 241.0 V could I update it in sketch or ?

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @fredok

      sketch works better now , not spamming

      0_1490898851738_upload-e9fbdb1a-1c4f-4356-826f-4e9112a25036

      0_1490898895065_upload-f9c9fbff-f6e5-48ee-96de-8bf28054b129

      but I dont understand current values

      0_1490898965008_upload-d6846108-30b7-4a7d-ad02-c0b0897b20fd

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @fredok

      I modyfied your sketch (deleting unwanted code like dallas and light sensor) it works but i think I done something wrong, because it spams my gateway , now it looks like this

      //#include <Arduino.h>
      #define MY_DEBUG
      #define MY_RADIO_NRF24
      // EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3  ***/
      #include <SPI.h>
      #include <MySensors.h>
      #include <OneWire.h>
      #include "EmonLib.h"             // Include Emon Library
      EnergyMonitor emon1;             // Create an instance
      
      #define CHILD_ID_CLAMP1 0
      #define PIN_ANALOG_I1 A1 //pince amperemetrique1
      
      bool receivedConfig = false;
      bool metric = true; //truc v2.0
      
      //int compat = 0;
      unsigned long lastSend_temp = millis();
      unsigned long lastSend_power = millis();
      unsigned long lastSend_c;
      unsigned long SEND_FREQUENCY = 120000; // Minimum time between send (in milliseconds). We don't wnat to spam the gateway.
      unsigned long SEND_FREQUENCY_C = SEND_FREQUENCY / 30;
      int index = 0;
      double Irms1 = 0;
      boolean pcReceived1 = false;
      
      float nrj1 = 0, old_nrj1;
      
      MyMessage IrmsMsg1(CHILD_ID_CLAMP1, V_WATT);
      MyMessage kWhMsg1(CHILD_ID_CLAMP1, V_KWH);
      MyMessage pcMsg1(CHILD_ID_CLAMP1, V_VAR1);
      
      void presentation()
      {
      
        sendSketchInfo("Multisensors_Entree", "2.0");  // Send the sketch version information to the gateway and Controller
        present(CHILD_ID_CLAMP1, S_POWER);   // Register this device as power sensor
        request(CHILD_ID_CLAMP1, V_VAR1);
      }
      
      
      void receive(const MyMessage &message)
      {
        if (message.type == V_VAR1)
        {
          nrj1 = old_nrj1 = message.getFloat();
          Serial.print("Received last nrj count from gw:");
          Serial.println(nrj1);
          pcReceived1 = true;
        }
      
      }
      
      void setup()
      {
        emon1.current(PIN_ANALOG_I1, 30.0);       // Current: input pin, calibration.
        Serial.println("SETUP completed");
      }
      
      void envoi_donnees(double intrms, int id_clamp)
      {
        Serial.print("Envoi des donnees .... clamp="); Serial.println(id_clamp);
        double energie = (intrms * 232.0 * SEND_FREQUENCY / 1000) / 3.6E6;
        switch (id_clamp)
        {
          case 1:
            {
              send(IrmsMsg1.set(intrms * 232.0, 1));
              nrj1 += energie;
              send(kWhMsg1.set(nrj1, 5));
              send(pcMsg1.set(nrj1, 5));
              old_nrj1 = nrj1;
            }
            break;
        }
      }
      
      void loop() {
        unsigned long now = millis();
        bool sendTime_c = now - lastSend_c > SEND_FREQUENCY_C;
        // Calcul de Irms1 et Irms2
        if (sendTime_c) //calcul Irms moy clamp1/clamp2
        {
          if (index == 0)
          {
            Irms1 = emon1.calcIrms(1480);
          }
          else  
          {
            Irms1 = (index * Irms1 + emon1.calcIrms(1480)) / (index + 1);
          }
          lastSend_c = now;
          index++;
        }
      
      bool sendTime_power = now - lastSend_power > SEND_FREQUENCY;
      
       if (sendTime_power)
      {
      
        // Envoi ou request Puissance1
        if (pcReceived1) envoi_donnees(Irms1, 1);
        else     {
          request(CHILD_ID_CLAMP1, V_VAR1);
          Serial.println("Request VAR1");
        }
      
        }
      }
      

      and I get this results now

      1_1490873287086_zaznam.png 0_1490873287086_meter.png

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @fredok

      nice ! thank you very much for fast solution 🙂 I try it at home , it compiles well 👍

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @gohan

      tried to modify but I always get error

      /MySensors.h:328:2: error: #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.

      #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.

      // EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3  ***/
      #include <SPI.h>
      #include <MySensors.h>  
      #include "EmonLib.h"             // Include Emon Library
      EnergyMonitor emon1;             // Create an instance
      #define CHILD_ID 0 
      #define MY_RADIO_NRF24
      #define PIN_ANALOG_I A1
      
      //MySensor gw;
      unsigned long lastSend;
      unsigned long lastSend2;
      unsigned long SEND_FREQUENCY = 20000; // Minimum time between send (in milliseconds). We don't wnat to spam the gateway.
      unsigned long SEND_FREQUENCY2 = SEND_FREQUENCY / 25;
      int index = 0;
      double Irms=0;
      double power;
      boolean pcReceived = false;
      boolean onyva=true;
      float nrj=0, old_nrj;
      MyMessage IrmsMsg(CHILD_ID,V_WATT);
      MyMessage kWhMsg(CHILD_ID,V_KWH);
      MyMessage pcMsg(CHILD_ID,V_VAR1);
      
      
      //void incomingMessage(const MyMessage &message) 
      
      void receive(const MyMessage &message) 
      {
        if (message.type==V_VAR1) 
        {  
          nrj = old_nrj = message.getFloat();
          Serial.print("Received last nrj count from gw:");
          Serial.println(nrj);
          pcReceived = true;
        }
      }
      
      void presentation () { 
        
        sendSketchInfo("Energy Meter", "1.0");  // Send the sketch version information to the gateway and Controller
        present(CHILD_ID, S_POWER);   // Register this device as power sensor
        request(CHILD_ID, V_VAR1);
       
        }
      
      void setup()
      {  
        begin(incomingMessage);
        emon1.current(PIN_ANALOG_I, 30.0);       // Current: input pin, calibration.
      }
      
      void loop()
      {
        if (onyva) process();
        onyva = false; 
        unsigned long now = millis();
        //unsigned long now2 = millis();
        bool sendTime2 = now - lastSend2 > SEND_FREQUENCY2;
        if (sendTime2) //calcul Irms moy
        {
          if (index==0) Irms=emon1.calcIrms(1480);
          else {
          index++;
          Irms = (index*Irms+emon1.calcIrms(1480))/(index+1);
          }
          lastSend2 = now;
        }
        bool sendTime = now - lastSend > SEND_FREQUENCY;
        if (sendTime && pcReceived) 
        { 
          power = Irms*232.0;
          send(IrmsMsg.set(power,1));
          Serial.println(Irms*232.0);
          nrj += (power*SEND_FREQUENCY/1000)/3.6E6;
          send(kWhMsg.set(nrj,5));
          send(pcMsg.set(nrj,5));
          lastSend = now;
          index = 0;
          old_nrj=nrj;
          onyva=true;
        }
       else if (sendTime && !pcReceived)
       {
        request(CHILD_ID, V_VAR1);
        lastSend=now;
        index=0;
        onyva=true;
       }
      }
      

      It is possible to compile it with old mysensors library ? It will work with gateway which has a newest version ?

      posted in Hardware
      warmaniac
      warmaniac
    • RE: SCT-013-030 current monitor sensor

      @fredok

      hi , do you have please updated sketch for newest version of domoticz ? This old cause problems when I compiling it.

      Thanks 👍

      posted in Hardware
      warmaniac
      warmaniac
    • RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation

      @AWI

      Thanks , I take a read after I finish in work. But I decided to use ds18b20 sealed version plus standalone humidity sensor , maybe it will be better 🙂 Then I post some experiences. Maybe you can take a look on my photos too , I like landscapes photos , but sometimes I shooting weddings too 🙂 www.pinak-art.com

      posted in Troubleshooting
      warmaniac
      warmaniac
    • RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation

      @AWI

      I understand but it's mysterious thing , because indoor it works ok , but when I put it outside , readings are not correct , maybe it is not for outdoor usage 😞

      posted in Troubleshooting
      warmaniac
      warmaniac
    • RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation

      @AWI

      I had this one, is it OK ? I power it directly from 2xAA batteries, and can operate 1,71 to 3,7 volts as I saw in datasheet .Then you said that is problem of using because it has self heating problem ?

      https://www.ebay.com/itm/152306676745

      posted in Troubleshooting
      warmaniac
      warmaniac
    • RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation

      @gogopotato

      I had 5 pcs of DHT 11 and 3 pcs of DHT22 and there are seriously piece of sh.. 🙂 humidity readings was very bad only temperature okay , than if you want to measure only temperature best way is buy waterproof ds18b20 , https://www.ebay.com/itm/112029570094

      posted in Troubleshooting
      warmaniac
      warmaniac
    • RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation

      @gogopotato

      I had problem that BME is inaccurate outside , I'm using BME180 and BME 280 both works great inside readings are almost same , but when I put it outside temperature is much higher than real, I compare it with ds18b20 or with my standalone weather station + local weather station , it was almost same but BME is higher about 2 degrees

      posted in Troubleshooting
      warmaniac
      warmaniac
    • RE: DHT22 - humidity problem

      @bgunnarb

      nevermind... but still finding the best way how to wire it and power it. Readings are inaccurate 😞

      posted in Hardware
      warmaniac
      warmaniac
    • RE: BME280 Temp/Hum sensor on battery power increasingly skips(?) operation

      @gogopotato

      Can you please paste your sketch? I found some here but I think is outdated, readings not working properly . Thanks !

      posted in Troubleshooting
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      @mortommy

      YES !!! That's it !!! But it is fatal error , because i use step up booster and when battery goes down , It caused that arduino start / shutdown quickly , it spams my Gateway I must disconnect it .

      posted in Development
      warmaniac
      warmaniac
    • RE: DHT22 - humidity problem

      @bgunnarb

      Im looking on PINout of DHT22 you mean pull down resistor from PIN2 to the ground ?

      0_1489577345067_DHT22-PinOut.png

      posted in Hardware
      warmaniac
      warmaniac
    • RE: DHT22 - humidity problem

      @bgunnarb said in DHT22 - humidity problem:

      The capacitor you should use on the Vcc line to the radio, as close to the radio as possible. At least 4.7 uF but anything higher is good. I normally use 10 uF or 22 uF which I have a large supply of.

      Yep, on radio I had 10 uF capacitor , radio is OK , but humidity is balancing between real values and stable lower values , I comparing it with standalone meteo station I bought . I try it today and write if it helps. Thanks !

      posted in Hardware
      warmaniac
      warmaniac
    • RE: DHT22 - humidity problem

      @bgunnarb

      Do you know please which capacity should I use for 3.3V battery powering ?

      posted in Hardware
      warmaniac
      warmaniac
    • DHT22 - humidity problem

      Hi,

      I want to ask if somebody had same problem with humidity on DHT22 or DHT11 is same .I'm using it on Arduino UNO and Arduino mini PRO , it was same when I powering it with battery or trought FTDI USB cable , tried from 3.3V , 5V .Temperature was all time ok , look please the screens at the botom . Had 10 pcs DHT11 , 5 pcs DHT22 all was same .

      1_1489568690071_humidity_2.png 0_1489568690070_humidity_1.png

      posted in Hardware
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      @AWI

      if I understand correctly you mean like this ?

      void loop() 
      {
        debouncer.update();
        // Get the update value
        int value = debouncer.read();
      
        if (value != oldValue) {
           // Send in the new value
           send(msg.set(value==HIGH ? 1 : 0));
           oldValue = value;
        }
      sleep(200);
      sleep(digitalPinToInterrupt(BUTTON_PIN)-2, CHANGE, 0);
      }
      
      

      Wouldn't be delay(200) doing same function ?

      posted in Development
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      @mortommy

      Thanks for you reply !
      Apologize me, if I mistaken , but ceramic capacitors in values 100 uF was only SMD? That can't I solder yet. 😞

      posted in Development
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      I don't know if this is correct sketch but now working on interrupts , take a look please

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * DESCRIPTION
       *
       * Simple binary switch example 
       * Connect button or door/window reed switch between 
       * digitial I/O pin 3 (BUTTON_PIN below) and GND.
       * http://www.mysensors.org/build/binary
       */
      
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      #include <SPI.h>
      #include <MySensors.h>
      #include <Bounce2.h>
      
      #define CHILD_ID 3
      #define BUTTON_PIN  3  // Arduino Digital I/O pin for button/reed switch
      
      Bounce debouncer = Bounce(); 
      int oldValue=-1;
      
      // Change to V_LIGHT if you use S_LIGHT in presentation below
      MyMessage msg(CHILD_ID,V_TRIPPED);
      
      void setup()  
      {  
        // Setup the button
        pinMode(BUTTON_PIN,INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN,HIGH);
      
        // After setting up the button, setup debouncer
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(5);
      
      }
      
      void presentation() {
        // Register binary input sensor to gw (they will be created as child devices)
        // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. 
        // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
        present(CHILD_ID, S_DOOR);  
      }
      
      
      //  Check if digital input has changed and send in new value
      void loop() 
      {
        debouncer.update();
        // Get the update value
        int value = debouncer.read();
      
        if (value != oldValue) {
           // Send in the new value
           send(msg.set(value==HIGH ? 1 : 0));
           oldValue = value;
        }
      sleep(digitalPinToInterrupt(BUTTON_PIN)-2, CHANGE, 0);
      }```
      posted in Development
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      @LastSamurai

      I tryied , many times and changes in sketch but im failed, not waking up on interrupts , im not programmer maybe if I know better C langauge. 😞 Im using DIGITAL PIN 3 for magnetic sensor input.

      posted in Development
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      @sundberg84

      I had barometer BMP180 powered on 2xAA 1,5V , in usage from 1.March 2017 , Start battery power was 85% (not new batteries, before used) and now after 14 days of usage is 84 % , Im very satisfied. Using only without LEDs ,with power regulator on arduino.

      1_1489491784079_baro_2.png 0_1489491784079_baro_1.png

      posted in Development
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      @sundberg84

      Yep I understand , but I ordered 10 pcs of step up boosters, all gives output voltage 3,7 -3,8V . without regulator is problem ,I think.

      posted in Development
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      @sundberg84

      BOTH led was removed , as I said , this HW specs Im using on multiple sensors with sleep function and i dont have any problems with battery. Thanks for recommendation of using modified sketch from motion sensor. Im not expecting to remove voltage regulator because im powering my arduino with stepup booster which can be higher than 3.3 volts .

      posted in Development
      warmaniac
      warmaniac
    • RE: Low power battery Door/Window sketch nrf24l01

      I'm not having problem with my hardware with other sensors which sleeps every 2 minutes. Same hardware lasts on 1 % battery for 2 weeks , it is good result for me . I only want to know if is better sketch for battery powered door sensor which is based on interrupts wake up from sleep. It will be much better for battery.

      posted in Development
      warmaniac
      warmaniac
    • Low power battery Door/Window sketch nrf24l01

      Hi there,

      I want to ask if somebody had already done a sketch for 2AA 1,5V battery powered arduino with nrf24l01 wireless radio based on interrupt pin detection ? I have done couple of hours searching and trying but I'm not very successful with it. The default sketch on this web https://www.mysensors.org/build/binary drains my batteries powered by power booster after 24 hours to 0,8 volts 🐱

      In advance, I really appreciate your support in this matter

      posted in Development
      warmaniac
      warmaniac
    • RE: Output voltage problem with StepUp Booster 3.3V

      @boozz

      Could you please send me what you mean ?
      Something like this ?
      http://www.ebay.com/itm/New-Zener-Diode-DIP-1-2W-0-5W-2-4V-8-2V-14-Values-Choice-Free-P-P-/262770408086?var=&hash=item3d2e563a96ⓂmHD19Qu_1sjnfaWnrsCUbPQ

      Will not be generating additional energy consumption?

      posted in Hardware
      warmaniac
      warmaniac
    • RE: Output voltage problem with StepUp Booster 3.3V

      yep , it works well without step up booster , but when I added it, voltage is too high for radio 😞

      posted in Hardware
      warmaniac
      warmaniac
    • RE: Output voltage problem with StepUp Booster 3.3V

      @pansen

      PIN Configuration :

      SOT-89-3

      posted in Hardware
      warmaniac
      warmaniac
    • RE: Output voltage problem with StepUp Booster 3.3V

      If I understand correctly, It was measured under load , arduino mini pro 3.3V with nrf24l01+ as door sensor.

      @pansen
      on the chip is written
      LA 3.3
      17B3S

      posted in Hardware
      warmaniac
      warmaniac
    • RE: Output voltage problem with StepUp Booster 3.3V

      I measured it on VCC of radio , radio isn't working, alredy tried to add 100 uF capacitor after booster V out , but it not working.

      posted in Hardware
      warmaniac
      warmaniac
    • Output voltage problem with StepUp Booster 3.3V

      Hi ,

      I ordered 5 pcs step up boosters from different sellers on ebay.com

      like here http://www.ebay.com/itm/222350595744?_trksid=p2057872.m2749.l2648&ssPageName=STRK%3AMEBIDX%3AIT

      and the problem is my output voltage which is from 3,75 - 3,83 Volts, tried many types of new batteries 2xAA input voltage was about 3,10 - 3,20 Volts . How can I solve it to have stable about 3.3 Volts .

      Thanks much.

      posted in Hardware
      warmaniac
      warmaniac