Wemos ESP32 OLED Module I2C Issue

Hi,

I'm a beginner in the Arduino world and I would appreciate some help from some experienced users. I have a Wemos ESP32 OLED Module (Banggood) that I am having some trouble with.

I am trying to connect a AM2320 sensor on the I2C bus but are facing some strange issues. Internal OLED module is connected to the same bus on pin 4 and 5 as the AM2320 sensor. So far so good and data is received from the AM2320 without any problems, problem starts when I am using the integrated OLED. When OLED is in use data from the AM2320 becomes corrupted, but OLED works fine….?

Have tried the “ESP32_Wemos_I2C Scanner” and both addresses are shown on first scan but the AM2320 sensor disappears on the second scan.

Library, board version etc. is correct and have tried different settings with bus speed, but still have the same issue.

On a Arduino Uno board everything works with similar I2C display and code….

Any suggestions?

Any suggestions?

Post links to the used hardware! Post a wiring diagram and a picture of the complete setup.

My guess is that you have multiple pull-ups on the bus and the AM2320 isn't able to sink that much current. Or the wiring of the bus is too long and the signal edges aren't steep enough.

Hi,

Thank you so much for your response, appreciate that you are taking the time. Just received the ESP32 module å week ago, and it is just learning by playing at the moment. The intention is to build a weather station with external / internal measurement with logging to SD card.

I do not have a wiring diagram at the moment, but is very simple and the connection is as follows: ESP -> AM2320 Pin 5 -> SDA Pin 4 -> SCL 5V -> VDD GND -> GND

ESP 32 has from what I understood internal pullup resistors, but has also tested external with varying resistance, all tests with the same outcome. OLED and Sensor work fine separately, just not together by some unknown cause. Have tested further and is when it runs the code "display.init ();" that the AM2320 fails.

Sensor used: https://www.adafruit.com/product/3721

Board used: https://www.banggood.com/Wemos-ESP32-OLED-Module-For-Arduino-ESP32-OLED-WiFi-Bluetooth-Dual-ESP-32-ESP-32S-ESP8266-p-1148119.html?rmmds=search&cur_warehouse=CN

I do not have a wiring diagram at the moment, but is very simple and the connection is as follows:
ESP → AM2320
Pin 5 → SDA
Pin 4 → SCL
5V → VDD
GND → GND

Did you read the Adafruit documentation about the sensor?
The sensor needs a pull-up to Vdd for SDA and SCL, you might have to check with a multimeter if the board you bought does already have these pull-ups as the vendor is not supplying enough information.
Don’t power the sensor with 5V if your MCU is running on 3V3. Power it with 3V3 so the I2C signal have the same voltage on both sides.

Internal pull-up resistors is measured to be 4,67kOhm between +3,3V and SDA and SCL. No pull-ups between +5V and SDA and SCL. Have read the documentation for the Adafruit sensor.... Board seems to be ok since OLED and Sensor works fine separately. Waiting for another ESP32 board and will try the same setup there.

Thanks for all help!

I quote my second sentence:

Don't power the sensor with 5V if your MCU is running on 3V3. Power it with 3V3 so the I2C signal have the same voltage on both sides.