Coder Social home page Coder Social logo

infineon / dps310-pressure-sensor Goto Github PK

View Code? Open in Web Editor NEW
44.0 11.0 27.0 196 KB

DEPRECATED: Library of Infineon's highly sensitive DPS310 pressure sensor for Arduino.

License: Other

C++ 99.53% C 0.47%
shield2go infineon pressure-sensor arduino-library arduino makers prototyping

dps310-pressure-sensor's Introduction

Attention:

This library is deprecated and will be not maintained any longer. Please use the new XENSIV™ Digital Pressure Sensor Arduino Library library instead.

DPS310-Digital-Pressure-Sensor

Build Status

Library of Infineon's highly sensitive DPS310 sensor for Arduino.

Summary

The DPS310 is a miniaturized digital barometric air pressure sensor with a high accuracy and a low current consumption, capable of measuring both pressure and temperature. The internal signal processor converts the output from the pressure and temperature sensor elements to 24 bit results. Each unit is individually calibrated, the calibration coefficients calculated during this process are stored in the calibration registers. The available raw data of the sensor can be calibrated by using the pre-calibrated coefficients as they are used in the application to convert the measurement results to high accuracy pressure and temperature values.

Sensor measurements and calibration coefficients are available through the serial I2C or SPI interface.

Key Features and Applications

  • Supply voltage range 1.7V to 3.6V
  • Operation range 300hPa – 1200hPa
  • Sensor’s precision 0.005hPa
  • Relative accuracy ±0.06hPa
  • Pressure temperature sensitivity of 0.5Pa/K
  • Temperature accuracy ±0.5C°
  • Applications
    • Wearable applications, sport and fitness activities tracking
    • Drones automatic pilot, fix point flying
    • Indoor navigation, altitude metering

Installation

Integration of Library

Please download this repository from GitHub by clicking on the following field in the latest release of this repository:

Download Library

To install the DPS310 pressure sensor library in the Arduino IDE, please go now to Sketch > Include Library > Add .ZIP Library... in the Arduino IDE and navigate to the downloaded .ZIP file of this repository. The library will be installed in your Arduino sketch folder in libraries and you can select as well as include this one to your project under Sketch > Include Library > DPS310.

Install Library

Usage

Please see the example sketches in the /examples directory in this library to learn more about the usage of the library. Especially, take care of the respective SPI and I²C configuration of the sensor. For more information, please consult the datasheet here.

Currently, there exists the DPS310 Pressure Shield2Go evaluation board as a break out board:

DPS310 Pressure Shield2Go

The DPS310 Pressure Shield2Go is a standalone break out board with Infineon's Shield2Go formfactor and pin out. You can connect it easily to any microcontroller of your choice which is Arduino compatible and has 3.3 V logic level (please note that the Arduino UNO has 5 V logic level and cannot be used without level shifting). Please consult the wiki for additional details about the board.

Each sensor can only work either SPI or I2C. To convert from SPI to I2C, for example, you have to re-solder the resistors on the Shield2Go. Please take care that every Shield2Go for the DPS310 is shipped as I2C configuration right now.

  • Link to the wiki with more information

However, every Shield2Go is directly compatible with Infineon's XMC2Go and the recommended quick start is to use an XMC2Go for evaluation. Therefore, please install (if not already done) also the XMC-for-Arduino implementation and choose afterwards XMC1100 XMC2Go from the Tools>Board menu in the Arduino IDE if working with this evaluation board. To use it, please plug the DPS310 Pressure Shield2Go onto the XMC2Go as shown below.

Known Issues

Temperature Measurement Issue

There could be a problem with temperature measurement of the DPS310. If your DPS310 indicates a temperature around 60 °C although you expect around room temperature, e.g. 20 °C, please call the function correctTemp() as included in the library to fix this issue.

In case you need additional help, please do not hesitate to open an issue in this repository.

Interrupt mode

