Arduino UNO Q - MS5611 Pressure Sensor
Before a storm comes, the air pressure often falls for some hours. The sky may still be blue, and you feel nothing. An MS5611 pressure sensor notices it, because it can measure even very small pressure changes. On this page, you turn the Arduino UNO Q into a storm watcher. The STM32 MCU reads the sensor once per second. The Linux side remembers the last 3 hours and writes to you on Telegram when the pressure falls too fast.
What you will do, step by step:
- Get to know the MS5611 (GY-63) module: what it measures, its limits and its 7 pins
- Connect it to the Arduino UNO Q with four wires, at 3.3V
- Print pressure, temperature and altitude with a short sketch for the MCU
- Share the values with Python on the Linux side through Bridge
- Let Python keep one reading per minute and look for a fall of 3 hPa within 3 hours
- Get one Telegram alert per storm, and ask the bot for the pressure at any time
- Use OpenClaw on Arduino UNO Q with the MS5611

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of the MS5611 Pressure Sensor
The DIYables GY-63 module carries the MS5611-01BA03, an air pressure chip from TE Connectivity. You may also meet it under the names barometer, barometric pressure sensor, altimeter or altitude sensor. It works in air only, so it is not the right part for water pressure or car tires.
How it works. The shiny metal can hides a very thin plate of silicon, called a membrane. When the air pushes harder, the plate bends a little more. The chip measures this bend with a 24-bit converter. It also measures its own temperature, because the pressure value must be corrected with it.
What changes the air pressure? Two things:
- The weather. The pressure of one place goes up and down from day to day. This is what our storm watcher uses.
- The height. Higher up there is less air above us. Near sea level, every metre up takes away about 0.12 hPa (1 hPa = about 8.3 m). So the same sensor can also tell the altitude.
The unit is hPa (hectopascal). Weather reports often write mbar, and it is the same number. The standard pressure at sea level is 1013.25 hPa.
| Property | MS5611 (GY-63) module |
|---|---|
| Smallest pressure change (resolution) | 0.012 hPa, about 10 cm of height |
| Pressure accuracy | ±1.5 hPa at 25 °C, between 700 and 1100 hPa |
| Measuring range | 10 to 1200 hPa, with full accuracy between 450 and 1100 hPa |
| Working temperature | -40 to 85 °C |
| Accuracy of the temperature | ±0.8 °C (at 25 °C) |
| Speed | one pressure conversion takes about 9 ms at the best resolution |
| Bus | I2C up to 400 kHz (this is the default), or SPI |
| Address on the I2C bus | 0x77, or 0x76 when CSB is at 3.3V |
| Power | 3.3V to 5V, a 3.3V regulator is on the module |
| Size | about 19 mm x 13 mm |
Compare two rows: the resolution is 0.012 hPa, but the accuracy is ±1.5 hPa. So the number on the screen may be about 1 hPa off, but it follows every small change. For a storm watcher, only the change counts. The bot subtracts two readings of the same sensor, and a fixed error drops out. (Weather reports give the pressure for the sea level. If you live higher, your sensor shows less, and this is normal.)

Four of the seven pins do all the work on this page:
- VCC: power. Connect it to 3.3V of the Arduino UNO Q
- GND: ground, 0V
- SCL: the clock line of I2C
- SDA: the data line of I2C
The other three stay empty:
- CSB: sets the I2C address. Leave it empty (or tie it to GND) for 0x77, tie it to 3.3V for 0x76. So two modules can share one bus. SPI uses this pin as chip select
- SDO: data out in SPI mode. I2C does not use it
- PS: chooses between I2C and SPI. The module pulls it HIGH with a resistor, so I2C is already chosen. GND would choose SPI
Both CSB and PS belong to the 3.3V chip. Should one of them need a HIGH level one day, use 3.3V and never 5V.
What does the pressure say about the weather? A simple rule of thumb:
| The pressure is | What often comes next |
|---|---|
| rising steadily, or high | fair weather |
| falling | clouds, wind or rain |
| falling 3 hPa or more in 3 hours | a strong weather change |
The last row is the rule that the Telegram bot checks.
※ NOTE THAT:
Where to put the sensor. A normal room is fine, because the pressure in a house follows the pressure outside. Sunlight and wind spoil the reading, so choose a shady corner, away from fans and open windows. A bit of open foam (air must pass through it) on top of the metal can keeps the wind off. The can has two small holes: never close them, and keep them dry.
Wiring Diagram
Four wires are enough. You need no extra resistors: the module has its own pull-up resistors on SCL and SDA.

This image is created using Fritzing. Click to enlarge image
| MS5611 Pin | Arduino UNO Q MCU |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SCL | SCL |
| SDA | SDA |
| CSB, SDO, PS | leave empty |
※ NOTE THAT:
VCC goes to 3.3V, not to 5V. The module accepts 5V, but its SCL and SDA lines follow VCC: with 5V on VCC, it pulls both lines up to 5V. The MCU pins of the Arduino UNO Q work at 3.3V, so 3.3V is the right choice.
SCL and SDA are the two pins at the end of the digital header, next to AREF. In the diagram, the 3.3V pin has the tag 3V3.
A storm watcher runs for weeks, and one loose wire would stop it. Two shields help here: the Proto Screw Terminal Block Shield and the Screw Shield V2. Plug one of them onto the Arduino UNO Q and clamp the power wires under screws. The pins are the same as before.

