• RE: RF Nano = Nano + NRF24, for just $3,50 on Aliexpress

    @jens-jensen nano has the USB to serial converter so I think there's no point to try to make it low power, it will never really be. So they went for the cheap option that's use on nanos, unos, etc

    posted in Hardware
  • RE: Particle Powered Air Quality Sensor Logging to Google Docs

    @jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:

    I have no experience with the MH-Z14A but compared to other comparable parts I think the CCS811 is a bit more simple to implement. (And less costly, despite it's $$$ price)

    The MH-Z14A is really simple to implement. Just send some characters over serial interface and get the CO2 value. You don't need to think about baselines and firmware versions. A cheap sensor is of no use, if you can't get correct readings. Maybe I am doing something wrong? 🙂

    But maybe you can share your code and I can get better results?

    The CCS811 I have here maybe cheap….
    0_1555968023025_sensor-comparison.png

    posted in My Project
  • RE: RF Nano = Nano + NRF24, for just $3,50 on Aliexpress

    @skywatch said in RF Nano = Nano + NRF24, for just $3,50 on Aliexpress:

    Of course there is also the question as to if these are genuine Nordic NRF24L01+ chips or fake Chinese clones again...... 😉

    I don't think there is any question on that 😉

    posted in Hardware
  • RE: Particle Powered Air Quality Sensor Logging to Google Docs

    The CCS81 seems to be much more complicated to handle than the MH-Z14A. There is an MCU on the sensor and you can make firmware upgrades which should reduce the burn in time. After burn in, you shoul save the actual baseline from time to time (e.g. every 24 hours) and restore it, when you reboot.

    My hacked code looks now much more complicated:

    void readCCS811(JsonObject &root)
    {
      static int loopCount = 0;
      static bool bFirst = true;
      static CCS811 myCCS811(CCS811_ADDR);
      JsonObject rootCCS811;
    
      loopCount++;
      if (bFirst)
      {
        DEBUG_PRINTLN("Initializing CCS811");
        CCS811Core::status returnCode = myCCS811.begin();
        DEBUG_PRINT("CCS811 begin exited with: ");
        printDriverError(returnCode);
        DEBUG_PRINTLN("");
    
        if (returnCode == CCS811Core::SENSOR_SUCCESS)
          bFirst = false;
    
        //This sets the mode to 60 second reads, and prints returned error status.
        returnCode = myCCS811.setDriveMode(3);
        DEBUG_PRINT("Mode request exited with: ");
        printDriverError(returnCode);
        DEBUG_PRINTLN("");
    
        if ((EEPROM.read(0) == 0xA5) && (EEPROM.read(1) == 0xB2))
        {
          DEBUG_PRINTLN("EEPROM contains saved data.");
          //The recovered baseline is packed into a 16 bit word
          unsigned int baselineToApply = ((unsigned int)EEPROM.read(2) << 8) | EEPROM.read(3);
          DEBUG_PRINT("Saved baseline: 0x");
          if (baselineToApply < 0x100)
            DEBUG_PRINT("0");
          if (baselineToApply < 0x10)
            DEBUG_PRINT("0");
          DEBUG_PRINT(baselineToApply, HEX);
          //This programs the baseline into the sensor and monitors error states
          CCS811Core::status errorStatus = myCCS811.setBaseline(baselineToApply);
          if (errorStatus == CCS811Core::SENSOR_SUCCESS)
          {
            DEBUG_PRINTLN("Baseline written to CCS811.");
          }
          else
          {
            printDriverError(errorStatus);
          }
        }
      }
    
      if (myCCS811.dataAvailable())
      {
    
        myCCS811.readAlgorithmResults();
        myCCS811.setEnvironmentalData(lasthum, lasttemp);
    
        uint16_t lastppm = myCCS811.getCO2();
    
        if (lastppm > 0)
        { // bis und mit 400 nur an der Initialisierung
          rootCCS811 = root.createNestedObject("ccs811");
          rootCCS811["co2"] = lastppm;
          rootCCS811["tvoc"] = myCCS811.getTVOC();
        }
      }
    
      // save Baseline every 24 hours
      if (loopCount >= 24 * 60)
      {
        // read baseline
        unsigned int baseline = myCCS811.getBaseline();
    
        rootCCS811["baseline"] = baseline;
    
        DEBUG_PRINTLN("baseline for this sensor: 0x");
        if (baseline < 0x100)
          DEBUG_PRINT("0");
        if (baseline < 0x10)
          DEBUG_PRINT("0");
        DEBUG_PRINTLN(baseline, HEX);
        //The baseline is saved (with valid data indicator bytes)
        EEPROM.write(0, 0xA5);
        EEPROM.write(1, 0xB2);
        EEPROM.write(2, (baseline >> 8) & 0x00FF);
        EEPROM.write(3, baseline & 0x00FF);
        EEPROM.commit();
    
        loopCount = 0;
      }
    }
    

    The results in the first 24 hours don't seem better. Hope they will getting better after 48 hours. 😞

    I am not really keen on programming a firmware upgrade program for the CCS811. The second sensor I ordered from aliexpress is hopefully better.

    posted in My Project
  • RE: Pan Tilt stepper motors

    @skywatch Take a look at my pan tilt project. A stepper i.s.o. servo can easily be achieved. I would recommend to use the AccelStepper lib to have a smooth movement.

    posted in General Discussion
  • RE: Particle Powered Air Quality Sensor Logging to Google Docs

    @jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:

    @fotofieber I've had some luck with removing the fraction portion of the temperature readings. It looks like the Adafruit code does use it. The suggested code from AMS does not use it.

    Could you please share your code?

    There is an application note about update frequency on https://ams.com/documents/20143/36005/CCS811_AN000369_2-00.pdf/fb08da36-5b40-732b-39b0-62d2d9db5a3c

    It is recommended that the T+RH data is read from the ENS210 at the same frequency as the
    CCS811 generates eCO2 and TVOC outputs. For example in mode 3, 60 second mode, the
    application software should read the ENS210 data once every minute.

    The code in the application notes

    i2c_buff[0] = ((RH % 1000) / 100) > 7 ? (RH/1000 + 1)<<1 : (RH/1000)<<1;
    i2c_buff[1] = 0;
    if(((RH % 1000) / 100) > 2 && (((RH % 1000) / 100) < 8))
    {
    i2c_buff[0] |= 1;
    }
    

    looks quit different to the adafruit implementation:

    uint8_t hum_perc = humidity << 1;
    	
    // other code
    
    
    	uint8_t buf[] = {hum_perc, 0x00,
    		(uint8_t)((temp_conv >> 8) & 0xFF), (uint8_t)(temp_conv & 0xFF)};
    

    In the same document the handling of baseline is described. I think the adafruit code may be incomplete... 🙂

    I'll try the sparkfun lib, it hase baseline support and looks more like the programming note from aws.

    posted in My Project
  • RE: What did you build today (Pictures) ?

    New gateway going live and migrating slowly from Domoticz to Homeassistant. At least to try it.

    0_1555657543370_IMG_20190419_090304.jpg

    posted in General Discussion
  • RE: Piezzo siren/alarm

    @ben999
    You could try DC (one output) with 12V to the piezo. If you want to use only 5V, the AC solution should be louder, as it gets 10V difference to the piezo.

    I usually stop optimizing, when it is good enough. If AC is enough, go with it. 🙂

    posted in Hardware
  • RE: RF Nano = Nano + NRF24, for just $3,50 on Aliexpress

    @alowhum said in RF Nano = Nano + NRF24, for just $3,50 on Aliexpress:

    The RF-Nano has this as a comment:

    Good to know but really easy to do even for newbies.
    There's also this comment:
    Works good, I'm using with mysensors library #define MY_RF24_CE_PIN 10 #define MY_RF24_CS_PIN 9

    posted in Hardware
  • RE: Piezzo siren/alarm

    @ben999 said in Piezzo siren/alarm:

    I did also put a 1k resistor in between the piezo speaker pins... but it lowered the tone by quite a lot..

    Cool, you sorted it out! The resistor may only help in an DC setup (one output from the arduino). In your AC setup it is useless.

    posted in Hardware