# Heltec Cubecell HTCC AB-01 with BMP280 sensor

**URL:** <https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716>\
**Category:** Heltec CubeCell\
**Created:** [November 28, 2020, 3:31pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716 "2020-11-28T15:31:25Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![HansES](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/hanses/32/34657_2.png) [@HansES](https://www.thethingsnetwork.org/forum/u/HansES)\
**Post date:** [November 28, 2020, 3:31pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/1 "2020-11-28T15:31:25Z")

</div>

I am experimenting with using a BMP280 I2C sensor on a Heltec Cubecell (HTCC AB-01) board, for the time being without LoRa, so simply measuring temperature and humidity.

None of the libraries I tried, like those from Adafruit and Seeed, work and generate all kinds of error messages. The BMP280 example from the Third Part Sensor Examples supplied by Heltec also does not work. This does not seems to be a serious example because CO2, lux and TVOC are also used, nonsense for a BMP280 that can only measure temperature and humidity.

Hence my question: does anyone have a working BMP280 sketch for this board?

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [November 28, 2020, 4:51pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/2 "2020-11-28T16:51:16Z")

</div>

> [@HansES](#):
>
> None of the libraries I tried, like those from Adafruit and Seeed, work and generate all kinds of error messages.

That’s not very meaningful.

Adafruit’s code for example is valid in the context it was meant to be used on, likely it would need some tuning to your board (and de-Arduinoification if you are not using an Arduino approach). Bosch themselves also publish a solution at [GitHub - boschsensortec/BME280\_SensorAPI: Bosch Sensortec BME280 sensor driver. To report issues, go to https://community.bosch-sensortec.com/t5/Bosch-Sensortec-Community/ct-p/bst\_community](https://github.com/BoschSensortec/BME280_driver) which is more generic C - you need to provide function pointers to SPI or I2C routines of the sort the desire.

Essentially, you need to work through the error messages, understand what they mean, and correct their causes in terms of project setup, chip specific I/O detail, etc one at a time.

---

<div class="post-metadata">

**Author:** ![HansES](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/hanses/32/34657_2.png) [@HansES](https://www.thethingsnetwork.org/forum/u/HansES)\
**Post date:** [November 28, 2020, 5:43pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/3 "2020-11-28T17:43:46Z")

</div>

Thank you for your response. You’re asking me to reinvent the wheel but I think we have a forum for that.

Obviously I have already done the necessary tests and adjustments so as not to tire you with pointless questions. Unfortunately without success, it was not without a reason that I asked for a working sketch.

But here are the most relevant results (BMP280 I2C sensor, default address 0x76)

_Lib: Adafruit\_BMP280.h / sketch: bmp280\_sensortest_  
_compiles without error but no sensor found_

_Lib: Adafruit\_BMP280.h / sketch: bmp280test_  
_compiles without error but no sensor found_

_Lib Seeed\_BMP280.h / sketch: bmp280\_example_  
_compiles without error but no serial output_

_Lib: BMx280I2C.h / sketch: BMx280\_I2C_  
_does not compile, error “wire\_ = nullptr;”_

Surely someone will use this sensor with the HTCC AB01 board?

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [November 28, 2020, 5:44pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/4 "2020-11-28T17:44:55Z")

</div>

> But here are the most relevant results (BMP280 I2C sensor I2C address 0x76)

Each of those are situations which can be investigated and resolved.

Eg, with the things that run, one of the first tests you should do is to see if there’s any electrical activity on the I2C bus. With those that don’t compile, you need to take time to understand what the compiler’s complaint is.

Just jumping from codebase to codebase isn’t effective on a level of more than random chance

---

<div class="post-metadata">

**Author:** ![HansES](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/hanses/32/34657_2.png) [@HansES](https://www.thethingsnetwork.org/forum/u/HansES)\
**Post date:** [November 28, 2020, 5:55pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/5 "2020-11-28T17:55:01Z")

</div>

Thanks for your advice cslorabox.

Anyone having a solution?

---

<div class="post-metadata">

**Author:** ![TonySmith](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tonysmith/32/46334_2.png) [@TonySmith](https://www.thethingsnetwork.org/forum/u/TonySmith)\
**Post date:** [November 28, 2020, 7:25pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/6 "2020-11-28T19:25:41Z")

</div>

> [@HansES](#):
>
> BMP280 that can only measure temperature and humidity.

I would start by checking the part number of the sensor and compare to the sketch.  
The **BMP280** is a Pressure and Temperature Sensor  
The BME280 is a Pressure, Temperature and Humidity Sensor.

In your original post you mention Humidity but the BMP280 does not measure that.  
You may have the wrong sketch for the sensor.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [November 28, 2020, 8:26pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/7 "2020-11-28T20:26:25Z")

</div>

And I’d also Google for an I2C scanner sketch / code / C to check that there is in fact a device on the I2C bus and what address it is at.

---

<div class="post-metadata">

**Author:** ![AndyG](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/andyg/32/35697_2.png) [@AndyG](https://www.thethingsnetwork.org/forum/u/AndyG)\
**Post date:** [November 28, 2020, 8:35pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/8 "2020-11-28T20:35:30Z")

</div>

Heltec provide two I2C scanners in their examples. There is a basic i2c\_scan which lists the device addresses on the I2C bus. There is also a multi sensor auto recognise example which gives more information about the devices found.

I have a Heltec AB-01 with an Adafruit BME280 sensor module. I based my code on one of the Heltec low power examples, and use the Seeed BME280 sensor library.

---

<div class="post-metadata">

**Author:** ![TonySmith](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tonysmith/32/46334_2.png) [@TonySmith](https://www.thethingsnetwork.org/forum/u/TonySmith)\
**Post date:** [November 28, 2020, 9:18pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/9 "2020-11-28T21:18:46Z")

</div>

Either before testing with a I2C scanner or after if you can’t a sensor check there are pull-up resistors on the I2C lines?

Since a few sketches did not find a sensor at 0x76 its likely there is some other problem.

The HTCC AB-01 has resistors R23 and R25 for this but looking at the schematic they look unpopulated. You may find there are no resistors on the sensor board as well.

---

<div class="post-metadata">

**Author:** ![HansES](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/hanses/32/34657_2.png) [@HansES](https://www.thethingsnetwork.org/forum/u/HansES)\
**Post date:** [November 29, 2020, 8:50am UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/10 "2020-11-29T08:50:42Z")

</div>

Thank you all for all the information. With your help I can now continue (as soon as I have the time) and I will post the results here.

@TonySmith You’re right Tony I was wrong in the posting above. It is a BMP280 so it measures temperature and air pressure but not humidity.

Thanks again!

---

<div class="post-metadata">

**Author:** ![HansES](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/hanses/32/34657_2.png) [@HansES](https://www.thethingsnetwork.org/forum/u/HansES)\
**Post date:** [November 29, 2020, 12:37pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/11 "2020-11-29T12:37:09Z")

</div>

The sensor is now working. As AndyG wrote the Heltec multisensor auto recognize sketch works, also in my setup. The scanner found the I2C address of the BMP280 namely 0x76.

Seeed’s BMP280 library didn’t work, I could compile but the serial monitor didn’t give any output. Unfortunately not even error messages.

It turned out that the Seeed library only uses the address 0x77, it cannot automatically switch to 0x76. After I set the default address to 0x76 in the library it worked as it should.

I am happy and hope that others will benefit from this information. Thank you all for your help!

---

<div class="post-metadata">

**Author:** ![Dave\_Wal](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/dave_wal/32/35697_2.png) [@Dave\_Wal](https://www.thethingsnetwork.org/forum/u/Dave_Wal)\
**Post date:** [December 2, 2020, 8:48pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/12 "2020-12-02T20:48:19Z")

</div>

Hans

This seems normal for I2C devices. I2C address space is limited and not assigned by a central co-ordinator so conflicts will occur.  
The physical device has a few address options and the actual board will often have a default jumper. The Libraries use the default for the particular breakout board and alternatives can be set by using the alternate address in the begin() function call.

References:  
Adafruit [https://learn.adafruit.com/i2c-addresses](https://learn.adafruit.com/i2c-addresses)  
Address list [https://i2cdevices.org/addresses](https://i2cdevices.org/addresses)  
Seeed [https://wiki.seeedstudio.com/Grove-Barometer\_Sensor-BMP280/](https://wiki.seeedstudio.com/Grove-Barometer_Sensor-BMP280/) (shows the jumpers)

---

<div class="post-metadata">

**Author:** ![HansES](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/hanses/32/34657_2.png) [@HansES](https://www.thethingsnetwork.org/forum/u/HansES)\
**Post date:** [December 3, 2020, 9:09am UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/13 "2020-12-03T09:09:03Z")

</div>

Thank you for your message. I know that I2C sensors work on different addresses but was surprised that the library did not provide an error when the address is incorrect. That’s why it took me a while to figure out what was wrong.

---

<div class="post-metadata">

**Author:** ![Dave\_Wal](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/dave_wal/32/35697_2.png) [@Dave\_Wal](https://www.thethingsnetwork.org/forum/u/Dave_Wal)\
**Post date:** [December 3, 2020, 7:37pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/14 "2020-12-03T19:37:35Z")

</div>

We’re probably getting off the TTN topic, but the begin() call should return FALSE and your code (or the example you used) should check that.  
Dave

---

<div class="post-metadata">

**Author:** ![jezd](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jezd/32/46461_2.png) [@jezd](https://www.thethingsnetwork.org/forum/u/jezd)\
**Post date:** [December 3, 2020, 8:35pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/15 "2020-12-03T20:35:43Z")

</div>

Always worth running the I2C scanner code first I think - just to check addresses

---

<div class="post-metadata">

**Author:** ![MOS-FET](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/mos-fet/32/35697_2.png) [@MOS-FET](https://www.thethingsnetwork.org/forum/u/MOS-FET)\
**Post date:** [December 4, 2020, 12:32pm UTC](https://www.thethingsnetwork.org/forum/t/heltec-cubecell-htcc-ab-01-with-bmp280-sensor/41716/16 "2020-12-04T12:32:32Z")

</div>

Yes do not bme from use sht3x or sht4x from sensirion
