Navigation

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

    LastSamurai

    @LastSamurai

    Hardware Contributor

    76
    Reputation
    503
    Posts
    2602
    Profile views
    1
    Followers
    0
    Following
    Joined Last Online

    LastSamurai Follow
    Hardware Contributor

    Best posts made by LastSamurai

    • RE: Coin cell based small sensor node / handsoldering smd parts

      As promised here is my own try at creating a sensor platform based on mysensors. I have several nodes up and running for some weeks/months without problems at the moment 🙂
      Battery life with CR2032 depends on the kind of sensor used but should be 1,5 + years on everyone.
      Love to hear some feedback and/or suggestions on what kind of sensor to add next.

      I think I will add some door/window sensors next

      link text

      posted in Hardware
      LastSamurai
      LastSamurai
    • RE: PCB Boards for MySensors

      @MikeF Dirtypcbs rarely takes more than 3-4 weeks for me too (in germany), but you are right, a local source would be great. There are several producers here too, but for everyone I know prices are at least 5 times what the chinese take.
      If you (or someone else) finds a european service that produces prototypes (1-3 boards) for less than 15€ per piece please share it! Could come in very handy when developing new boards.

      posted in Hardware
      LastSamurai
      LastSamurai
    • Finalizing my very simple gateway

      I am currently planing to update my mysensors setup (as making it more "professional", less wires) and build a new one somewhere else. For that I was looking for an easy/simple to build serial gateway and could not really find one. There are some great ones here like sensebender but these use hard to solder components and generally just more than I need.

      Here is my idea for a simple and relatively cheap gateway. It fits into a small and cheap box from aliexpress and contains an arduino nano, a nrf pa lna and a micro usb breakout for power.
      Hardware signing can be added with the atsha and I also added pins for 433Mhz sender and receiver. These could either be used on the gateway directly or using the same pcb with a normal nrf as a seperate node.

      I will finalize the pcb in the next days and send it to manufactoring. Any feedback from you guys until then? Anything you would add? Any errors you are seeing?

      Gateway.pdf

      PS Here is a picture of my prototype 0_1491944739483_OH433Gateway.jpg

      posted in Hardware
      LastSamurai
      LastSamurai
    • RE: Low Power?

      Yes use sleep() 😉 . Take a look at the api.

      posted in General Discussion
      LastSamurai
      LastSamurai
    • RE: MySensors shield and RGBW Controller

      Yeah ✨ my PCBs from dirtypcbs finally arrived! So I instantly had to open the package and I must say: these pcbs are really well made (for that price). Here are pics. As you can see I designed them so that 2 fit on one 5x5cm pcb. So I have gotten myself 24 potential "smart" sensors now 😃
      I haven't gotten all components yet for multiple sensors but I started with one test sensor anyways. It has through hole resistors instead of some smd ones, no capacitor and no DHT22 yet. But once I get the components I will add them on the prototype. For now it's up and running with a demo sketch that just sends random values.
      And everything seems to be working nicely. Yeah^^

      Next step is to finalize the components and test some other components as arduino shield like components on the two pin headers I added for that one. And I already found some small things that I could still improve.

      Once that's all done I will finalize the RGBW ones and send them of for production.

      Love to hear your feedback and tipps guys!

      PS can I somehow add these pictures as thumbnails? They are quite big...
      IMAG0013.jpg IMAG0012.jpg IMAG0010.jpg IMAG0009.jpg IMAG0008.jpg

      posted in Hardware
      LastSamurai
      LastSamurai
    • RE: Are folks here happy with Domoticz?

      I am actually happy with domoticz. I have used it for about a year and its main advantage for was that it's very easy to learn and to use. Recently I discovered dzVents (which is now integrated in the domoticz beta) that allows for easier and more complex scripts. For now I was able to do anything I wanted in domoticz.
      The UI isn't perfect (although openhaps is way worse imho) but it gets the job done.

      I also tried to use openhab (2) earlier but thats a totally different beast. You can do awesome stuff but it's REALLY hard to get started. The new ui in openhab 2 looks great but its still a weird mix of using text files and the ui.
      HA also looks great but I haven't tried it yet.

      So overall I would start with domoticz and switch later if you are missing any features.

      PS also domoticz updates (at least for features related to mysensors) seem to be implemented pretty slow. I have opened several tickets in their git where the answer was mostly: implemented on you own 😉 Which is fine (I dont pay them afterall) but other systems seem to be way more active.

      posted in Domoticz
      LastSamurai
      LastSamurai
    • RE: MySensors shield and RGBW Controller

      Just a short update: I now have 5 of these controllers controlling different led strips in my apartment. They are all working without a problem (some of them for nearly half a year now).
      I did some small updates to the code (which you can get via github) and will try to update the pcb later to fix that one annoying error with the mosfets.

      posted in Hardware
      LastSamurai
      LastSamurai
    • RE: 💬 Ikea Molgan Hack

      I just spend an hour tracing the routes on the pcb. I am pretty sure I missed some (and there might be some errors) but here are my results for now. Ill redo them with KiCad later. Can someone measure the capacitors? They are unlabeled.

      0_1488836803988_MolganSchematicsFullHD.jpg

      posted in OpenHardware.io
      LastSamurai
      LastSamurai
    • RE: RGBW setup

      Hi, great to hear that someone else is using my project too. Perhaps we can get it to work for you too 🙂

      First of all your mosfets should work too, I was using IRLZ44N mosfets too for my prototypes (although some people in the forum had problems with them I think).
      All your leds turn on because the standard setting (when the node doesn't receive anything else) is to turn on every channel to 100 of 255.

      byte values[4] = {100, 100, 100, 100};
      byte target_values[4] = {100, 100, 100, 100}; 
      

      Change that part if you don't want this behaviour.

      The important part of your code for changing colors is the incomingMessage(const MyMessage &message) function. In your logs I am never seeing any serial output from that function. So I guess you never get any new messages with new values?! Try to find out why that method never gets called.
      I haven't worked with mysensors 2.0 yet so it might be a problem with the conversion or just with your radio setup. With 1.5 and my node it works well (I have 5 nodes running atm).

      posted in Troubleshooting
      LastSamurai
      LastSamurai
    • RE: Slim Node Si7021 sensor example

      @rsachoc Yes, I actually just tried it out and its working.
      Here is my code for now (just for testing):
      I basically just switched libraries

      /* Sketch with Si7021 and battery monitoring.
      by m26872, 20151109 
      Changed by LastSamurai
      15052016
      */
      #include <MySensor.h>  
      #include <Wire.h>
      #include <SPI.h>
      #include <SparkFunHTU21D.h>
      #include <RunningAverage.h>
      
      //#define DEBUG
      
      #ifdef DEBUG
      #define DEBUG_SERIAL(x) Serial.begin(x)
      #define DEBUG_PRINT(x) Serial.print(x)
      #define DEBUG_PRINTLN(x) Serial.println(x)
      #else
      #define DEBUG_SERIAL(x)
      #define DEBUG_PRINT(x) 
      #define DEBUG_PRINTLN(x) 
      #endif
      
      #define NODE_ID 100             // <<<<<<<<<<<<<<<<<<<<<<<<<<<   Enter Node_ID
      #define CHILD_ID_TEMP 0
      #define CHILD_ID_HUM 1
      // #define SLEEP_TIME 15000 // 15s for DEBUG
      #define SLEEP_TIME 300000   // 5 min
      #define FORCE_TRANSMIT_CYCLE 36  // 5min*12=1/hour, 5min*36=1/3hour 
      #define BATTERY_REPORT_CYCLE 2016   // Once per 5min   =>   12*24*7 = 2016 (one report/week)
      #define VMIN 1900
      #define VMAX 3300
      #define HUMI_TRANSMIT_THRESHOLD 3.0  // THRESHOLD tells how much the value should have changed since last time it was transmitted.
      #define TEMP_TRANSMIT_THRESHOLD 0.5
      #define AVERAGES 2
      
      int batteryReportCounter = BATTERY_REPORT_CYCLE - 1;  // to make it report the first time.
      int measureCount = 0;
      float lastTemperature = -100;
      int lastHumidity = -100;
      
      RunningAverage raHum(AVERAGES);
      HTU21D humiditySensor;
      
      MySensor gw;
      MyMessage msgTemp(CHILD_ID_TEMP,V_TEMP); // Initialize temperature message
      MyMessage msgHum(CHILD_ID_HUM,V_HUM);
      
      void setup() {
        DEBUG_SERIAL(9600);    // <<<<<<<<<<<<<<<<<<<<<<<<<< Note BAUD_RATE in MySensors.h
        DEBUG_PRINTLN("Serial started");
        
        DEBUG_PRINT("Voltage: ");
        DEBUG_PRINT(readVcc()); 
        DEBUG_PRINTLN(" mV");
      
        delay(500);
        DEBUG_PRINT("Internal temp: ");
        DEBUG_PRINT(GetInternalTemp()); // Probably not calibrated. Just to print something.
        DEBUG_PRINTLN(" *C");
      
        delay(500); // Allow time for radio if power useed as reset
        gw.begin(NULL, NODE_ID);
        gw.sendSketchInfo("TempHumTest2", "1.0 17052016"); 
        gw.present(CHILD_ID_TEMP, S_TEMP);   // Present sensor to controller
        gw.present(CHILD_ID_HUM, S_HUM);
        DEBUG_PRINT("Node and "); DEBUG_PRINTLN("2 children presented.");
        
        raHum.clear();
        humiditySensor.begin();  
      }
      
      void loop() { 
      
        measureCount ++;
        batteryReportCounter ++;
        bool forceTransmit = false;
        
        if (measureCount > FORCE_TRANSMIT_CYCLE) {
          forceTransmit = true; 
        }
        sendTempHumidityMeasurements(forceTransmit);
      /*
        // Read and print internal temp
        float temperature0 = static_cast<float>(static_cast<int>((GetInternalTemp()+0.5) * 10.)) / 10.;
        DEBUG_PRINT("Internal Temp: "); DEBUG_PRINT(temperature0); DEBUG_PRINTLN(" *C");        
      */
        // Check battery
        if (batteryReportCounter >= BATTERY_REPORT_CYCLE) {
          long batteryVolt = readVcc();
          DEBUG_PRINT("Battery voltage: "); DEBUG_PRINT(batteryVolt); DEBUG_PRINTLN(" mV");
          uint8_t batteryPcnt = constrain(map(batteryVolt,VMIN,VMAX,0,100),0,255);   
          DEBUG_PRINT("Battery percent: "); DEBUG_PRINT(batteryPcnt); DEBUG_PRINTLN(" %");
          gw.sendBatteryLevel(batteryPcnt);
          batteryReportCounter = 0;
        }
        
        gw.sleep(SLEEP_TIME);
      }
      
      // function for reading Vcc by reading 1.1V reference against AVcc. Based from http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
      // To calibrate reading replace 1125300L with scale_constant = internal1.1Ref * 1023 * 1000, where internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function) 
      long readVcc() {
        // set the reference to Vcc and the measurement to the internal 1.1V reference
        ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
        delay(2); // Wait for Vref to settle
        ADCSRA |= _BV(ADSC); // Start conversion
        while (bit_is_set(ADCSRA,ADSC)); // measuring
        uint8_t low  = ADCL; // must read ADCL first - it then locks ADCH  
        uint8_t high = ADCH; // unlocks both
        long result = (high<<8) | low;
        result = 1125300L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000
        return result; // Vcc in millivolts
      }
      // function for reading internal temp. From http://playground.arduino.cc/Main/InternalTemperatureSensor 
      double GetInternalTemp(void) {  // (Both double and float are 4 byte in most arduino implementation)
        unsigned int wADC;
        double t;
        // The internal temperature has to be used with the internal reference of 1.1V. Channel 8 can not be selected with the analogRead function yet.
        ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3));   // Set the internal reference and mux.
        ADCSRA |= _BV(ADEN);  // enable the ADC
        delay(20);            // wait for voltages to become stable.
        ADCSRA |= _BV(ADSC);  // Start the ADC
        while (bit_is_set(ADCSRA,ADSC));   // Detect end-of-conversion
        wADC = ADCW;   // Reading register "ADCW" takes care of how to read ADCL and ADCH.
        t = (wADC - 88.0 ) / 1.0;   // The default offset is 324.31.
        return (t);   // The returned temperature in degrees Celcius.
      }
      
      /*********************************************
       * * Sends temperature and humidity from Si7021 sensor
       * Parameters
       * - force : Forces transmission of a value (even if it's the same as previous measurement)
       *********************************************/
      void sendTempHumidityMeasurements(bool force) {
        bool tx = force;
        
        float temperature = humiditySensor.readTemperature();
        DEBUG_PRINT("T: ");DEBUG_PRINTLN(temperature);
      
        float diffTemp = abs(lastTemperature - temperature);
        DEBUG_PRINT(F("TempDiff :"));DEBUG_PRINTLN(diffTemp);
      
        if (diffTemp > TEMP_TRANSMIT_THRESHOLD || tx) {
          gw.send(msgTemp.set(temperature,1));
          lastTemperature = temperature;
          measureCount = 0;
          DEBUG_PRINTLN("T sent!");
        }
        
        int humidity = humiditySensor.readHumidity();
        DEBUG_PRINT("H: ");DEBUG_PRINTLN(humidity);
      
        raHum.addValue(humidity);
        humidity = raHum.getAverage();  // MA sample imply reasonable fast sample frequency
        float diffHum = abs(lastHumidity - humidity);
        DEBUG_PRINT(F("HumDiff  :"));DEBUG_PRINTLN(diffHum); 
      
        if (diffHum > HUMI_TRANSMIT_THRESHOLD || tx) {
          gw.send(msgHum.set(humidity));
          lastHumidity = humidity;
          measureCount = 0;
          DEBUG_PRINTLN("H sent!");
        }
      
      }
      
      posted in My Project
      LastSamurai
      LastSamurai

    Latest posts made by LastSamurai

    • RE: 💬 OH MySensors RGBW Controller

      @sergio-rius A little late, sorry, but that depends on the mosfets you are actually using. I am driving ~5m strips of white leds with most of my controllers and they don't even really get hot.

      There is also a big(ish) update from my side concerning this project: I have designed, 3d printed and tested my own case for the controllers and they work great. I have just added the stl files and some images to the project page!!
      For now this project is done from my side. The controllers have been working great for the past 2 years but due to the "huge" (~1s) delay with my Mysensors network (with signing and openhab on a raspi) when switching the leds I am currently testing some MQTT and wifi based RGBWW controller boards as an alternative.

      alt text

      posted in OpenHardware.io
      LastSamurai
      LastSamurai
    • RE: 💬 OH MySensors RGBW Controller

      I only had Home Assistant installed for some days (did not really like it at the time) so I can't tell you that it works 100% but it did back then. You have to add some strange additional messages but I tried to integrate that into my code.
      I am using my RGBW controllers with openhab 2 in one location and with domoticz in another. As it is controlled by MySensors it works (and looks) pretty much like any other mysensors node. Both installations run on 2.2. Hope this helps 🙂

      posted in OpenHardware.io
      LastSamurai
      LastSamurai
    • RE: 💬 OH MySensors RGBW Controller

      I never tried that but as far as I know you have to tell Mysensors to use a different kind of radio by adding a define like:

      #define MY_RADIO_RFM69
      

      Just do a quick search on this forum though 😉

      posted in OpenHardware.io
      LastSamurai
      LastSamurai
    • RE: Bad downlink radio solved by updating gateway

      Well great to hear that you solved the problem. There are version 2.1 and 2.2 of mysensors as of now that can be used too so maybe update again?

      posted in Troubleshooting
      LastSamurai
      LastSamurai
    • RE: openHAB 2.2 binding

      Do you still have an older version of Mysensors installed? Thats the only time I had such behaviour

      posted in OpenHAB
      LastSamurai
      LastSamurai
    • RE: openHAB 2.2 binding

      @TimO I finally got around to testing my pureWhite RGBW code and at least for me its working like it should be. I saw you already merged this so I guess others can use it too very soon.
      What is still not working is the acknowledgment feature. I have one node that only gets about 90% of the messages without error, so I tried activating it there and on some other nodes too for testing. Result: success rate is down to ~50% for each node and I get messages about some acknowledgment on the console when no message has even been sent (nothing about a message from mysensors on the console and no rx/tx leds on the gateway). When I tested this some months ago I also saw no message at the client so I am pretty sure none gets send.
      So I guess this issue is still unresolved 😉 I have no clue why on a first glance but if I can help just send me a message.

      posted in OpenHAB
      LastSamurai
      LastSamurai
    • RE: My Home Automation Journey

      Sounds nice! I wish you the best of luck with your project(s) and keep us updated!
      I might do some project report like this too soon, so I will follow yours 😉

      posted in My Project
      LastSamurai
      LastSamurai
    • RE: Conflicts with neighbour's gateways ?

      You can also use the security features of mysensors so that your node doesn't connect to your neighbors gateway even if it uses the same channel. Using a different channel would be easier though i guess.

      posted in General Discussion
      LastSamurai
      LastSamurai
    • RE: Anyone tried the Creality CR-10 3D printer?

      Did anyone try the Anet A8? I am currently thinking about buying one. It would be my first 3D printer and I do not want to spend more than ~150€ (at least initially). It seems to be a clone of the Prusa i3 and quite capable if add some cheap/self printed parts and invest some time. I don't have the time/knowledge to build a printer on my own from scratch but I am pretty sure that I can those upgrades.

      Or are there any alternatives in that price range that you guys can recommend? Main idea is to print cases for my electronics projects and some small other stuff from time to time.

      posted in General Discussion
      LastSamurai
      LastSamurai