Navigation

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

    Topics created by xydix

    • xydix

      smartSleep with 2.3.0, missing messages
      Troubleshooting • • xydix  

      1
      0
      Votes
      1
      Posts
      803
      Views

      No one has replied

    • xydix

      Reliable communication.
      Development • • xydix  

      14
      0
      Votes
      14
      Posts
      1685
      Views

      zboblamont

      @xydix The lower power you can use the better, particularly where battery powered. You can see the size differences between the W and the CW on the lowpowerlab link below, but note that W and HW are pin compatible, CW and HCW are not... link text
    • xydix

      Smart button / scene controller
      My Project • • xydix  

      8
      1
      Votes
      8
      Posts
      3916
      Views

      xydix

      Thank you. It is solved now. Here is the new sketch reporting battery level using the vcc library. /* Mysensors Smart Button */ #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_NODE_ID 7 #include "OneButton.h" #include <SPI.h> #include <MySensors.h> #include <Vcc.h> #define SN "Kitchen Table" #define SV "1.0" #define CHILD_ID 1 #define SLEEP_PIN 2 // Setup a new OneButton on pin D2. true will set pin high (internal pull up), false will set pin low. OneButton button(2, true); unsigned long previousMillis = 0; unsigned long currentMillis = 0; const long interval = 5000; const float VccMin = 1.9; // Minimum expected Vcc level, in Volts. (NRF can only go to 1.9V) const float VccMax = 3.3; // Maximum expected Vcc level, in Volts. const float VccCorrection = 1.0 / 1.0; // Measured Vcc by multimeter divided by reported Vcc Vcc vcc(VccCorrection); MyMessage on(CHILD_ID, V_SCENE_ON); // setup code here, to run once: void setup() { // link the doubleclick function to be called on a doubleclick event. button.attachClick(click); button.attachDoubleClick(doubleclick); button.attachPress(press); } // setup void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo(SN, SV); present(CHILD_ID, S_SCENE_CONTROLLER); } int messageA = 1; int messageB = 2; int messageC = 3; void loop() { currentMillis = millis(); // keep watching the push button: button.tick(); if (currentMillis - previousMillis >= interval) { previousMillis = currentMillis; float p = vcc.Read_Perc(VccMin, VccMax); sendBatteryLevel((uint8_t)p); Serial.println("Sleep"); sleep(SLEEP_PIN - 2, CHANGE, 0); } } // loop // this function will be called when the button was pressed one time void click() { send(on.set(messageA)); } // this function will be called when the button was pressed 2 times in a short timeframe. void doubleclick() { send(on.set(messageB)); } // doubleclick // this function will be called when the button was pressed for about one second void press() { send(on.set(messageC)); }
    • xydix

      New nodes, new problems :/ Motion sensor [Solved]
      Home Assistant • • xydix  

      10
      0
      Votes
      10
      Posts
      3018
      Views

      xydix

      I guess this thread should be in the hardware forum. But if someone find this thread i can share some pictures and the idea with this node. I built it as a USB-stick with a USB-connector on a prototype PCB. Not good looking but when i get my TV up on the wall you can't see it. I use it to turn on light in the bathroom at night if my kids visit the toilet.
    • xydix

      Arduino UNO R3 maximum current?
      Hardware • • xydix  

      3
      0
      Votes
      3
      Posts
      1957
      Views

      xydix

      Not so fancy but this is how I did. It will do for now. This is the 5V pin under the USB connector. Now I get 5V directly from my USB power supply.
    • xydix

      My first relay. connected to GW 2.1.0
      Home Assistant • • xydix  

      20
      0
      Votes
      20
      Posts
      5179
      Views

      martinhjelmare

      When you invert the defines for relay, you are not only inverting how the relay will react on digitalWrite, you are also inverting how the state of the relay is reported back to home assistant. This is where the problem gets introduced. As home assistant on turn on action always sends a 1 as payload to the device, the device will now send a 0 back as state feedback. This will tell home assistant that the state should be off, instead of on. So it will be impossible to turn the relay on from home assistant. If you do want to invert the high/low behavior of the relay, you need to decouple the high/low defines from the state reporting 1/0, ie use different defines. If you want the device to be shown as a light in home assistant you need to present the device as S_DIMMER and send both V_PERCENTAGE and V_STATUS, in mysensors version 2.*. S_BINARY and S_LIGHT will be shown as a switch.
    • xydix

      Battery booster / voltage regulator
      Hardware • • xydix  

      4
      0
      Votes
      4
      Posts
      1952
      Views

      Nca78

      @xydix no worries with voltage below 3.3V. On the pro mini the BOD (which will reset arduino if voltage is too low) is set at 2.7v so you have a lot of margin. I use some sensor with CR2032 cell battery which has a maximum voltage of 3.1 and it's not a problem. You need to be over the BOD voltage that's your only limit. If you are using a 8MHz pro mini it can run at this frequency down to 2.4V at least. NRF24 will run as low as 1.9V.
    • xydix

      From 1.5 to 2.0. Can't get it running
      Troubleshooting • • xydix  

      13
      0
      Votes
      13
      Posts
      3207
      Views

      martinhjelmare

      @xydix Sketch looks OK. Sounds like a hardware issue. Have you tried replacing booster and/or radio?
    • xydix

      Is this completely wrong?
      Development • • xydix  

      3
      0
      Votes
      3
      Posts
      1055
      Views

      xydix

      Thank you. That will get it right. But now I get the delay when the door open. I guess I need a pull down resistor for this to work. 4.7k? 10k? I guess it's the internal pull up that consumes power? Another thing. I changed digitalWrite = HIGH (original example) to Pinmode INPUT_PULLUP in my first sketch Wich option is best if I want low power consumption?
    • xydix

      Radios -Again
      Hardware • • xydix  

      1
      0
      Votes
      1
      Posts
      587
      Views

      No one has replied

    • xydix

      Pro mini
      Hardware • • xydix  

      9
      0
      Votes
      9
      Posts
      2739
      Views

      petewill

      @micah I have had this happen to a couple of mine too. It only takes a few times before I learned never to apply 12v to the raw pin I have been able to revive all of my pro minis by soldering on a new capacitor here: