This library is fitted for the WSEN-PADS-Addon-Board from eHaJo
Please see examples for further usage of it.
(C) 2019 , Elektronik Hannes Jochriem, Germany
This library is open source and released under MIT license. Please see this file for further information.
The WSEN-PADS is a MEMS-based chip with 24bit resolution for the absolute pressure. It includes some cool features:
- samplerate up to 200Hz
- 128-stage FIFO
- temperature sensor
- configurable interrupt The standard is to tie SAO high (for better energy savings), so the standard address is 0x5D: Binary: 1 0 1 1 1 0 SAO Hex: 0x5C and 0x5D
Register | Name | Default |
---|---|---|
0x0B | INT_CFG | 0x00 |
0x0C | THR_P_L | 0x00 |
0x0D | THR_P_H | 0x00 |
0x0E | INTERFACE_CTRL | 0x00 |
0x10 | CTRL_1 | 0x00 |
0x11 | CTRL_2 | 0x10 |
0x12 | CTRL_3 | 0x00 |
0x13 | FIFO_CTRL | 0x00 |
0x14 | FiFO_WTM | 0x00 |
0x15 | REF_P_L | 0x00 |
0x16 | REF_P_H | 0x00 |
0x18 | OPC_P_L | 0x00 |
0x19 | OPC_P_H | 0x00 |
First function to be called before begin() if address is set to 0x5D like in standard-board-configuration (sao=1)
Set all private registers and start the sensor chip like defined in opmode. Available opmodes are:
opmode | function |
---|---|
WSEN_PADS_ONESHOT | shutdown mode / single-shot |
WSEN_PADS_1HZ | continous mode, 1Hz sample rate |
WSEN_PADS_10HZ | continous mode, 10Hz sample rate |
WSEN_PADS_25HZ | continous mode, 25Hz sample rate |
WSEN_PADS_50HZ | continous mode, 50Hz sample rate |
WSEN_PADS_75HZ | continous mode, 75Hz sample rate |
WSEN_PADS_100HZ | continous mode, 100Hz sample rate |
WSEN_PADS_200HZ | continous mode, 200Hz sample rate |
Enable blockdata mode. This feature should be enabled when the reading of the data is slower than the output data rate (ODR). By default, the BDU bit is set to ’0’ and data registers are updated continuously. When BDU feature is enabled, reading of the pressure or temperature values sampled at different times can be avoided.
The sensor embeds two digital low-pass filters. First low-pass filter LPF1 is always applied to the pressure and temperature data. The second low-pass filter LPF2 can be optionally enabled and applied to the pressure data. This configuration is available for both continuous mode and single conversion mode. The lowpass-filter modes are:
lpf-mode | description |
---|---|
WSEN_PADS_ODR2 | device bandwidth ODR/2, LPF2 disabled |
WSEN_PADS_ODR9 | device bandwidth ODR/9, LPF2 enabled |
WSEN_PADS_ODR20 | device bandwidth ODR/20, LPF2 enabled |
In the low-power configuration, the device is configured to minimize the current consumption. In the low-noise configuration, the device is configured to reduce the noise.
!Attention! The low-noise mode reduces maximum odr-speed. If you have configured the speed >75Hz, it will be cut down to 75Hz.
Returns the actual pressure in float and kPa with 24 bit resolution. In one-shot-mode this function triggers the conversion and waits for the result to be ready. In continous-mode the data is just read out from the pressure-registers.
Returns the actual temperature in float and Celsius with 16 bit resolution. Works like getPressure();
This function reads pressure and temperature in one read-operation due to auto-increment of the address-pointer. You can save some flash with this function. The values are written in kPa and Celsius as float into the pointer addresses.
- Interrupt-stuff
- FIFO-stuff
- some more configuration register-stuff