Adafruit LPS35HW Water Resistant Pressure Sensor Created by Bryan Siepert Last updated on 2019-06-21 09:01:57 PM UTC
Overview Sometimes you need to sense pressure when it's wet. And sometimes you need to know the relative changes in pressure as well as the absolute pressure. For the times you need to do both (or either), the LPS35HW is the pressure sensor for you. Combining protection from water intrusion with support for high precision relative and absolute measurements, this sensor will do what you need.
A capable sensor The ST LPS35HW is a water resistant barometric pressure and temperature sensor that is also safe to use in wet environments. The sensing element is nestled safely in a ceramic package and is encased in a waterproof gel that prevents water that gets into the sensor from interfering with readings.
We placed this sensor on a breakout board with a 3.3V regulator and level shifting circuitry so it can be used by 3V or 5V power/logic devices. A small piece of header is also included, so you can solder it in for use with a breadboard. © Adafruit Industries https://learn.adafruit.
Pinouts Power Pins Vin - this is the power pin. Since the sensor chip uses 3.3 VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V, for a feather use 3.3V 3Vo - this is the 3.
If you want to connect multiple LPS35HW's to one microcontroller, have them share the SDI, SDO and SCK pins. Then assign each one a unique CS pin. Other pins INT is the interrupt output pin. You can configure the interrupt to trigger for various 'reasons' such as going over or under a configured pressure threshold. Voltage level is the same as Vcc. The low pressure threshold interrupt only works when the LPS35HW is operating in relative mode. © Adafruit Industries https://learn.adafruit.
Arduino I2C Wiring Use this wiring if you want to connect via I2C interface By default, the i2c address is 0x5d. If you add a jumper from SDO to GND, the address will change to 0x5c. If you are running a 5V Arduino (Uno, etc.), connect Arduino 5V to board VIN Connect Arduino GND to board GND Connect Arduino SCL to board SCK Connect Arduino SDA to board SDI The final results should resemble the illustration above, showing an Adafruit Metro development board.
Library Installation You can install the Adafruit LPS35HW Library for Arduino using the Library Manager in the Arduino IDE: Click the Manage Libraries ... menu item, search for Adafruit LPS35HW, and select the Adafruit LPS35HW library: Then follow the same process for the Adafruit BusIO library. Load Example Open up File -> Examples -> Adafruit LPS35HW -> lps35hw_test and upload to your Arduino wired up to the sensor.
Temperature is calculated in degrees C, you can convert this to F by using the classic F = C * 9/5 + 32 equation. Pressure is returned in the SI units of Pascals. 100 Pascals = 1 hPa = 1 millibar. Often times barometric pressure is reported in millibar or inches-mercury. For future reference 1 pascal =0.000295333727 inches of mercury, or 1 inch Hg = 3386.39 Pascal. So if you take the pascal value of say 100734 and divide by 3386.39 you'll get 29.72 inches-Hg.
Arduino Docs Arduino Docs (https://adafru.it/ERq) © Adafruit Industries https://learn.adafruit.
Python and CircuitPython It's easy to use the LPS35HW sensor with Python and CircuitPython, and the Adafruit CircuitPython LPS35HW (https://adafru.it/ERZ) module. This module allows you to easily write Python code that reads the pressure and temperature from the sensor. You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library (https://adafru.it/BSN).
Remember for non-express boards like the, you'll need to manually install the necessary libraries from the bundle: adafruit_lps35hw.mpy adafruit_bus_device adafruit_register You can also download the adafruit_lps35hw.mpy from its releases page on Github (https://adafru.it/ER-). Before continuing make sure your board's lib folder or root filesystem has the adafruit_lps35hw.mpy, adafruit_bus_device, and adafruit_register files and folders copied over. Next connect to the board's serial REPL (https://adafru.
For example to print the pressure and temperature values: print("Pressure: %.2f hPa" % lps35hw.pressure) print("Temperature: %.2f C"% lps35hw.temperature) For more details, check out the library documentation (https://adafru.it/ES0). That's all there is to using the LPS35HW sensor with CircuitPython! Full Example Code import time import board import adafruit_lps35hw i2c = board.I2C() lps = adafruit_lps35hw.LPS35HW(i2c) while True: print("Pressure: %.2f hPa" % lps.pressure) print("Temperature: %.
Python Docs Python Docs (https://adafru.it/ERr) © Adafruit Industries https://learn.adafruit.
Downloads Files LPS35HW Datasheet (https://adafru.it/ES1) EagleCAD files on GitHub (https://adafru.it/ES2) Fritzing object from Adafruit Fritzing Library (https://adafru.it/ES3) Schematic Fab Print © Adafruit Industries https://learn.adafruit.
© Adafruit Industries https://learn.adafruit.
© Adafruit Industries Last Updated: 2019-06-21 09:01:57 PM UTC Page 18 of 18