Skip to content

Commit

Permalink
Pull request #10: Arduino xensiv dps3xx docs fixes
Browse files Browse the repository at this point in the history
Merge in DESSWDEV/arduino-xensiv-dps3xx from arduino-xensiv-dps3xx-docs-fixes to develop

* commit '5229f4d4126fd6483bdb1048ae734bc162f42617':
  Remove tdb from readme
  minor typo fixes
  Formatting, spellchecking
  Change official library name, remove critical chars
  Fix links
  Fix version number
  Insert kit2go pictures
  Insert some more info
  Check for hard tabs, whitespaces and spellchecking
  Check for hard tabs, whitespaces, traling blanks, spellchecking and insert returns for functions
  update library metadata
  update readme, add product pictures
  removed .vscode
  • Loading branch information
OlafFilies committed Jun 13, 2023
2 parents eb4eeea + 5229f4d commit e310f08
Show file tree
Hide file tree
Showing 19 changed files with 1,522 additions and 1,502 deletions.
34 changes: 17 additions & 17 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# License Summary for Repository
```
Important Notice:
Changes, suggestions and commits in this repository may only be done putting them
Changes, suggestions and commits in this repository may only be done putting them
under the same license of the respective file.
All rights of the respective copyright holders shall be reserved.
Brands and product names are trademarks of their respective owners.
Expand All @@ -12,22 +12,22 @@ their respective licenses.

Copyright (c) 2018 Infineon Technologies AG

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.
Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.

Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
148 changes: 50 additions & 98 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,50 @@
# DPS3xx Digital Pressure Sensor

<img src="https://raw.githubusercontent.com/Infineon/Assets/master/Pictures/DPS310_PP.jpg" width=150><img src="https://raw.githubusercontent.com/Infineon/Assets/master/Pictures/DPS310-Pressure-Shield2Go_Top.png" width=300>

<img src="https://www.infineon.com/export/sites/default/media/products/Small_Signal_Discretes/lowres-DPS368_VLGA-8-2_Combi.tif.png_1864837327.png" width=150><img src="https://raw.githubusercontent.com/Infineon/Assets/master/Pictures/DPS368-Pressure-Shield2Go_Top.jpg" width=300>

Library of Infineon's highly sensitive [DPS368 sensor](https://www.infineon.com/cms/en/product/sensor/pressure-sensors/pressure-sensors-for-iot/dps368/) and [DPS310 sensor](https://www.infineon.com/cms/en/product/sensor/pressure-sensors/pressure-sensors-for-iot/dps310/) for Arduino.

## Summary
## DPS368

The [DPS368](https://www.infineon.com/cms/en/product/sensor/pressure-sensors/pressure-sensors-for-iot/dps368/) is a miniaturized digital barometric air pressure sensor with ultra-high precision (±2 cm) and a low current consumption, capable of measuring both pressure and temperature. It is is an ultra small waterproof pressure sensor, environmentally protected against water (IPx8), dust & humidity Due to its robust package, it can withstand 50 m under water for one hour (IPx8). The pressure sensor element is based on a capacitive sensing principle which guarantees high precision during temperature changes. The small package (2.0 x 2.5 x 1.1 mm³) makes the DPS3xx ideal for mobile applications and wearable devices.

### Summary of Features:

* Package dimensions: 8-pin LGA, 2.0 x 2.5 x 1.1 mm³
* Operation range:
* Pressure: 300–1200 hPa
* Temperature: -40–85°C
* Precision: ± 0.002 hPa (or ±0.02 m)
* Rel. accuracy: ± 0.06 hPa (or ±0.5 m)
* Abs. accuracy: ± 1 hPa (or ±8 m)
* Temperature accuracy: ± 0.5°C
* Avg. current consumption: 1.7 µA (pressure measurement@1 Hz sampling rate, standby: 0.5 µA)
* Integrated FIFO
* Interface: I2C and SPI (I2C with optional interrupt)

### Benefits

* Fast, ultra-low noise read-out allows for precise measurement of altitude, air flow and body movements
* Small package size ideal for wearable devices & mobile applications
* Sensor can be used in harsh environment (water, dust & humidity)
* Environmentally resistant package facilitates handling in assembly line

### Target Applications

* Smart watches & wearables (e.g. fitness tracking)
* Smart phone (e.g. navigation)
* Home appliances (e.g. air flow control)
* Drones (e.g. flight stability)

## DPS310

The [DPS310](https://www.infineon.com/dgdl/Infineon-DPS310-DS-v01_00-EN.pdf?fileId=5546d462576f34750157750826c42242) 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

The master branch is always release ready; therefore, you can just download this library by downloading it from GitHub directly:

Please download this repository from GitHub by clicking on the above button `Clone or download` of this repository:

![Download Library](https://raw.githubusercontent.com/Infineon/Assets/master/Pictures/Download_Repo.png)

To install the DPS3xx 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** > **arduino-xensiv-dps3xx**.

![Install Library](https://raw.githubusercontent.com/infineon/assets/master/Pictures/Library_Install_ZIP.png)

## 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 of DPS368 [here](https://www.infineon.com/dgdl/Infineon-DPS3xx-DS-v01_00-EN.pdf?fileId=5546d46269e1c019016a0c45105d4b40) and DPS310 [here](https://www.infineon.com/dgdl/Infineon-DPS310-DS-v01_00-EN.pdf?fileId=5546d462576f34750157750826c42242)

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

* [DPS368 Pressure Shield2Go](https://www.infineon.com/cms/en/product/evaluation-boards/s2go-pressure-dps368)
* [DPS310 Pressure Shield2Go](https://www.infineon.com/cms/en/product/evaluation-boards/s2go-pressure-dps368)


### DPS3xx Pressure Shield2Go
The DPS3xx 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](https://github.com/Infineon/DPS3xx-Library-Arduino/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 DPS3xx is shipped as I2C configuration right now.

* [Link](https://github.com/Infineon/DPS3xx-Library-Arduino/wiki) 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](https://github.com/Infineon/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 DPS3xx Pressure Shield2Go onto the XMC2Go as shown below.

<img src ="https://raw.githubusercontent.com/Infineon/Assets/master/Pictures/DPS310_S2Go_w_XMC2Go.png" width=250>

### Additional Information
Please find the datasheet of the DPS368 [here](https://www.infineon.com/dgdl/Infineon-DPS368-DS-v01_00-EN.pdf?fileId=5546d46269e1c019016a0c45105d4b40) and DPS310 [here](https://www.infineon.com/dgdl/Infineon-DPS310-DS-v01_00-EN.pdf?fileId=5546d462576f34750157750826c42242). 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.
# XENSIV™ Digital Pressure Sensor Arduino Library

Arduino library of Infineon's [**XENSIV™ Digital Pressure Sensors (DPS)**](https://www.infineon.com/cms/en/product/sensor/pressure-sensors/pressure-sensors-for-iot/).

<img src="https://www.infineon.com/export/sites/default/media/products/Small_Signal_Discretes/lowres-DPS368_VLGA-8-2_Combi.tif.png_1864837327.png" width=200>

## Supported Products

<table>
<tr>
<td rowspan=2>products</td>
<td><img src="docs/img/dps310.png" height="150"></td>
<td><img src="docs/img/dps368.png" height="150"></td>
</tr>
<tr>
<td style="test-align : center"><a href="https://www.infineon.com/cms/de/product/sensor/pressure-sensors/pressure-sensors-for-iot/dps310/">XENSIV™ DPS310</a></td>
<td style="test-align : center"><a href="https://www.infineon.com/cms/de/product/sensor/pressure-sensors/pressure-sensors-for-iot/dps368/">XENSIV™ DPS368</a></td>
</tr>
<tr>
<td rowspan=2>shield2go</td>
<td><img src="docs/img/dps310-shield2go.png" height="150"></td>
<td><img src="docs/img/dps368-shield2go.png" height="150"></td>
</tr>
<tr>
<td style="test-align : center"><a href="https://www.infineon.com/cms/en/product/evaluation-boards/s2go-pressure-dps310/">XENSIV™ DPS310 Shield2Go</a></td>
<td style="test-align : center"><a href="https://www.infineon.com/cms/en/product/evaluation-boards/s2go-pressure-dps368/">XENSIV™ DPS368 Shield2Go</a></td>
</tr>
<tr>
<td rowspan=2>kit2go</td>
<td><img src="docs/img/dps310-kit2go.png" height="150"></td>
<td><img src="docs/img/dps368-kit2go.png" height="150"></td>
</tr>
<tr>
<td style="test-align : center"><a href="https://www.infineon.com/cms/en/product/evaluation-boards/kit_dps310_2go/">XENSIV™ DPS310 Kit 2Go</a></td>
<td style="test-align : center"><a href="https://www.infineon.com/cms/en/product/evaluation-boards/kit_dps368_2go/">XENSIV™ DPS368 Kit 2Go</a></td>
</tr>
</table>

## Getting Started

### Installation

To install the digital pressure sensor library in the Arduino IDE, please go to **Sketch** > **Include Library** > **Manage Libraries...** search for the ```DigitalPressureSensor``` library by Infineon in the Arduino library manager.

### Usage
Please see the example sketches in the `/examples` directory in this repository to learn more about the usage of the library. Especially, take care of the respective SPI and I²C configuration of the sensor.

## License

See the [LICENSE](LICENSE.md) file for more details.
Binary file added docs/img/dps310-kit2go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/dps310-shield2go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/dps310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/dps368-kit2go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/dps368-shield2go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/dps368.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 57 additions & 32 deletions examples/i2c_background/i2c_background.ino
Original file line number Diff line number Diff line change
@@ -1,42 +1,67 @@
#include <Dps3xx.h>
/**
* @details This example shows how to read several results for the temperature
* and the pressure from the DPS3xx buffer. The DPS3xx can hold up
* to 32 value inside the buffer. If this value is reach no further
* values are stored.
*/

// Dps3xx Opject

// Dps3xx Object
Dps3xx Dps3xxPressureSensor = Dps3xx();

void setup()
{
Serial.begin(9600);
while (!Serial);
while (!Serial)
;

//Call begin to initialize Dps3xxPressureSensor
//The parameter 0x76 is the bus address. The default address is 0x77 and does not need to be given.
//Dps3xxPressureSensor.begin(Wire, 0x76);
//Use the line below instead to use the default I2C address.
/*
* Call begin to initialize Dps3xxPressureSensor
* The parameter 0x76 is the bus address. The default address is 0x77
* and does not need to be given. Dps3xxPressureSensor.begin(Wire, 0x76);
* Use the line below instead to use the default I2C address.
*/
Dps3xxPressureSensor.begin(Wire);

//temperature measure rate (value from 0 to 7)
//2^temp_mr temperature measurement results per second
/*
* temperature measure rate (value from 0 to 7)
* 2^temp_mr temperature measurement results per second
*/
int16_t temp_mr = 2;
//temperature oversampling rate (value from 0 to 7)
//2^temp_osr internal temperature measurements per result
//A higher value increases precision

/*
* temperature oversampling rate (value from 0 to 7)
* 2^temp_osr internal temperature measurements per result
* A higher value increases precision
*/
int16_t temp_osr = 2;
//pressure measure rate (value from 0 to 7)
//2^prs_mr pressure measurement results per second

/*
* pressure measure rate (value from 0 to 7)
* 2^prs_mr pressure measurement results per second
*/
int16_t prs_mr = 2;
//pressure oversampling rate (value from 0 to 7)
//2^prs_osr internal pressure measurements per result
//A higher value increases precision

/*
* pressure oversampling rate (value from 0 to 7)
* 2^prs_osr internal pressure measurements per result
* A higher value increases precision
*/
int16_t prs_osr = 2;
//startMeasureBothCont enables background mode
//temperature and pressure ar measured automatically
//High precision and hgh measure rates at the same time are not available.
//Consult Datasheet (or trial and error) for more information
int16_t ret = Dps3xxPressureSensor.startMeasureBothCont(temp_mr, temp_osr, prs_mr, prs_osr);
//Use one of the commented lines below instead to measure only temperature or pressure
//int16_t ret = Dps3xxPressureSensor.startMeasureTempCont(temp_mr, temp_osr);
//int16_t ret = Dps3xxPressureSensor.startMeasurePressureCont(prs_mr, prs_osr);

/*
* startMeasureBothCont enables background mode
* temperature and pressure ar measured automatically
* High precision and hgh measure rates at the same time are not available.
* Consult Datasheet (or trial and error) for more information
*/
int16_t ret = Dps3xxPressureSensor.startMeasureBothCont(temp_mr, temp_osr, prs_mr, prs_osr);
/*
* Use one of the commented lines below instead to measure only temperature or pressure
* int16_t ret = Dps3xxPressureSensor.startMeasureTempCont(temp_mr, temp_osr);
* int16_t ret = Dps3xxPressureSensor.startMeasurePressureCont(prs_mr, prs_osr);
*/

if (ret != 0)
{
Expand All @@ -49,19 +74,19 @@ void setup()
}
}



void loop()
{
uint8_t pressureCount = 20;
float pressure[pressureCount];
uint8_t temperatureCount = 20;
float temperature[temperatureCount];
float temperature[temperatureCount];

//This function writes the results of continuous measurements to the arrays given as parameters
//The parameters temperatureCount and pressureCount should hold the sizes of the arrays temperature and pressure when the function is called
//After the end of the function, temperatureCount and pressureCount hold the numbers of values written to the arrays
//Note: The Dps3xx cannot save more than 32 results. When its result buffer is full, it won't save any new measurement results
/*
* This function writes the results of continuous measurements to the arrays given as parameters
* The parameters temperatureCount and pressureCount should hold the sizes of the arrays temperature and pressure when the function is called
* After the end of the function, temperatureCount and pressureCount hold the numbers of values written to the arrays
* Note: The Dps3xx cannot save more than 32 results. When its result buffer is full, it won't save any new measurement results
*/
int16_t ret = Dps3xxPressureSensor.getContResults(temperature, temperatureCount, pressure, pressureCount);

if (ret != 0)
Expand Down Expand Up @@ -93,6 +118,6 @@ void loop()
}
}

//Wait some time, so that the Dps3xx can refill its buffer
// Wait some time, so that the Dps3xx can refill its buffer
delay(10000);
}
Loading

0 comments on commit e310f08

Please sign in to comment.