Navigation

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

    Posts made by Tim Abels

    • RE: My Slim 2AA Battery Node

      @AWI: I am down to 1,3 ยตA ๐Ÿ‘

      my code:

      //#define MY_DEBUG
      #define MY_RADIO_NRF24
      #define MY_NODE_ID 66
      #define MY_PARENT_NODE_ID 0
      #define MY_PARENT_NODE_IS_STATIC
      
      #include <MySensors.h>
      #include "Vcc.h"
      
      #define SKETCH_NAME "MySlim2aaBatteryNode"
      
      #define PRIMARY_CHILD_ID 3
      #define PRIMARY_BUTTON_PIN 3
      
      MyMessage msg(PRIMARY_CHILD_ID, V_TRIPPED);
      
      const float VccMin   = 1.7;           // Minimum expected Vcc level, in Volts.
      const float VccMax   = 3.3;           // Maximum expected Vcc level, in Volts.
      const float VccCorrection = 3.496 / 3.572;  // Measured Vcc by multimeter divided by reported Vcc
      
      const int32_t report_interval = 8640000; // 1day -> h * m * s * ms NOTICE: milliseconds, not microseconds!
      
      Vcc vcc(VccCorrection);
      
      #ifdef MY_DEBUG
      void before(){
          Serial.begin(9600);
      }
      #endif
      
      void setup()
      {
          pinMode(PRIMARY_BUTTON_PIN, INPUT);
      }
      
      void presentation()
      {
          sendSketchInfo(SKETCH_NAME, __DATE__);
          present(PRIMARY_CHILD_ID, S_DOOR, "Reed Contact");
      }
      
      void loop()
      {
          int32_t timestamp = millis();
      
          uint8_t reedState;
          static uint8_t lastReedState = 2;
          static int32_t lastBatteryReport = -report_interval; // for inital report
          sleep(5); // Short delay to allow buttons to properly settle
      
          reedState = digitalRead(PRIMARY_BUTTON_PIN);
      
          if ( (timestamp-lastBatteryReport) >= report_interval ) {
            uint8_t batteryPercent = (uint8_t)vcc.Read_Perc(VccMin, VccMax);
            sendBatteryLevel(batteryPercent);
            lastBatteryReport = timestamp;
          }
      
          if (reedState != lastReedState) {
              // Value has changed from last transmission, send the updated reedState
              send(msg.set(reedState==HIGH));
              lastReedState = reedState;
          }
      
          sleep(PRIMARY_BUTTON_PIN-2, CHANGE, 0);
      }
      
      
      posted in My Project
      Tim Abels
      Tim Abels
    • RE: NRF24L01+ some batches won't power down properly

      I struggled by the same problem 9 months ago and stopped working because of my frustration.

      https://forum.mysensors.org/topic/2067/my-slim-2aa-battery-node/313

      Let us know, where to buy good ones.

      posted in Hardware
      Tim Abels
      Tim Abels
    • RE: Nodemcu 0.9 + MQTT gateway + TEMP + Motion Sensor

      With esp8266 and MQTT you are not in the right corner at MySensors. You might want to check out ESPEasy:

      http://letscontrolit.com/wiki/index.php/ESPEasy

      posted in Troubleshooting
      Tim Abels
      Tim Abels