Menu

BME280 SPI

2017-11-11
2018-05-04
<< < 1 2 3 4 > >> (Page 3 of 4)
  • David Stephenson

    Yes it works. I've made some assumptions about signs for some of the calibration constants.
    I have bought two more BMP 280's and I shall see if these assumptions were justified when I get round to soldering them up.
    As I said there is something wrong with the filter register, but it works on the default settings.

     
  • stan cartwright

    stan cartwright - 2018-02-01

    Wow David, That looks complicated code. It seems interesting devices aren't easy to use. We're not worthy :) ie non c users.

     
  • Theo

    Theo - 2018-02-03

    The last months I have been playing(in fact it was wrestling) with a BMP180.
    The code is based on the work of Thomas Henry in 2014 and 2015.
    The code is running fine, even the testvalues (see datasheet) and the corresponding results are fine. The normal output is on a 2004 lcd display.

    The output of the code is correct; temp and pressure are correct until the temperature reaches the value of 25.1 degrees celsius. At this point the pressure value goes wrong; almost half the value.
    The code produces debug output at the serial port, by '#define debug' you get all the calculated values in Excel format. By starting a logfile in your terminalprogram or with cutting and pasting the output in a file and renaming the extension in .csv you are able to observe the results in Excel in a logical format.
    By 'defining test' the code calculates the results with predefined values from the datasheet; this proves that de code is correct(as far as I can see).
    I hope that the community is able to see where the issue is in this code, it's time to have a beer.

     

    Last edit: Theo 2018-02-03
    • Theo

      Theo - 2018-02-04

      Some additional info.
      (Reel must be Real!)

       

      Last edit: Theo 2018-02-04
    • David Stephenson

      Can't follow your code (but I don't suppose you can follow mine). I had that problem at 25°C it is that line in the datasheet where you subtract 64000. The value at 25 is about 64000 so the result goes from negative to postive at that point (but if you are using signed integers it should not matter).

       
  • mmotte

    mmotte - 2018-02-04

    Theo,
    Thank you, This is good stuff! Signed 32 bit stuff and shift routines.

    I don't have time right now but next week i will do some testing.

    BR
    Mike

     
    • Anobium

      Anobium - 2018-02-04

      If you guys are having a look at this - I will wait until your work in done.

       
      • mmotte

        mmotte - 2018-02-05

        I think these are the 32 bit signed routines that you refered me to a while back but i never found. I want to try them out.
        And this is yet another pressure chip BMP 180 that I don't have one of.

        So please don't wait for me.
        73
        Mike

         
  • stan cartwright

    stan cartwright - 2018-02-06

    bmp 180 and 280 are different. I've been looking at the picaxe forum where they work and bmp180 looks "simpler". Useful user info about quality of these devices...is it broken? stuff etc. Bosch did more help with bmp180 thoughts.
    A lot of "entertainment" for £1.80 . ha! bon chance.

     
  • David Stephenson

    I've now soldered up another 2 BMP280s. It does not work as the calibrations are different and various parts of the calculation are going unexpectedly negative - but I'm working on it.
    The other interesting thing is that calibration constants P3,P6,P7,P8 and P9 are the same on all three devices P3=3024,P6=-7,P7=15500,P8=-14600,P9=6000 (they are also the same in the datasheet). Maybe this could help to simplify things.

     
  • David Stephenson

    I have a problem trusting other peoples maths.
    Anyway the problem was not as bad as I thought I just needed to "cast" as [LONG} one of the multiplications as with the new calibration (P4) it was exceeding word length.

     
    • Anobium

      Anobium - 2018-02-07

      So, does the code work? I am confused. I have these on the bench.

       
  • stan cartwright

    stan cartwright - 2018-02-07

    Indeed Anobium. I've lived my life without one but it's the original decimal point sums and the converting c stuff that this got interesting. Did your suggestion of get in touch with Bosch get a result? You might have got a bit more respect as a gcb dev if you asked rather than a user of a Chinese clone.
    The math stuff is interesting, didn't teach this when I was in school, just analogue stuff approximated it seems now.
    Binary math was for scientists then.
    Is this the same device..it says E/P

     

    Last edit: stan cartwright 2018-02-07
  • Anobium

    Anobium - 2018-02-09

    I do have a conversation open with Bosch regarding this sensor. @Stan. Well remembered.

    Conversation is slow as they cannot understand a 16-bit numeric world. But, I am making progress. I spoke with Mr. Graz of Technical Support this morning and he talking with the Bosch developement team.

    Summary: Bosch are investigating... I do not expect any outcome from this conversation as they have a solution for a 32-bit numeric world.

    :-(

     
    • Anobium

      Anobium - 2018-02-09

      An update

      Bosch do not have a 16 bit numeric solution. But, they are will to support specific questions with respect to register output etc. They cannot help with respect to 16 bit support.

      A step forwards.

       
  • Anobium

    Anobium - 2018-02-09

    Next

    1. Who is leading this library development? I think there are three/two development strands.

    2. If we can focus the efforts to a single strand then I think I have a way forward. If we can establish an 'lead' for this library then I think we can provide a release to the team, this team specifically, with additional maths capabilities that should make this task achievable. So, who is the 'lead' and who needs to be involved?

    3. When we have a team - can we move the development to GitHub. So, we all have the same code base. The same code base is essential for the team to work together. You can use my GitHub library account for this. Agreed?

    4. When we have a team - I will put the 'team' in the DEVELOPERS group in the forum as the new capabilities will/may/can confuse the forum. The capabilities may not work... and we may need to resolve and I do not want to confuse folks.

    So, my thoughts.

     
  • mmotte

    mmotte - 2018-02-10

    @Theo

    Thanks again for the code.
    There were a couple of problems in the 32bit signed routines. i think i fixed. They work for me.

    Please try the attached and let me know if it works

    73
    BR
    Mike w9ys

     
    • Theo

      Theo - 2018-02-10

      Mike,
      thanks, you've done a great job!
      The code is running now without any problem with temperatures above 25.1 degrees celsius and even with temperatures below zero degrees celsius. (see logfile)
      Let's make Evan happy with a demo for the BMP180-BMP085 sensor.
      Thanks again!

       

      Last edit: Theo 2018-02-10
      • Anobium

        Anobium - 2018-02-11

        Oh yes.

        What are the test cases? I can think of a few

        1. Range test from -20C to +20C (or F)
        2. Range test from 20C to 40C (or F)
        3. Humity comparision to existing (3rd party) senor

        4. Altitude? I read. The altitude calculation depends on knowing the barometric pressure at sea level If you do not set the correct sea level pressure for your location for the current day it will not be able to calculate the altitude accurately. Barometric pressure at sea level changes daily based on the weather. How do we handle this?

        5. Reading in general. I read. Long delays between reads, then the first data read is incorrect as the BMx280 'saves' the last reading in memory for you to query. Do we read twice in a row and ignore the first reading?
         
  • mmotte

    mmotte - 2018-02-11

    The good news is that I got 4+ additional inches of snow and the barometer dropped from 30.23 to 29.92. That wasn't the good news, I have to shovel and plow. The good news was the BME280 tracked down and agrees with the barometer.

    @Anobium Note in the data you sent yesterday, the humidity should have gone up a lot when the temperature went down. Further checking of equations and types.

    Altitude:
    Yes Bosch published a fun 5.255 power equation but below that in the BMP180 sheet the give a rule of thumb, 1.2 hPa per 10m of altitude. In the end this is just a subtraction correction factor for altitude. What is amazing is once the equations were working and i subtracted my 270m altitude, the pressure was with in several hundreths of inHg. On all 3 sensors! they did a good job on the calibration factors that I could not understand.
    The spec sheet says that the BME280 is an absolute pressure sensor. Absolute means it measures from 0 pressure = vaccuum .

    Yes the data is buffered or at least held in a buffer that you can read anytime with out worry of whether the conversion is in progress. If you immediate values then you need to go to manual read and check for done. Barometer for weather moves very slowly and for this application i don't think it will affect you much. i have the auto read set at 1 sec update..

    I need to get this portable for mor testing.

    BR
    Mike

     
    • Anobium

      Anobium - 2018-02-11

      That is a good test case! 4inches of snow.

      Looking forward to the next release. I will wait.

      :-)

       
  • stan cartwright

    stan cartwright - 2018-02-11

    I lost track of this thread. It started bmp280 and now is bmp180. Do the latest bmp.h and demos work with bmp280? Modified anobium bmp280.h ?
    I can then user test. Cheers.

     
  • mmotte

    mmotte - 2018-02-11

    With the help of Theo and Thomas Henry we got them both to work, BMP180 and BME280.

    Humidity was not working on the BME280 but i think it is fixed. In testing mode right now.

    Here is the latest BME 280 files

    73
    Mike

     

    Last edit: mmotte 2018-02-11
  • stan cartwright

    stan cartwright - 2018-02-12

    Thanks Mike, I changed to mega328p,16 and getting results.
    I held the device and soon reaches body temp ok.
    Pressure hpa = 1042.38 Pressure inHg = 30.78
    Humidity = 0.00

     
<< < 1 2 3 4 > >> (Page 3 of 4)

Log in to post a comment.