# Digi Xbee3 Cellular to Pressure Sensor with MicroPython

**URL:** <https://forum.digikey.com/t/digi-xbee3-cellular-to-pressure-sensor-with-micropython/12461>\
**Category:** Wireless and IoT\
**Tags:** digi-international, wireless-and-iot, micropython, development-boards-kits-programmers, design-tools-and-resources, documentation\
**Created:** [March 3, 2021, 9:59pm UTC](https://forum.digikey.com/t/digi-xbee3-cellular-to-pressure-sensor-with-micropython/12461 "2021-03-03T21:59:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottRaeker](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@ScottRaeker](https://forum.digikey.com/u/ScottRaeker)\
**Post date:** [March 3, 2021, 9:59pm UTC](https://forum.digikey.com/t/digi-xbee3-cellular-to-pressure-sensor-with-micropython/12461/1 "2021-03-03T21:59:33Z")

</div>

![image](https://global.discourse-cdn.com/digikey/original/2X/a/a90e379d35e86419bdf998bef749cad0083704e5.jpeg)

# Introduction

Off the shelf hardware is used to demonstrate integrating an absolute barometric pressure sensor with Digi International’s LTE-M/NB-IoT cellular smart modem. The project utilizes the XB3-C-A2-UT-001 mounted in an XBIB-U-DEV eval board wired to a Mikroelektronika Pressure 4 Click board over I2C. MicroPython example code is provided for the XBee3 smart modem to communicate with the Pressure 4 Click temperature sensor over I2C.. Mikroelektronika’s Pressure 4 Click™ board uses Bosch Sensortec’s BMP280 barometric pressure/temperature sensor.

# Hardware Requirements

- [XB3-C-A2-UT-001 Digi XBee3 LTE-M/NB-IoT Cellular Smart Modem](https://www.digikey.com/products/en?keywords=XB3-C-A2-UT-001) at Digi-Key
- [Mikroelektronika Pressure 4 Click™ board](https://www.digikey.com/products/en?keywords=MIKROE-3020) at Digi-Key

Accessories

- [Digi International XBIB-U-DEV](https://www.digikey.com/products/en?keywords=XBIB-U-DEV) eval board at Digi-Key (note: male pin headers soldered to XBIB-U-DEV board 20 pin header to facilitate wiring)

# Supplier Documentation

- Digi International [XBee3 Cellular LTE-M/NB-IoT User Guide](https://www.digi.com/resources/documentation/Digidocs/90002258/)
- Digi International [Digi MicroPython Programming Guide](https://www.digi.com/resources/documentation/digidocs/90002219/default.htm)
- Digi International [XBIB-U-DEV Reference Guide](http://ftp1.digi.com/support/documentation/xbibudev_referenceguide.pdf)
- Digi International [XBIB-U-DEV Schematic](http://ftp1.digi.com/support/documentation/55001551-02-ENG_B1.pdf)
- Mikroelektronika [Pressure 4 Click™ board](https://media.digikey.com/pdf/Data%20Sheets/MikroElektronika%20PDFs/MIKROE%E2%80%903020_Web.pdf)
- Bosch Sensortec [BMP280 datasheet](https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMP280-DS001.pdf)  
:

# Hardware Setup

**Pressure 4 Click Board**

| 1 - | 16 - |
| --- | --- |
| 2 - | 15 - |
| 3 - | 14 - |
| 4 - | 13 - |
| 5 - | 12 - SCL |
| 6 - | 11 - SDA |
| 7 - +3.3V | 10 - |
| 8 - GND | 9 - GND |

**XB3 20 pin header**

| 1 - +3.3V | 20 - |
| --- | --- |
| 2 - | 19 - SCL |
| 3 - NC | 18 - |
| 4 - NC | 17 - |
| 5 - NC | 16 - |
| 6 - NC | 15 - |
| 7 - SDA | 14 - |
| 8 - | 13 - |
| 9 - | 12 - |
| 10 - GND | 11 - |

**Wiring Diagram**

 ![](https://global.discourse-cdn.com/digikey/original/2X/0/05a9552b6bb5edbb3e77f766a1ef1947801109c3.jpeg)

 ![](https://global.discourse-cdn.com/digikey/original/2X/b/b56ee3b63ec7f02a5e736322c0e9cbed3bdc0a2d.jpeg)

# Example Code

> <https://github.com/eewiki/Xbee3-MicroPython/blob/master/samples/pressure4click.py>

**Description**

MicroPython code that runs on a Xbee 3 cellular module connected to a Pressure 4 Click board over I2C. The example code scans the I2C bus and prints active addresses, reads/prints the BMP280 chip id; writes the BMP280 data acquisition settings, reads/prints the calibration parameters and reads/prints pressure and temperature in a continuous loop.

**Bosch Sensortec BMP280 Pressure and Temperature Calculation Background**

Configuration settings and calculations used are based on section 3.12 of revision 1.19 of the [BMP280 datasheet](https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMP280-DS001.pdf). Below table is from the datasheet.

 ![](https://global.discourse-cdn.com/digikey/original/2X/7/723bac2fca78c21473635c3f214b5262ca579538.jpeg)
