Pressure sensor without the library

Hello people

I have a project. All tickety boo and working, except I now need to add a pressure sensor (air).
Problem is, I am at 95% programming space and just cannot fit in a library for a sensor.

The original project used a microswitch to detect an inflated bag, but it's not working well enough, so I want to try monitoring the air pressure to the bag.

I have a pile of BMP250's here on breakout boards that I could utilise, but their library puts me way over my Pro Mini's programming space (And I have already spent hours trimming this code down to get it to fit).

Whole project is installed in it's enclosure, so changing the board is now not an option.

Is there a way I can read the data from the BMP250 over I2C (which I am already using) without the library?
I don't need accuracy, I don't need specific converted data.

All I need is to know whether the pressure has exceeded a certain threshold I set, so it can turn off the air pump.

Ideas welcome!

If the library can read the internal registers of the BMP280 then so can you. A look at the library files should reveal how to do it

I am deep into those files as we speak Bob

I think the words are ..... baffled

Yea. I am no where near clever enough to deduce what I need from the files in the library.
Can't even find a data sheet for the BMP250... they all seem to be BMP280's

Back to the shoddy microswitch I go

Where did you get the library from ?

This one seems to work with the sensor, even though it is for a BMP280 not BMP250.

The library I got from the IDE library search would not work. Probably something simple.

I am open to suggestions on this.

I spent a ridiculous amount of time trying to extract the commands I require from the BMP280 library, but no luck.
My knowledge is far below that required.

Basically, I need a digital or analogue signal when a certain pressure is reached (think half a balloon inflated).
If it's digital, this seems to need a library attached and I just cannot fit that in.

I was hoping to find an analogue output sensor that I could just add a tube to and read off the outgoing voltage, but I have not found one within my price bracket.

You can get them, but they are £40+ and I can't justify that.

Otherwise, its take the entire thing apart, redesign and reprint a bigger housing and fit a Mega.
That would suck.

What kind of housing is the sensor going in?

I have a 4-20ma pressure sensor I picked up on a popular auction site for £20 brand new. It has a G 1/4" cone seat connection. Without knowing your application/enclosure though its hard to say whether or not it would fit, and the required fittings will also bump the price a bit.

You may also want to prepare an analogue sensor reading program and add it to your code to make sure that you dont go over your space requirements before you throw more money at the problem. You could make a test circuit with a pot.

It can go in any housing. It is measuring the pressure of a latex bladder, so the pressure isn't all that high.
Sound like your sensor may be quite bulky and might not fit.

I have a MPS20N0040D-D Pressure sensor here that will work, but I need the HX711 chip to decode a signal out of it.
I have ordered one of those o na breakout board and hopefully that will provide me with an analogue out.

The program already is programmed ready with an analogue in on a multi-turn pot for testing.
That just needs swapping out for the sensor.

I spent hours trying to pick apart the I2C library for the BMP280 but just could not get it to fire up.
Too many bits I didn't understand.

Otherwise, I will have to return to using a microswitch again.