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
F

Fredrik Carlsson

@Fredrik Carlsson
About
Posts
40
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Stable battery PIR Sensor
    F Fredrik Carlsson

    I will try tomorrow to do it without any voltage regulators together with a sensebender micro. I have the bigger pir sensor though, but I dont think its much difference on thoose. We will see.

    Hardware

  • Stable battery PIR Sensor
    F Fredrik Carlsson

    @m26872 Hello, have you not used any voltage regultator for the pir sensor? You just give it direct connection to the batterypack?

    Hardware

  • Heatpump controller
    F Fredrik Carlsson

    Hello
    It would be nice to make it run on batteries, maybe with 10 seconds sleep, and then wake up only to check with gateway if there is a new command and then sleep again.

    I am building a pir sensor now based on 3*aa batteris running on 4,5 volt.I will ust use an LE33 step down directly after the battery pack to provide power to both sensebender+radio+pir. Dont know if that is the optimal way to do it but it should work

    Development

  • Heatpump controller
    F Fredrik Carlsson

    @ToniA
    Hey, thanks for all the work you have put down. I have had some other projects going the last year so have not really put down more time on this.

    How is it working with the sensebender? Are you using it on batteries?
    Any ide about battery usage?

    Development

  • Stable battery PIR Sensor
    F Fredrik Carlsson

    Wonderful!
    Maybe I will try this design then. But I dont need them so small so will probably use the bigger PIR sensor in mine.
    I will revert when I'm done

    Hardware

  • Stable battery PIR Sensor
    F Fredrik Carlsson

    Hello
    I am busy building an burglar alarm for my home.
    Because of this its important its a wireless system (to not go down during electrical failure in the house).

    I wonder is there any stable good PIR sensor that works with battery?
    I have sourced the forum but not really found anything. I have a couple of Sensebender micro boads lying around that I would prefer to use for this.

    Its off course also important that there is no false triggers, because then it would be a very unreliable system.

    Hardware

  • Measuring current
    F Fredrik Carlsson

    @AWI

    Yes i am. but there is mistake in the picture the R3 is connected between Pin 3 and VCC, not ground (pull up resistor).

    Then that leaves me hanging a bit because that is way more than I will be comfortable with in terms off battery changes.
    Any suggestion what to do?

    Hardware

  • Measuring current
    F Fredrik Carlsson

    @awi

    #include <MySensor.h>  
    #include <DHT.h>  
    
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define CHILD_ID_SWITCH 2
    #define BUTTON_PIN  3
    #define HUMIDITY_SENSOR_DIGITAL_PIN 4
    #define VBAT_PER_BITS 0.003363075 //(1mohm / 470 kohm)   Calculated volts per bit from the used battery montoring voltage divider.   Internal_ref=1.1V, res=10bit=2^10-1=1023, Eg for 3V (2AA): Vin/Vb=R1/(R1+R2)=470e3/(1e6+470e3),  Vlim=Vb/Vin*1.1=3.44V, Volts per bit = Vlim/1023= 0.003363075
    #define VMIN 1.9  // Battery monitor lower level. Vmin_radio=1.9V
    #define VMAX 3.3  //  " " " high level. Vmin<Vmax<=3.44
    int BATTERY_SENSE_PIN = A0;  // select the input pin for the battery sense point
    unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)
    
    MySensor gw;
    DHT dht;
    float lastTemp;
    float lastHum;
    boolean metric = true; 
    int oldBatteryPcnt = 0;
    MyMessage msg(CHILD_ID_SWITCH,V_TRIPPED);
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    
    
    void setup()  
    { 
      analogReference(INTERNAL);
      gw.begin();
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
    
      // Send the Sketch Version Information to the Gateway
      gw.sendSketchInfo("Humidity", "1.0");
       // Setup the button
      pinMode(BUTTON_PIN,INPUT);
      // Activate internal pull-up
      digitalWrite(BUTTON_PIN,HIGH);
    
      // Register all sensors to gw (they will be created as child devices)
      gw.present(CHILD_ID_SWITCH, S_DOOR);
      gw.present(CHILD_ID_HUM, S_HUM);
      gw.present(CHILD_ID_TEMP, S_TEMP);
      
      metric = gw.getConfig().isMetric;
    }
    
    
    
    void loop()      
    {  
        // Get the update value
      int value = digitalRead(BUTTON_PIN);
     
      // Send in the new value
      gw.send(msg.set(value==HIGH ? 1 : 0));
      
      delay(dht.getMinimumSamplingPeriod());
    
      float temperature = dht.getTemperature();
      if (isnan(temperature)) {
          Serial.println("Failed reading temperature from DHT");
      } else if (temperature != lastTemp) {
        lastTemp = temperature;
        if (!metric) {
          temperature = dht.toFahrenheit(temperature);
        }
        gw.send(msgTemp.set(temperature, 1));
        Serial.print("T: ");
        Serial.println(temperature);
      }
      
      float humidity = dht.getHumidity();
      if (isnan(humidity)) {
          Serial.println("Failed reading humidity from DHT");
      } else if (humidity != lastHum) {
          lastHum = humidity;
          gw.send(msgHum.set(humidity, 1));
          Serial.print("H: ");
          Serial.println(humidity);
      }
      
      int sensorValue = analogRead(BATTERY_SENSE_PIN);    // Battery monitoring reading
    //  Serial.println(sensorValue);
      float Vbat  = sensorValue * VBAT_PER_BITS;
    //  Serial.print("Battery Voltage: "); Serial.print(Vbat); Serial.println(" V");
     //int batteryPcnt = sensorValue / 10;
      int batteryPcnt = static_cast<int>(((Vbat-VMIN)/(VMAX-VMIN))*100.);   
    //  Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %");
      if (oldBatteryPcnt != batteryPcnt) {
        gw.sendBatteryLevel(batteryPcnt);
        oldBatteryPcnt = batteryPcnt;
      }
    
    
    
      gw.sleep(BUTTON_PIN-2, CHANGE, SLEEP_TIME);
    }
    Hardware

  • Measuring current
    F Fredrik Carlsson

    Hello again.
    I just got some new 470k resistors today so i changed out the 10k/4,7k resistors on the battery circuit to 1mohm/470k
    The current draw is now 0,63mA when sleeping and 17,6mA when sending.
    Especially the sleeping current seem very high. Any ideas to why?

    Hardware

  • Problems with powermeter pulse sensor
    F Fredrik Carlsson

    hmm think i solved the problem. I tried with an arduino uno instead and now the sketch works fine. Very strange :(

    Troubleshooting

  • Problems with powermeter pulse sensor
    F Fredrik Carlsson

    Hello
    I have installed a 3 phase meter for my waterheater.
    It is on 3 kw and is also equipped with a ledpulse.
    I have made a sensor and flashed it with the standard sketch. I have only changed the pulse/whr to 800 as that is what my meter says.

    But I get this very strange watt values. I get in the serial log printed watt: around 42000
    the meter says 2994 +- which is also correct because its a 3000 w heater.
    I did a manual test and clocked 20 pulses looking at the meter and divided by 20.

    then i got 1,465 ms which calculates to around 3090 watt so the optical out on the sensor is working good. I have also tried putting a 10k resistor between ground and D3 pin without success.

    The arduino is a arduino nano clone bought on ebay. I have also tried with another one but with same problem (arduino nano clone also). Could it be that the timing is corrupt on theese clones? Or do you have any other suggestions?

    Troubleshooting

  • Windows GUI/Controller for MySensors
    F Fredrik Carlsson

    Yes I tried now again an now it works. Maybe something temporary with Dropbox yesterday

    Controllers myscontroller mysbootloader

  • Windows GUI/Controller for MySensors
    F Fredrik Carlsson

    @tekka Hey, it seems like the downloadlink is broken. Can you check?

    Controllers myscontroller mysbootloader

  • Measuring current
    F Fredrik Carlsson

    @AWI Hello, yes I was aware of that. So it could be possible that configuration no 2 is working, just that it is not possible to measure. .. I will try when I come home. And yes the led is detached. I will also change resistors for the measurement circuit. Just need to order some 470k resistors

    Hardware

  • Measuring current
    F Fredrik Carlsson

    Aha, that could probably be the cause then
    I have now tried with the following 2 scenarios:
    Using internal pullup, then i get the current draw 2,85 mA in sleep, which is quite high?

    I tried to deactivate the internal pullup and used a 1Mohm resistor as external pullup instead but then the sketch doesnt even start.
    As referenced to this thread: http://forum.mysensors.org/topic/1287/door-window-sensor-consuming-more-power-when-closed/3

    **Or is the cause the fact that I am using 10k/4,7k resistors for battery measurment instead of 1m/470K ? **

    So this one is working With internal.PNG

    And this one is not workingwith external.PNG

    Hardware

  • Measuring current
    F Fredrik Carlsson

    Hello
    A somewhat stupid question
    I have a arduino 3,3 volt without step up or anything. Driven by 2 1,5V batteries.
    All positive lines (DHT22 +battery + battery measuring circuit) is connected on Vin pin and all ground cables on ground pin. So fairly simple circuit. Isnt it just to put in the multimeter somewhere in the circuit? Then i read around 4-5mA but the arduino restarts all the time, dont really know why?

    How to correctly read current on an arduino circuit?

    Hardware

  • pimatic-mysensors controller plugin
    F Fredrik Carlsson

    @funky81
    Hello. I have had a hard time testing this. Is the future for the pulsesensor implemented in 0.8.17 official plugin?

    If not, how get the latest commit in to pimatic? Have tried to git clone the plugin and then npm install inside the folder, but then none of the sensors shows up in pimatic (the plugin is not active)

    With official 0.8.17 the arduino sketch just come in to an endless loop where it wants the latest pulsecount = no answer from pimatic

    pimatic controller node id nrf24l01+ mysensors rasp

  • pimatic-mysensors controller plugin
    F Fredrik Carlsson

    Hello
    haven't had the opportunity to test yet.
    will try to find time tomorrow

    pimatic controller node id nrf24l01+ mysensors rasp

  • pimatic-mysensors controller plugin
    F Fredrik Carlsson

    Yes saw it on github, very interesting. Will try as soon as I am home again

    pimatic controller node id nrf24l01+ mysensors rasp

  • pimatic-mysensors controller plugin
    F Fredrik Carlsson

    @Dheeraj I wait patiently then :)
    Yes the more im digging in to pimatic the more i like it and feel that it fits my needs perfectly

    pimatic controller node id nrf24l01+ mysensors rasp
  • Login

  • Don't have an account? Register

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