Interrupt mode not working reliably on XMC2Go for DPS310 right now.

Additional Information

Please find the datasheet of the DPS310 here. It depends on the evaluation board which you are using or the respective configuration of the sensor on your PCB which communication protocol as well as addresses you need to use for communicating with the sensor.

dps310-pressure-sensor's People

Contributors

arkajyotichatterjee avatar cyberschmiddi avatar ederjc avatar mhollfelder avatar miccico avatar olaffilies avatar pandayswarnam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dps310-pressure-sensor's Issues

Possible Error Code?

Hello,

I am attempting to read the pressure on a DPS310 on a custom board, and I am getting the value 0x07 0xFF 0xF6 for the first three registers. This value is consistently appearing for multiple sensors. Is this an error code that indicates damage to the sensor?

best,
DC

Goertek SPL06-007

I have been using this library with both the Infineon DPS310 and Goertek SPL06-007, which I believe to be a packaging of the DPS310. I was experiencing a problem reading temperatures from the Goertek sensor with code that worked on the Infineon sensor. I have discovered that the Goertek sensor does not implement, according to its specification document, the TMP_COEF_
SRCE (0x28). However, an attempt to read this register does not fail. Consequently, the code in DPS310::init which selects the temperature based on the value in bit 7 of TMP_COEF_SRCE does not work correctly and results in the temperature being read from the ASIC while the coefficients are for the MEMS sensor.

For my purposes it is sufficient to hardcode sensor=1 but a better solution would be either for Goertek to properly implement TMP_COEF_SRCE or for this library to read the Product ID and Revision to determine whether this is a Goertek implementation. (I am assuming they are different from the DPS310 values but have not actually checked.)

Assistance greatly appreciated in calculating temperature

Hi all,

I've spent a couple of days trying to get correct temperature data out of a DPS310 on custom hardware, to seemingly no avail - and would greatly appreciate some input.

Background:

  • Custom hardware
  • Communication with DPS310 is via SPI, at 8MHz, good waveforms confirmed on scope etc
  • SPI host is a 32-bit Microchip SAM MCU, 6 other SPI devices on the slave all communicating and working as expected
  • Good comms with device confirmed with a good readback of both REV_ID and PROD_ID
  • Device soft resets OK, and reads back the coefs OK. My coefs appear to have been read and reconstructed correctly by our driver, as they are almost identical to other users coefs (such as found here #23). My coefs are below.
coefs	
c0	222
c1	-297
c00	79832
c10	-56308
c01	-2295
c11	1444
c20	-9701
c21	111
c30	-1289
  • I have the DPS310 configured for no oversampling (i.e. TMP_PRC default), so my Kt is 524288.
  • DPS310 device and PCB confirmed at 25.7degC with calibrated thermal camera and contact temperature measurement

I'm reading Traw as 200498.

So following the datasheet - Traw_sc = Traw/kT = 200498/524288 = 0.382419
Tcomp = (c0 * 0.5)+(c1 * Traw_sc) = 111+(-113.578443) = ~(-2.57)degC.

I've run the calculation as above, outside of the driver to simply try and understand where I'm going wrong with the calculation, rather than any type errors/type conversion errors in the driver, as I think the problem is with my understanding of how to calculate the temperature, rather than the driver per se.

For example, using the values from @tmanaud in the thread I linked to earlier, I get 99.07degC - though I've no idea if that temp is correct as the post does not state the temperature.

Really hoping somebody can point me in the right direction. Many thanks!

Unstable pressure value

Hello,

I have an issue with the pressure sensor, as you can see on the picture below, the pressure measures are not correct. (At ~20sec the sensor move from a position A to a position B (position A higher than B) so I should have stable measures before ~20sec, a gap and stable measures with higher values after ~20sec).

image

The pressure sensor configuration is :

  • for the pressure 4Hz with an oversampling of 2
  • for the temperature 4Hz with an oversampling of 1
  • interrupt when the FIFO is full, we read the data in the FIFO at every interrupt.

The sensor is on a custom board (with an MCU EFM32). I have several custom boards with this sensor this problem appears only on a few boards. In the defective board I have pressure value at 97600-97900 but with a good board I have value at ~101400.

The communication between the MCU and the sensor is correct, I can read or write into the registers.

Did you ever see a problem like this one and what can be the cause ?

Thank you.
ClémentBC

DPS310-Pressure-Sensor with XMC 2 Go

I am continually getting the error "FAIL! ret = -2" (the DPS__FAIL_INIT_FAILED error) on the serial monitor when trying to run the example sketch i2c_command with the DPS310.
This happens both with the XMC1100 XMC2Go and with an ESP32.

I'm using Arduino IDE 1.6.13 with the XMC2Go (as the 1.8 series doesn't seem to be upload to it).
With the ESP32 I'm using Arduino IDE 1.8.13

