Bil

Member Since: May 26, 2013

Country: United States

  • I tried it, works fine. The charger sends in coloumbs at about 760 mA! Thanks for a great little board, Sparkfun.

  • I would like to use this to monitor power bidirectionally between battery and charging circuit. Is it safe to put the charger at the OUT header and the battery at the IN header?

    The LTC4150 data sheet says it should be:

    Connect SENSE+ to the load and charger side of the sense resistor. [SENSE+ is OUT+]

    Connect SENSE– to the positive battery terminal side of the sense resistor. [SENSE- is IN+]

  • Hmm, I thought it was yours, but I just checked what you have on github, and that’s a lot nicer. Only thing I see is “makeMeasurment” (sic) and some other words in the comments are spelled incorrectly. :)

    Ah, it’s from here.

  • I thought “less than” that was a bit strange, but it’s copied directly from the library.

    It looks like the culprit was code.

    New code uploaded in to the station, and humidity values are now greater than 0% and less than 100%!

    Click here to see.

  • Looks like it was pilot error. TL;DR: unscrambling the bytes from the sensor was being done incorrectly.

    I actually stripped the Si7021 code out of the library to attempt saving some space in the Arduino code. I think there are errors in the code, or my fork of it. I fixed some things, now here is my current routine to read the Si7021, which aligns a bit better with the data sheet equations:

      int readHumidity(Record *data)
      {
        const int Si7021Address =0x40;
    
        char X0,X1,Y0,Y1;
        unsigned short RH_Code;
        double X,Y,X_out,Y_out1,Y_out2;
    
        /**Send command of initiating relative humidity measurement**/
        Wire.beginTransmission(Si7021Address); Wire.write(0xE5); Wire.endTransmission(); 
    
        /**Read two bytes relative humidity**/
        Wire.requestFrom(Si7021Address,2);
        if(Wire.available()<=2)
        {
          Y0 = Wire.read();
          Y1 = Wire.read();
          RH_Code = ((unsigned char)Y0<<8) | ((unsigned char)Y1 & 0xFF);
          Serial.print("Read bytes from Si7021 MSB: "); 
          Serial.print((unsigned int)Y0); Serial.print("LSB: "); Serial.print((unsigned int)Y1);
          Serial.print("combined: "); Serial.println(RH_Code);
        }
        /**Calculate and store relative humidity**/
        Y = (125.0 * (double)RH_Code) / 65536 - 6.0;
    
        //data->humidity = (float)Y;
        /**Send command of initiating temperature measurement associated with previous         relative   humidity**/
        Wire.beginTransmission(Si7021Address); Wire.write(0xE0); Wire.endTransmission();
    
        Wire.requestFrom(Si7021Address,2);
        if(Wire.available()<=2) {
          X0 = Wire.read();
          X1 = Wire.read();
          X_out = (X0<<8)+X1;
        }
        /**Calculate and store temperature**/
        X=(175.72*X_out)/65536 - 46.85;
        //data->humidityTemp = (float)X;
        Serial.print("Si7021 temperature: "); Serial.print(X, 1);
        Serial.print("C Si7021 humidity: "); Serial.print(Y); Serial.println("%");
      }
    

    and here is output comparing HTU21D and Si7021 readings

    Send OK:
    Read bytes from Si7021 MSB: 65411LSB: 106combined: 33642
    Si7021 temperature: 22.4C Si7021 humidity: 58.17%
    HTU21D Temperature: 23.1C HTU21D Humidity: 57.7%
    Send OK: 
    Read bytes from Si7021 MSB: 65411LSB: 82combined: 33618
    Si7021 temperature: 22.4C Si7021 humidity: 58.12%
    HTU21D Temperature: 23.1C HTU21D Humidity: 57.9%
    Send OK: 
    Read bytes from Si7021 MSB: 65411LSB: 46combined: 33582
    Si7021 temperature: 22.4C Si7021 humidity: 58.05%
    HTU21D Temperature: 23.1C HTU21D Humidity: 58.1%
    Send OK: 
    Send OK: 
    Read bytes from Si7021 MSB: 65411LSB: 106combined: 33642
    Si7021 temperature: 22.4C Si7021 humidity: 58.17%
    HTU21D Temperature: 23.1C HTU21D Humidity: 57.7%
    Send OK: 
    Read bytes from Si7021 MSB: 65411LSB: 82combined: 33618
    Si7021 temperature: 22.4C Si7021 humidity: 58.12%
    HTU21D Temperature: 23.1C HTU21D Humidity: 57.9%
    Send OK: 
    Read bytes from Si7021 MSB: 65411LSB: 46combined: 33582
    Si7021 temperature: 22.4C Si7021 humidity: 58.05%
    HTU21D Temperature: 23.1C HTU21D Humidity: 58.1%
    Send OK: 
    
  • I’ve seen the 999 or 998 issue with wires breaking on my (ahem) prototype I2C connection. This is different. The numbers change, not always 999. Plus they seem realistic, just wrapped around past 100. The temperature values agree with the temperature from a BMP180 barometer right next to the Si7021.

    I haven’t dried out the station yet. It rained heavily yesterday.

  • I have a Si7021 hooked up to my homebuilt weather station. In the evening as dew starts rising, the reported humidity rises past 100% and swings negative.

    Look here.

    Any idea why this would be happening?

    I’m going to check against another sensor, in case it’s just a linear offset. The datasheet mentions erratic behavior at very high humidity or if it comes in contact with liquid water. So I’m going to do a better job protecting the sensor also.

No public wish lists :(