Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
Tim AbelsT

Tim Abels

@Tim Abels
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • My Slim 2AA Battery Node
    Tim AbelsT Tim Abels

    @AWI: I am down to 1,3 µA :+1:

    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);
    }
    
    
    My Project

  • NRF24L01+ some batches won't power down properly
    Tim AbelsT Tim Abels

    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.

    Hardware

  • Nodemcu 0.9 + MQTT gateway + TEMP + Motion Sensor
    Tim AbelsT Tim Abels

    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

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular