adafruit_lps35hw¶
A driver for the ST LPS35HW water resistant MEMS pressure sensor
- Author(s): Bryan Siepert
Implementation Notes¶
Hardware:
- Software and Dependencies:
- Adafruit CircuitPython firmware for the supported boards:
- https://github.com/adafruit/circuitpython/releases
- Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
-
class
adafruit_lps35hw.DataRate¶ Options for
data_rateDataRateTime DataRate.ONE_SHOTOne shot mode DataRate.RATE_1_HZ1 hz DataRate.RATE_10_HZ10 hz (Default) DataRate.RATE_25_HZ25 hz DataRate.RATE_50_HZ50 hz DataRate.RATE_75_HZ75 hz
-
class
adafruit_lps35hw.LPS35HW(i2c_bus, address=93)¶ Driver for the ST LPS35HW MEMS pressure sensor
Parameters: Quickstart: Importing and using the LPS35HW
Here is an example of using the
LPS35HWclass. First you will need to import the libraries to use the sensorimport board import adafruit_lps35hw
Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA lps = adafruit_lps35hw.LPS35HW(i2c)
Now you have access to the
temperatureandpressureattributes. Temperature is in Celsius and Pressure is in hPa.temperature = lps.temperature pressure = lps.pressure
-
data_rate¶ - The rate at which the sensor measures
pressureandtemperature. data_rateshould be set to one of the values ofadafruit_lps35hw.DataRate().
Note
Setting
data_ratetoDataRate.ONE_SHOTplaces the sensor into a low-power shutdown mode where measurements to updatepressureandtemperatureare only taken whentake_measurement()is called.- The rate at which the sensor measures
-
high_threshold_exceeded¶ Returns
Trueif the pressure high threshold has been exceeded. Must be enabled by settinghigh_threshold_enabledtoTrueand setting apressure_threshold.
-
low_pass_enabled¶ True if the low pass filter is enabled. Setting to
Truewill reduce the sensor bandwidth from \(data_rate/2\) to \(data_rate/9\), filtering out high-frequency noise.
-
low_threshold_enabled¶ Set to
TrueorFalseto enable or disable the low pressure threshold.Note
The low pressure threshold only works in relative mode
-
low_threshold_exceeded¶ Returns
Trueif the pressure low threshold has been exceeded. Must be enabled by settinghigh_threshold_enabledtoTrueand setting apressure_threshold.
-
pressure¶ The current pressure measurement in hPa
-
pressure_threshold¶ The high pressure threshold. Use
high_threshold_enabledorhigh_threshold_enabledto use it
-
reset()¶ Reset the sensor, restoring all configuration registers to their defaults
-
take_measurement()¶ Update the value of
pressureandtemperatureby taking a single measurement. Only meaningful ifdata_rateis set toONE_SHOT
-
temperature¶ The current temperature measurement in degrees Celsius
-