Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: i2c buffer size with SENSIRION SPS30 on teensy 3.5

  1. #1
    Junior Member
    Join Date
    Nov 2018
    Posts
    8

    i2c buffer size with SENSIRION SPS30 on teensy 3.5

    Hello teensy users

    I'm trying to use a SPS30 particle sensor wiith teensy 3.5, on i2c channel.
    I use the library provided by sensirion
    sps30-master
    When running the test program
    Example13_sps30_BasicReadings_any_I2C.ino
    I get this message :

    SPS30-Example13: Basic reading with any I2C channel select. press <enter> to start

    Trying to connect.

    Detected SPS30.

    Serial number : 95325FE64F2D48AE

    Product name : 00080000

    Firmware level: 2.2

    Library level : 1.4

    Measurement started



    Hit <enter> to continue reading.

    !!! Due to I2C buffersize only the SPS30 MASS concentration is available !!!


    -------------Mass ----------- ------------- Number -------------- -Average-

    Concentration [μg/m3] Concentration [#/cm3] [μm]

    P1.0 P2.5 P4.0 P10 P0.5 P1.0 P2.5 P4.0 P10 PartSize


    2.70 3.50 4.04 4.32 0.00 0.00 0.00 0.00 0.00 0.00
    3.18 4.99 6.34 7.03 0.00 0.00 0.00 0.00 0.00 0.00
    3.53 5.55 7.05 7.82 0.00 0.00 0.00 0.00 0.00 0.00
    4.08 6.13 7.64 8.41 0.00 0.00 0.00 0.00 0.00 0.00


    I then edited the wire.h lib and changed the buffer lenght to 64 instead of 32
    #define BUFFER_LENGTH 64

    After this I still get the !!! Due to I2C buffersize only the SPS30 MASS concentration is available !!! message

    Any ideas?

    Also, is there any code to display the buffer lenght on the serial monitor?

  2. #2
    Quote Originally Posted by DavidDC View Post
    I then edited the wire.h lib and changed the buffer lenght to 64 instead of 32
    #define BUFFER_LENGTH 64 After this I still get the !!! Due to I2C buffersize only the SPS30 MASS concentration is available !!! message. Any ideas?
    WireKinetis.h defines BUFFER_LENGTH 136 for T3.5, so I think the value you changed is not where the limit is. sps30.cpp has a function called I2C_expect() that I don't understand. It looks like it makes its decisions on a specific value of buffer size, as opposed to buffer size > X. I would fiddle around with that function and figure out what it's doing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •