Page 1 of 1

Reading Multiple I2C sensors on ESP32

Posted: Tue Jun 25, 2019 12:09 am
by westech
Greetings!

Yes I am a newbee. I have a small project were I need to read the sensor data from 3 I2C sensors. a BME280 (Temp, Humidity and pressure), MPU 6050 (gyro) and a Time of Flight VL53L0X. Is it best practice for all 3 to use the same I2C pins or is it better to use different pins on the ESP32 WROOM?

My objective is to set up an AP Webserver to display the data on a tablet.

The next step once I have the hardware wired up and reporting the data, is to create a CSS to display the data on the control screen.

I'm loving the ESP32! I have 3 more coming in. One right now has a port of GRBL to control stepper motors and I'm amazed at how easy it was to control via bluetooth.

Thanks

Max

Re: Reading Multiple I2C sensors on ESP32

Posted: Wed Jun 26, 2019 9:13 am
by rodmcm
Probably the reason that no one has answered you is that there are hundreds of answers to this on a simple Google search

Re: Reading Multiple I2C sensors on ESP32

Posted: Wed Jun 26, 2019 4:16 pm
by westech
I know you can have multiple sensors over a single I2C line, But if I'm not using any other pins, is it more efficient for the ESP32 to read from separate pins? Also on the firmware side does that create any issues?

I know interrupts can be an issue if you are ready the data.

There must be a best practices if you are reading 3-4 sensors.

Re: Reading Multiple I2C sensors on ESP32

Posted: Thu Jun 27, 2019 6:38 am
by ESP_Sprite
Sooo.... what have you figured out yourself? We don't quite know what you want to do, and as a newb, it may be a lot more useful to put your reasoning for a tentative solution up, so we can either acknowledge it's a feasible solution or tell you any flaws we see with it. Things to think of: would a lack of speed be an issue? How hard is it to control devices over multiple lines? (Hint: how many I2C controllers does the ESP32 have?)