This image is created using Fritzing. Click to enlarge image
Look at the upper left part of this diagram: on the Screw Shield V2, SDA and SCL have no screw terminals. Push these two wires into the SDA and SCL header holes of the shield, as the diagram shows. Only 3.3V and GND go under screws.
How To Program For MS5611
The MS5611 library by Rob Tillaart talks to the sensor and does the pressure math. Your sketch only opens the I2C bus for it.
- Include both libraries and create the sensor. 0x77 is its address (tie CSB to 3.3V and it is 0x76):
- In setup(), Wire.begin() comes first. begin() then returns false when no sensor answers at this address:
- Set the oversampling. The default is fast but noisy (0.065 hPa). With OSR_ULTRA_HIGH, the noise is only 0.012 hPa:
- Take a reading. It needs about 20 ms. When it is good, get the values:
- For the altitude, write the present sea-level pressure of your area (from a weather website) in the brackets:
- Want a steadier pressure? Let it go only one tenth of the way to each new reading:
Arduino UNO Q Code
Start with the sensor alone, without Linux and without Telegram:
- The STM32 MCU owns the SDA and SCL pins, so it reads the MS5611
- The Qualcomm MPU with Debian Linux has nothing to do yet. Its turn comes in the Bridge section
- The sketch prints pressure, temperature and altitude about once per second
Detailed Instructions
New to this board? Prepare Arduino App Lab with Getting Started with Arduino UNO Q.
- Check the wires: VCC to 3.3V, GND to GND, SCL to SCL, SDA to SDA.
- Connect the Arduino UNO Q to the computer with the USB-C cable.
- Open Arduino App Lab and wait until it shows your board.
- Create an App: Click Create New App.

- Give it the name MS5611Pressure and click Create.

- Paste the sketch: Open sketch/sketch.ino, remove everything in it, and paste the code above.
- Add the library: Its name is just MS5611, its author is Rob Tillaart. MS5611_SPI and similar names are different libraries.
- Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.

- Search for MS5611 created by Rob Tillaart
and click the Install button.
- Run: Click the Run button.

- Lift it: Leave the board on the table for a few lines. Then lift it about 2 m up, with the sensor on it, and put it back.
App Lab Console Output
Two metres up, the pressure is about 0.24 hPa lower, and the altitude is 2 m higher. If you see this, the sensor works.
If a Number Looks Wrong
- The altitude is wrong by some metres. The sketch uses 1013.25 hPa for the sea level, but the real value changes every day. Each hPa of difference moves the altitude by about 8.3 m. Look for the sea-level pressure of your area (QNH) on a weather website or in an airport report, and write it into SEA_LEVEL_HPA.
- "MS5611 not found", but the wires are right. Your module may use the other address. Try 0x76 in the line MS5611 ms5611(0x77);.
- All values are nonsense. Look at the print on the module. A BMP280, BME280 or BMP180 has the same address, and begin() may accept it. This library cannot read these chips.
- The pressure is about 500 hPa. Some modules carry a MS5607 chip. Add ms5611.reset(1); right after a successful begin(), in both sketches of this page.
- The temperature is 1 to 3 °C too high. This is the temperature of the chip, and the board warms it a bit. It is there to correct the pressure. For the room, use a DHT22.
- The pressure jumps. Wind or a fan blows on the module. Move it to a calm place, or use the foam.
Bridge: Linux + MCU
The sensor hangs on the I2C pins of the MCU, so Linux cannot reach it. But Wi-Fi and Telegram belong to the Linux side. Bridge connects the two halves:
- The MCU reads once per second and keeps the latest values. The sketch smooths the pressure and the altitude. One short gust of wind then changes very little
- Four read-only values are offered with Bridge.provide():
- get_pressure - the pressure in hPa, like 1012.46
- get_temperature - the chip temperature in °C, like 24.9
- get_altitude - the altitude in m, like 6.6
- get_status - one status, see the table below
- Python asks with Bridge.call(). It gets the last value at once and never waits for the sensor
- No restart needed: as long as the sensor is missing, the MCU looks for it again every second
- Reserved: /dev/ttyHS1 on Linux and Serial1 on the MCU belong to the Arduino router. Never open them in your own code
| Status | Meaning | What to do |
|---|---|---|
| STARTING | no reading yet | wait a second or two |
| OK | the values are fresh | nothing |
| NOT FOUND | no sensor answers at the address of the sketch | check the four wires and the address |
| NO ANSWER | the sensor worked before, then went silent | look for a loose wire |
Never used Bridge? Arduino UNO Q - Communication Between Linux and MCU explains the basics.
MCU Code (Bridge)
Python Code (Bridge)
This script asks for the values every 10 seconds. It also shows how far the pressure has moved since the App was started.
Detailed Instructions
- Second App: Create a new App in Arduino App Lab and call it StormWatcher.
- MCU part: Paste the MCU code into sketch/sketch.ino and add two libraries:
- Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.

