Temperature Sensor

Home Forums Forums Technical Support for BerryIMU Temperature Sensor

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4912
    jingram
    Participant

    Hi

    Have you guys has any success with reading the temperature from the LSM9DS0?

    #4913
    Mark Williams
    Keymaster

    Yes.
    In C it would be;

            uint8_t block[2];
            readBlock(0x80 | OUT_TEMP_L_XM, sizeof(block), block);
            temp = (int16_t)(block[0] | block[1] << 8);
    	float temperature_c = (float)temp / 8.0 + 25;
            float temperature_f = temperature_c * 1.8 + 32;
    

    Mark --OzzMaker.com --

    #4916
    jingram
    Participant

    Hi Mark

    Thanks for this.
    I got the / 8, but where did you find to add the base 25 deg C in the spec sheet.

    #4917
    Mark Williams
    Keymaster

    We have been told that this is a reference number to use when calculating temperature on the chip.

    If you are using a BerryIMU, you can get the ambient temperature from the BMP180.

    Mark --OzzMaker.com --

    #6447
    PEERIS
    Participant

    Hi,

    I have no succeed to work with BMP180 with the python code. The output data are like :

    Starting temperature conversion…
    Starting pressure conversion…
    Calculating temperature…
    Calculating pressure…

    Temperature: 827 C
    Pressure: -4386776 hPa

    My aim is to use barometer as an altitude sensor
    Is there an explication of BMP180 code to use the sensors as an altimeter ?

    Thx

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…