I'm using XMC-for-Arduino version 1.5.0

No other code or hardware is being used.

Any ideas?

Thanks

Errors in temperature readings in 1/200 devices

Prerequisites

On particular devices, the temperature reading can be around 30-40degC higher than expected.

Description:

This is a known defect. There is however no errata sheet. The is no "paper trail" for audits.

The "recommended" fix does not help in mass production of products.

"There could be a problem with temperature measurement of the DPS310. If your DPS310 indicates a temperature around 60 °C although you expect around room temperature, e.g. 20 °C, please call the function correctTemp() as included in the library to fix this issue."

Poking values into random (ie, undocumented, magic) registers on devices which demonstrate this fault may be okay for hobbyists, but is not really a solution.

Can a formal explanation be supplied (your [email protected] dont reply to formal requests) with a documented automated process to determine when these magic numbers are to be used (checking internal batch or revision number et al)?

This fault appears in around 1 in 200 sample devices.

ESP32 build error

Dear,

I've set up the examples for I2C communication on the esp32 Dev Module board in the Arduino IDE. In all examples the object initialisation fails, or at least returns -2. I've programmed a loop to try all addresses, but to no avail. Any idea on what to do?

ESP-01 not correct temperature and pressure values

I am trying to use an ESP-01 board to read temperature and pressure from a DPS310 mounted on a Shield2Go breakout board thorough the I2C communication interface. The board is configured for communicating through th I2C serial interface, and no changes have been performed as achieved from the factory. In the ESP-01 board I am using the GPI00 and GPI02 digitai IN/OUT as the SCL and SDA communication pins, respectively.

I have installed the 1.0.7 version of the DPS310 library and I have modified the i2c_command.ino example by preceeding the DSP310PressureSensor.begin(Wire) with the command Wire.pins(2,0) in order to set the correctly the communications pin and not to use the dafault ones.

In this way the communication initialization is performed correctly and the continuous read of pressure and temperature goes on and the values are reported on the Arduino IDE (ver. 1.8.8) serial monitor....However, the values have no sense.

In particiular:
the temperature is always 0.00
the pressure negative and around -200 Pa

It seems that the raw data from the DPS310 register are de-codified in the wrong way (wrong 2 complement or byte order...I do not know).

Please, may you help because the possibility to connect the DPS310 directly to a small footprint, high communication capabilities as the ESP-01, without using an Arduino board (that needs also levels shift) would be a great thing.

Many Thanks,

Carlo.

Sample values for DPS310 coefficient, temperature registers

Hello,

I'm writing unit tests for DPS310, and as a part of tests I'm mocking the register map to check the coefficient calculation and further temperature + pressure calculations.

Could you provide a sample data set with coefficients, positive temperature value, negative temperature value and a temperature compensated pressure readout? I'd need the raw register values and parsed values.

Thanks

correctTemp - bibliography

Hello,

