Adafruit LPS33/LPS35 Water Resistant Pressure Sensor Created by Bryan Siepert Last updated on 2019-12-04 10:05:19 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.
The LPS35HW has a fraternal twin, the LPS33HW. In nearly all respects the LPS33HW is the same as the LPS35HW however the LPS33HW has a bonus feature: a nozzle that can be used to seal it against an enclosure or perhaps a properly fitted tube of some sort. You'll want to make sure to use an appropriately sized o-ring to ensure a good seal. Like the LPS35HW, the LPS33HW chip inside is encased in a protective gel, however in the case of the LPS33HW, the gel is mentioned as being ...
Capable sensors 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.
Similarly the LPS33HW is ensconced in a protective gel that protects it from harsh environments. Additionally it is called out by the manufacturer (ST) in the datasheet as being suitable for applications such as weather station equipment or a moist, mouth-adjacent activity that we don't encourage. Let's just say it seems well suited for things like sip-and-puff switches.
The LPS33HW also joins our growing family of boards with SparkFun qwiic (https://adafru.it/Fpw) compatible STEMMA QT (https://adafru.it/Ft4) connectors, allowing you to combine it with all sorts of other sensors (https://adafru.it/Ha9), and even displays (https://adafru.it/Haa), all without needing to solder! Just plug and go/blow! © 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 © Adafruit Industries https://learn.adafruit.
your microcontroller - e.g. for a 5V micro like Arduino, use 5V, for a feather use 3.3V 3Vo - this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like GND - common ground for power and logic I2C Logic pins: SCK - this is the I2C clock pin, connect to your microcontrollers I2C clock line. SDI - this is the I2C data pin, connect to your microcontrollers I2C data line.
Assembly © Adafruit Industries https://learn.adafruit.
Prepare the header strip: Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - long pins down Add the breakout board: Place the breakout board over the pins so that the short pins poke through the breakout pads © Adafruit Industries https://learn.adafruit.
And Solder! Be sure to solder all 8 pins for reliable electrical contact. (For tips on soldering, be sure to check out our Guide to Excellent Soldering (https://adafru.it/aTk)). © Adafruit Industries https://learn.adafruit.
You're done! Check your solder joints visually and continue onto the next steps. © 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. Connect board VCC (red wire) to Arduino 5V if you are running a 5V board Arduino (Uno, etc.). If your board is 3V, connect to that instead. Connect board GND (black wire) to Arduino GND Connect board SCL (yellow wire) to Arduino SCL Connect board SDA (blue wire) to Arduino SDA © Adafruit Industries https://learn.adafruit.
The final results should resemble the illustration above, showing an Adafruit Metro development board. SPI Wiring Since this is a SPI-capable sensor, we can use hardware or 'software' SPI. To make wiring identical on all microcontrollers, we'll begin with 'software' SPI. The following pins should be used: © Adafruit Industries https://learn.adafruit.
Connect Vin to the power supply, 3V or 5V is fine.
for both the LPS35HW and LPS33HW: 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. Depending on whether you are using I2C or SPI, change the pin names and comment or uncomment the following lines. if (!lps35hw.begin_I2C()) { //if (!lps35hw.
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.
#include Adafruit_LPS35HW lps35hw = Adafruit_LPS35HW(); // For SPI mode, we need a CS pin #define LPS_CS 10 // For software-SPI mode we need SCK/MOSI/MISO pins #define LPS_SCK 13 #define LPS_MISO 12 #define LPS_MOSI 11 void setup() { Serial.begin(115200); // Wait until serial port is opened while (!Serial) { delay(1); } Serial.println("Adafruit LPS35HW Test"); if (!lps35hw.begin_I2C()) { //if (!lps35hw.begin_SPI(LPS_CS)) { //if (!lps35hw.
Arduino Docs Arduino Docs (https://adafru.it/ERq) © Adafruit Industries https://learn.adafruit.
Python and CircuitPython It's easy to use the LPS33HW or LPS35HW sensors 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 and will work with either 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.
Python Computer Wiring Since there's dozens of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, please visit the guide for CircuitPython on Linux to see whether your platform is supported (https://adafru.it/BSN). Here's the Raspberry Pi wired with I2C: Pi 3V3 to sensor VIN Pi GND to sensor GND Pi SCL to sensor SCK Pi SDA to sensor SDI CircuitPython Installation of LPS35HW Library Next you'll need to install the Adafruit CircuitPython LPS35HW (https://adafru.
CircuitPython on Python 2.x, it isn't supported! CircuitPython & Python Usage To demonstrate the usage of the sensor we'll initialize it and read the temperature and pressure levels from the board's Python REPL. Run the following code to import the necessary modules and initialize the I2C connection with the sensor: import import import import time board busio adafruit_lps35hw i2c = busio.I2C(board.SCL, board.SDA) lps35hw = adafruit_lps35hw.
Python Docs Python Docs (https://adafru.it/ERr) © Adafruit Industries https://learn.adafruit.
Downloads LPS33HW Files LPS35HW Datasheet (https://adafru.it/ES1) LPS33HW Datasheet (https://adafru.it/H4f) LPS33HW System Integration App Note (https://adafru.it/H4b) EagleCAD files on GitHub (https://adafru.it/H4A) LPS33HW Fritzing object from Adafruit Fritzing Library (https://adafru.it/H9e) LPS35HW Fritzing object from Adafruit Fritzing Library (https://adafru.it/ES3) LPS33HW Schematic LPS33HW Fab Print © Adafruit Industries https://learn.adafruit.
LPS35HW Schematic LPS35HW Fab Print © Adafruit Industries https://learn.adafruit.
© Adafruit Industries https://learn.adafruit.
© Adafruit Industries Last Updated: 2019-12-04 10:05:18 PM UTC Page 28 of 28