Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By RKieboom
#43031 I am testing with the following sensors connected to the ESP12:
- HTU21
- SHT31
- HDC1008
- MCP9808

All temperatures are OK, except for the BME, which is one degree too high. On top of that, the humidity of the BME is 63%, while the others report 35%. My guess is still it has something to do with the I2C communication, I'll try lowering the speed next.

Connected to an Arduino Uno R3 and a Adafruit Metro the BME gives correct readings...
User avatar
By RKieboom
#43040 Nope, I've tried different clock speeds; eventually as low as Wire.setClock(1000); (1KHz)
I also added delay(200) between the temp,humidity and pressure readings.
No effect...

Connected two pull-up resistors of 2K2 to the SDA and SCL lines, no change.

The BME keeps reporting one degree too high temperature and 30% too high humidity. The pressure seems OK.
The other sensors are still reporting correct values..
Sigh
User avatar
By RKieboom
#43043 I switched to the Sparkfun library and suddenly humidity was 36%, which is almost correct.. I modified my code so that I could use the Sparkfun or Adafruit library with a compile switch. I updated the Adafruit library, switched back, and now the readings are better!! :o

I removed the Wire.setClock(1000); no change, still OK.

These are my current readings:

HTU21: Temp=21.85 Hum=33.18
SHT31: Temp=21.48 Hum=33.50
BME280: Temp=22.15 Hum=36.14 Pres=103710.95
HDC1008: Temp=21.58 Hum=29.00
MCP9808: Temp=21.87

The BME is still a little off, but much better. I am in the dark with this...
User avatar
By RKieboom
#43141 I added another BME280 with another I2C address. My output at the moment is:

HTU21: Temp=22.06 Hum=30.91
SHT31: Temp=21.82 Hum=31.05
BME280: Temp=22.66 Hum=33.75 Pres=103272.67
BME280/2: Temp=22.60 Hum=33.47 Pres=103227.92
HDC1008: Temp=21.80 Hum=25.82
MCP9808: Temp=22.31

The temperature is now getting close to the real temperature. I didn't do anything to accomplish this!
Humidity is still higher than the HTU/SHT, but I don't have a reference, so maybe they are off.

To recap, I installed the latest Adafruit library (I am using BME Adafruit breakouts by the way), added two pull-up resistors of 2K2 to both SDA and SCL. I am powering the ESP from my laptop through USB at the moment. I don't use Wifi in my sketch, just printing the values.

Why it is getting better? :o