A BMP390 does not measure altitude directly. It measures pressure, and the software converts the ratio between that reading and a configured sea-level pressure into meters. If altitude drifts while raw pressure remains plausible, check the reference value before replacing the sensor.
Featured image: Adafruit.
The Adafruit CircuitPython BMP3XX driver uses altitude = 44307.7 × [1 − (pressure / sea_level_pressure)^0.190284]. Both pressure values are in hPa, so the calculation is a ratio before it becomes a height.
The same 1000 hPa reading can produce different heights
With sensor pressure fixed at 1000 hPa, a 1013.25 hPa reference produces about 110.8 m. Change only the reference to 1010 hPa and the result falls to about 83.8 m. Set it to 1020 hPa and the result rises to about 166.6 m. The sensor reading did not change; the assumed pressure at sea level did.
That is why the default 1013.25 hPa is a baseline, not a permanent local calibration. The Adafruit guide tells users to set bmp.sea_level_pressure from the local weather value for the location and day. A passing weather system can otherwise appear as a change in altitude.

Keep pressure, reference and altitude in the same log
Log three values together: raw pressure in hPa, the sea-level reference in hPa and the calculated altitude in meters. If altitude moves because the reference was updated, the record makes that cause explicit. If raw pressure moves while the reference stays fixed, the change may be weather, real elevation, airflow or a mechanical pressure disturbance.
Unit errors create larger failures. CircuitPython reports pressure in hPa. The Arduino guide notes that its underlying pressure value is in pascals and divides by 100 for hPa. Feeding 100000 Pa into an equation expecting about 1000 hPa destroys the pressure ratio even though both numbers describe the same atmosphere.

Absolute altitude and relative movement need different references
For an absolute estimate above sea level, update the sea-level pressure from a nearby, representative weather source and keep the timestamp. For relative motion over a short interval, a fixed reference can be more useful because changing the reference during the run inserts a step into the calculated height.
The Bosch datasheet revision 1.7 specifies typical relative pressure accuracy of ±3 Pa—about ±0.25 m—over 700–1100 hPa and 25–40°C. That component figure does not cancel weather, enclosure pressure, airflow or a stale sea-level reference.
Discard the first reading, then separate noise from offset
Adafruit warns that the first reading may be inaccurate and recommends discarding it. After that, diagnose two patterns separately. Fast sample-to-sample variation calls for checking oversampling, filtering, airflow and mounting. A stable but consistently wrong altitude calls for checking the reference pressure, units and known site elevation.
Preserve the raw pressure even if the application displays only altitude. A rounded height without its pressure and reference cannot show whether a later change came from the sensor, the atmosphere or the calculation.

