Boron: LPS22 (pressure, temp sensor) not initializing

Hi all! another boron-and-sensor issue here. We're succeeding at getting our CO2 sensor, and a temp/humidity sensor, hooked up to our boron and the firmware is running great (and transmitting data). Where we're in a holding pattern, however, is our pressure sensor (LPS22, Adafruit). We're running into an issue where the pressure sensor doesn't initialize when the Boron is powered on, and because it doesn't initialize, the other sensors can't turn on/start transmitting data themselves. Indeed, we've even short-circuited a couple Boron's when connecting LPS22s to the PCB, which is an expensive mistake I'm not keen to repeat.

We're trying a few different things (is it wiring; is it the PCB; is it the LPS22 sensor itself); we used a frew different kinds of headers and cables, and we even tried a different pressure sensor (BME280) that also doesn't initialize despite using the BME280 adafruit-ported-to-Particle libraries we found here on this message board. In my book it's clearly a firmware issue, but our electrical engineer is less sure.

TL;DR -- has anybody used the LPS22 pressure sensor with their Boron, and/or had any issues with getting a pressure sensor to initialize when working with Boron MCUs for their device setup?

A lot of the example firmware ported from Arduino enters an infinite loop if initialization fails. Make sure you remove that code, otherwise the device will stop running before the other sensors can be initialized.

If the situation is temporary, like it will initialize if you try again later, you should restructure your code to do that.

If the sensors are I2C, try using an I2C scanner application to see if the devices can be seen on the I2C bus.

1 Like

Hi Rick! Thanks so much for your response; we tried those things and remained stumped.

However we found a few things that were the culprit (we think) in the end; we have been using MTA-style connections between the sensors and the PCB that the Boron is installed on. We tried using classic Dupont style connections today and found that we have had far fewer instances of initialization-failure (and, fewer instances of power 'leaking' from i2c connections with one battery type to others with another battery type). We also found that pulling the SDO pin on the LPS22 high (to power, on an adjacent i2c pinout on the PCB) helped resolve some of the bad data we were getting (e.g. spontaneously changing its reported pressure from 1013 hPa (good, fine!) to 760 (bad no this is bad).

TL;DR on the current events: we soldered three new PCBs with Dupont connections instead of MTA, and all of our i2c-enabled sensors are now reading reliable data. We're going to scale up and try to make at least 10 replicates of this pinout/board setup tomorrow; I will report back if this indeed was the problem with the LPS22 not initializing, and if we run into anything else related to the issue!

Hello and good evening!
Just a quick question here from the trenches; any chance that the I2C risetime is an issue? My first guess might be to have a look at the cable length (and capacitance, if this could be an issue at all) and have a look at the value of the Vdd termination (pullup) resistors and the rise time for the I2C clock and data. Also, have a look at the voltage extremes of the I2C clock and data; some of these parts are quite specific on the 3.6V I2C high voltage spec.

I have used the LPS28 over long cable runs, but I had to use I2C buffers to compensate for the long (ish) cables, and might I suggest getting it running with a super-cheap Arduino nano or equivalent and make your experiments on this. I keep a few around just to avoid blowing up the good stuff (Boron). Good luck! I hope this give you and idea or two!

1 Like

Further to that, what value of pullup resistors are you using on the I2C SCK and SDA lines? How about the interconnection length between the Boron and the I2C devices? Is any interconnection cable involved? A schematic would be useful too, if that's feasable. :slight_smile: Good luck!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.