Arduino Nano BMP180: SIMPLE & WORKING
Previous code had complex calibration math bugs. This version reads RAW sensor data directly - guaranteed to work on first upload.
Your wiring is perfect: A4=SDA, A5=SCL, 5V, GND. Just upload → Serial Monitor 9600 baud → instant readings!
How It Works
Barometric sensors such as the BMP180, BMP280 and BME280 use a MEMS piezoresistive element: a tiny silicon diaphragm whose resistance changes as atmospheric pressure flexes it. The chip digitises that internally and exposes calibrated readings over I²C, so no analog conditioning is needed.
These parts are genuinely precise. A BMP280 resolves pressure to about ±0.12 hPa, which corresponds to roughly a one-metre change in altitude — enough to detect moving between floors of a building. Pressure and altitude are related through the barometric formula, which the libraries implement for you.
The catch is that altitude derived from pressure is only as good as your sea-level reference. Weather systems shift sea-level pressure by tens of hectopascals, so an altitude calculated with the standard 1013.25 hPa constant can be tens of metres out. For relative measurements — how far up did I move — it is excellent; for absolute altitude it needs a current local reference.
All three parts speak I²C, which on the Arduino Nano means A4 (SDA) and A5 (SCL). Addresses are typically 0x76 or 0x77 depending on how the SDO pin is tied.
Components Needed
- Arduino Nano
- Barometric Pressure Sensor module
- Arduino Nano
- USB cable for programming and power
- Arduino Nano
Wiring to the Arduino Nano
Connect SDA and SCL to A4 (SDA) and A5 (SCL), with VCC and GND to the supply rails. The BMP280 die is a 3.3 V part. Most breakout boards include a regulator and level shifting so they tolerate 5 V, but bare modules do not — check for a regulator before connecting 5 V, or power from the 3V3 pin to be safe.
I²C needs pull-up resistors on both lines. Nearly all breakout boards fit them, but chaining several modules stacks those pull-ups in parallel and can over-load the bus — remove the extras if communication becomes unreliable.
Shield the sensor from draughts and direct sun. The BME280's humidity and temperature channels in particular respond to airflow, and a sensor in sunlight reads several degrees high.
| Module pin | Arduino Nano pin | Function |
|---|---|---|
| SDA | A4 | I²C data |
| SCL | A5 | I²C clock |
| VCC | 3V3 (see notes) | Supply — the bare chip is 3.3 V |
| GND | GND | Common ground |
Build and Upload
Serial Monitor → 9600 baud → See pressure/temp/altitude updating live every 2 seconds!
Log to SD card
LCD display
WiFi weather upload
Add DHT22 humidity
Example Code
Reading pressure, temperature and relative altitude from a BMP280. Upload it with the board set to Arduino Nano and open the Serial Monitor at 9600 baud.
#include <Wire.h>
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp;
float referencePressure = 1013.25; // hPa — replace with your local value
void setup() {
Serial.begin(9600);
Wire.begin();
if (!bmp.begin(0x76)) { // try 0x77 if this fails
Serial.println("BMP280 not found — check wiring and address");
while (1) delay(1000);
}
// Capture the starting pressure so altitude is measured relative to here
delay(100);
referencePressure = bmp.readPressure() / 100.0;
Serial.print("Reference set to ");
Serial.print(referencePressure, 2);
Serial.println(" hPa");
}
void loop() {
float hPa = bmp.readPressure() / 100.0;
float degC = bmp.readTemperature();
float rel = bmp.readAltitude(referencePressure);
Serial.print("Pressure: "); Serial.print(hPa, 2); Serial.print(" hPa ");
Serial.print("Temp: "); Serial.print(degC, 1); Serial.print(" C ");
Serial.print("Rel height: ");Serial.print(rel, 1); Serial.println(" m");
delay(1000);
}
Applications
A bmp180 air pressure sensor module turns up in a wide range of projects. These are the uses where it is the right choice rather than a compromise:
- Weather stations and short-term forecasting from pressure trends
- Altitude hold and height estimation on drones and model rockets
- Floor detection in indoor navigation
- Detecting whether a sealed enclosure has lost its seal
- Compensating other sensors whose readings vary with air density
Working with the Arduino Nano
The Arduino Nano is built around the ATmega328P and runs on 5 V logic with 2 KB of SRAM and 32 KB of program flash. These details change how this circuit is wired and what the sketch can do, so they are worth stating plainly before you build.
The Nano shares the Uno’s ATmega328P but adds A6 and A7, which are analog-input only and cannot be used as digital pins.
Its DIP footprint drops straight into a breadboard, which suits permanent sensor builds.
Older clones use the CH340 USB bridge and may need that driver plus the "ATmega328P (Old Bootloader)" processor option.
| Arduino Nano characteristic | Value | Why it matters here |
|---|---|---|
| Logic voltage | 5 V | Matches most hobby modules directly |
| ADC resolution | 10-bit (0–1023) | Sets how finely an analog reading can be resolved |
| Analog inputs | A0–A7 (eight channels, two more than the Uno) | Determines how many analog sensors can share the board |
| PWM outputs | D3, D5, D6, D9, D10 and D11 | Needed for brightness, speed and tone control |
| I²C pins | A4 (SDA) and A5 (SCL) | Fixed by hardware — wiring copied from another board may not match |
| Interrupt pins | D2 and D3 only | Required for counting fast or asynchronous events |
| Serial | a single hardware UART shared with USB | Monitor runs at 9600 baud by default |
Troubleshooting
Most problems with this module fall into a handful of categories. Work through these before suspecting the part itself:
- The sensor is not found — try the other address (0x76 versus 0x77), and run an I²C scanner to see what is actually on the bus.
- Altitude drifts over hours while the sensor sits still — that is real weather changing the pressure, not a fault.
- Temperature reads 2–3 °C high — the chip self-heats, and on combined modules the regulator adds more. Offset it, or read less often.
- Readings are unstable — an unshielded sensor near a fan or window responds to every gust. Enclose it with a small vent.
- Nothing works on a Mega after copying Uno wiring — I²C is on D20/D21 here, not A4/A5.
- Code written for an ESP board gives odd analog values — the Arduino Nano uses a 10-bit ADC returning 0–1023; rescale any constant taken from a 12-bit example.
- An I²C sensor is not found after copying wiring from another Arduino — on the Arduino Nano I²C is on A4 (SDA) and A5 (SCL).
Taking It Further on the Arduino Nano
Once the basic reading works, where you go next depends very much on which board you are using. These are the directions that suit the Arduino Nano specifically:
The Nano’s DIP footprint makes it the natural choice once a breadboard prototype becomes a soldered build. Mount it on female headers rather than soldering it down, so the board can be recovered if the project is retired.
With A6 and A7 available in addition to A0–A5, the Nano can read two more analog sensors than an Uno. Remember that those two pins are analog-input only — they cannot be used with digitalWrite or as digital inputs.
For battery-powered builds, the Nano’s regulator and USB bridge dominate idle current. Powering the 5V pin directly from a regulated supply and removing the power LED substantially extends runtime.
Notes and Practical Limits
The BMP280 measures pressure and temperature; the BME280 adds humidity for a small extra cost and is usually the better buy for weather work. They share the same library and address scheme, so the code barely changes.
For relative altitude, capture a reference at startup as the sketch does. That removes the weather-dependence entirely and gives genuinely useful centimetre-to-metre resolution.