- Search for MS5611 created by Rob Tillaart
and click the Install button.
- Search for Arduino_RouterBridge created by Arduino and click the Install button.
- Linux part: Put the Python code into the Python file of this App.
- Run the App and leave it alone for an hour or two.
App Lab Console Output
Only a few of the lines are shown. The pressure went down by 1.69 hPa in two hours, so clouds or rain may come, but it is not a storm alert yet. Look at the altitude too: it "climbed" 14 m, but the board never left the table. That was the weather. For this reason, the storm watcher works with the pressure and not with the altitude.
Telegram
Nobody wants to watch a console all day. The bot does it for you. It answers three commands, and it writes by itself when the pressure falls too fast.
| Command | Answer |
|---|---|
| /pressure | the air pressure now, in hPa |
| /temperature | the temperature of the sensor chip, in °C |
| /status | the pressure, the fall in the last 3 hours and the state of the alert |
How the bot decides:
- Once per minute it stores a pair in a small list: the time and the pressure. Pairs older than 3 hours are thrown away, so the list has at most about 180 entries
- Fall = the highest pressure in the list minus the newest one
- A fall of 3.0 hPa or more sends the alert. After that the bot stays quiet, even if the pressure keeps falling. One storm, one alert
- When the fall gets smaller than 1.0 hPa, the event is over. The pressure has gone up again, or it has been steady for a long time. The bot sends a short message, and the alert is ready for the next storm
Here is one afternoon in numbers. The last two columns show what the bot computes and does:
| Time after start | Pressure now | Highest of the last 3 hours | Fall | Bot |
|---|---|---|---|---|
| 1 hour | 1012.30 | 1012.42 | 0.12 | quiet |
| 2 hours | 1011.60 | 1012.42 | 0.82 | quiet |
| 3 hours | 1010.50 | 1012.42 | 1.92 | quiet |
| 3 h 44 min | 1009.33 | 1012.33 | 3.00 | sends the alert |
| 5 h 30 min | 1006.61 | 1011.05 | 4.44 | quiet, the alert was sent already |
| 7 h 13 min | 1007.51 | 1008.50 | 0.99 | event over, ready again |
MCU sketch: It is the same sketch as in the Bridge section. Do not change it.
Python Code (Telegram)
Detailed Instructions
- Make a bot: Get a token from @BotFather and find your chat ID. Both are explained in How to Create a Telegram Bot.
- Open the StormWatcher App and replace its Python code with the bot script.
- Fill in TELEGRAM_BOT_TOKEN and CHAT_ID. The alerts go to this chat.
- Run the App and send /pressure to your bot.
- Test without a storm: Set STORM_FALL = 0.15, CALM_FALL = 0.05 and SAMPLE_SECONDS = 5, and run again. Leave the board on the floor for one minute. Then hold it about 2 m up for half a minute: the bot sends the alert. Put it back on the floor: the bot says that the event is over.
- Put back the numbers 3.0, 1.0 and 60 after the test.
App Lab Console Output
ArduinoBot
The alert came at 16:25, when the fall reached 3.0 hPa. The pressure kept going down for two more hours, but there was no second alert.
※ NOTE THAT:
- Do not move the board while the bot runs. Three storeys up is about 9 m, and this already looks like a fall of 1 hPa.
- The list lives in memory. After a restart of the App, the bot starts with an empty list.
- This is a hobby project. In dangerous weather, follow the official warnings.
OpenClaw
You can adapt the OpenClaw to this tutorial by refering the instruction on Arduino Uno Q - OpenClaw Tutorial
Project Ideas
More things to do with a barometer that has Linux and Wi-Fi next to it:
- Barometer on the Wall: Show the pressure and an arrow (up, steady, down) on an OLED display. Python computes the arrow and sends it to the MCU.
- Pressure Diary: Python saves one line per hour to a CSV file and draws the curve of the week.
- Elevator Meter: Save the pressure of the ground floor in a variable. Then getAltitude() with this variable tells how high the elevator has gone.
- Fishing Helper: The bot sends the pressure and its change every morning at 5 o'clock, before you leave.
- Window Closer: On a storm alert, Python asks the MCU to switch a relay, and a motor closes the roof window.
Challenge Yourself
Three tasks, from small to big:
- Easy: Add the pressure in mmHg to the first sketch (1 hPa = 0.750062 mmHg).
- Medium: Save the list of readings in a file on the Linux side, so a restart of the App does not empty it. Tip: use time.time() then, because time.monotonic() starts again after a reboot.
- Advanced: Weather reports give the pressure for the sea level. Add a Bridge value get_sea_level that uses getSeaLevelPressure(pressure, 120), where 120 is the altitude of your home in metres, add a /sealevel command, and compare its answer with the nearest weather station.