I have unknown issue with DPS310 integration in a watch. In some watches, not all of them, we observe 2 incoherent patterns which seem to come from the pressure sensor.
We are working at 1Hz with an oversampling of 16.

  1. around important variation, some absurd dots appears (for a variation of 1 meter (8 Pa), 1 measure go up to to 25 Pa).
  2. after the variation, it could take 3-7 seconds for the altimeter to reach the stabilized value

image

I am now stuck with the issue and I am considering a bad calibration of temperature and the usage of the correctTemp function you offer.
As the function mainly write into registers which are not define in datasheet, is there a paper confirming the usage of this command?

Thank you for your support,

JG

Wrong pressure value

I am having problems reading out a correct pressure value using the i2c_command.ino example . The pressure value I receive is 86869888 Pascal. The Temperature value is correct ~27°C. Moreover the pressure value is increasing if I rise the sensor but the value should decrease.

dps310 pressure sensor high precision mode (5cm)

Hello i have a question about dps310 high precision mode. I configured sensor in that mode, but values i got are oscillate to much. I bought pressure 3 click board with dps310 sensor, and i am using Arduino libraries from this site. For example , my first 10 values are 985.31mBar , then values are start rising slowly ( i get values on every 250ms) 985.32 , 955.33 ... 985.35 , then again falling 985.34, 985,33 ... 985.31 ... 985.28mBar ( values are oscillate about +-50cm in relation to the starting values). Why ? Is it problem in self heating ? Why values oscillate when conditions are same ? Where did you test high precision mode ? In closed room or outside ? Did someone have similar problem ? Do i need some extra functions to eliminate this problem ? Regards :D

DPS310-Pressure-Sensor-dps310 SPI error

I began getting this error after a recent library update. I've read that the Arduino core library changed the way SPI is used and has broken some libraries. Is there and update to the DPS310-Pressure-Sensor-dps310 v1.07 library to fix this? If not is there some examples of how to fix it?

I'm using the Grove High Precision Pressure Sensor (DPS310) on the MKR 1010 WiFi I2C bus. It's been working well until the library update. I'm using Arduino IDE 1.8.19 on Windows 10 21h1 and File -> Example -> DigitalPressureSensor. The DigitalPressureSensor library is v1.0.6 but is not used because the DPS310-Pressure-Sensor-dps310 v1.07 is used. The SAMD Boards (32-bit ARM Cortex-Mo+ is version 1.8.13. The error is shown below.

D:\arduino\libraries\DPS310-Pressure-Sensor-dps310\src\DpsClass.cpp: In member function 'void DpsClass::begin(arduino::SPIClass&, int32_t, uint8_t)':
D:\arduino\libraries\DPS310-Pressure-Sensor-dps310\src\DpsClass.cpp:62:12: error: 'arduino::SPIClass {aka class arduino::HardwareSPI}' has no member named 'setDataMode'
  m_spibus->setDataMode(SPI_MODE3);
            ^~~~~~~~~~~
Multiple libraries were found for "Dps310.h"
 Used: D:\arduino\libraries\DPS310-Pressure-Sensor-dps310
 Not used: D:\arduino\libraries\DigitalPressureSensor

dps310 pressure sensor

hi
am currently working on dps310 pressure sensor by using i2c interface,am unable to read temperature and pressure
1.is it mandatory to read temperature for getting pressure
2.what is functional flow to read temperature
3.am getting pressure value as "16560505",so i want to read the temperature first
could you tell me the steps to read temperature ??
am getting c0 =101 and c1=216 as calibration values after reset is it correct,how what are the values these 2 registers are loaded with after reset...?????

thanks & regards
suraj.n

Height variation calculation with DSP310

Could you provide sample code to estimate height variation with DSP310?

I would like to use it in a elevator. The elevator will start in floor 0. When there is a vertical motion (IMU interrupt), it should measure base pressure and start tracking height variation up to floor x. The height of floor x if known. The next time there is a vertical motion (IMU interrupt), it should start tracking again height variation up to floor y...

Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.