Page 1 of 1

I2c communication and analogue read, not working ideas??

Posted: Wed Aug 23, 2017 10:03 pm
by avi007
First of all I am new to electronics. I am using ESP32 dev kit and trying to communicate with an i2c sensor and an analogue sensor. I am able to communicate both devices. I am using freertos Task to gather output running on parallel threads on two cores of esp32. But I moticed that as the i2c commumication begins the noise in the analogue signal increase to very high level. I am completely puzzled why this is happening. Could be ghosting ? Or something that I don't know . Need your guidance on that. How to resolve this issue. Please note if i2c device is not running analogue values are read perfectly. Please help with your ideas or questions. Thanks a bunch
It could be an electromagnetic interference or a bug. If any of you have any ideas that would help me a lot.
Regards,Avi

Re: I2c communication and analogue read, not working ideas??

Posted: Thu Aug 24, 2017 2:48 am
by ESP_Sprite
How did you build your hardware? Breadboard, jumper wires, proper PCB, ..? Also, what sensors do you use and how are they mounted?

Re: I2c communication and analogue read, not working ideas??

Posted: Fri Aug 25, 2017 1:20 pm
by avi007
Thank you for your response.

Here is the configuration:

I2C Device: 3 axis accelerometer
Analog device: analog Microphone
Board: ESP32 dev kit
Arrangements: on the breadboard with jumper wires

I2C device drawing power from the ESP32 dev module, and communicating via pin via 21 and 22 (SCL, SDA).
Analog device drawing power from ESP32 as well, and communicating via pin34. (have tried multiple pins though)

Test1: I2C if off, analogue is reading perfectly no noise. Confirmed the signal values with an external Arduino also.

Test2: I2C comm. is on, analog signal has noise.

Test3: I2C is on and analogue is on both supplied power from ESP32 devkit. Kept a distance between Analog wires and sensor away from the I2C to minimize any electromagnetic interference. Analogue is showing noise.

Test4: I2C drawing power from ESP32, where as analog drawing power from an Arduino. Still similar level of noise.

And interesting test ...
Test5: I2C and analog drawing power from the ESP32 board. Arduino is also reading the same Analog signal that's being fed to ESP32. SO ESP32 and Arduino both are reading the same analog signal, but ESP32 is also working with I2C sensor. ESP32 reading from analog device have similar noise but Arduino is reading the signal without any noise. It seems there is a problem internally with ADC of ESP32.

Please let me know if this helps. Looking forward to more suggestions.

Please note I have confirmed both sensors individually works fine.


Cheers,
Avi