[ESP-WROOM-32]Mainly, How to communicate with I2C sensor requiring higher current than GPIO can flow.

omomom
Posts: 3
Joined: Wed Feb 06, 2019 6:27 am

[ESP-WROOM-32]Mainly, How to communicate with I2C sensor requiring higher current than GPIO can flow.

Postby omomom » Wed Feb 06, 2019 7:14 am

Hi.
I am a beginner about embeded system.
I use ESPr developper 32 development board of ESP-WROOM-32.
The development framework is ESP - IDF (v3.1.2).

I would like to connect this board to the SCD 30 (sensirion) sensor via I2C, and send sensor data to AWSIoT.

Please ask you some questions about following topics.

● Electrical characteristics
As shown in fig 1(source: https://media.digikey.com/pdf/Data%20Sh ... eet_D1.pdf), this sensor requires up to 75 mA.
However, As shown in fig 2(source: https://www.espressif.com/sites/default ... eet_en.pdf), I read that the source current can only flow up to 40 mA from the GPIO pin.
Question:
· Did I get that right?? If so, what can I do so that I make sure that there is no problem from the hardware point of view?
I am ignorant about electronic circuits, so I do not know what to do.

●clock stretch
As shown in fig 3(Source: https://media.digikey.com/pdf/Data%20Sh ... eet_D1.pdf), the master device connected to the SCD 30 must support clock stretching.
(Usually 12 msec / 150 msec once per week)
Question:
· When looking at fig4(source: https://www.espressif.com/sites/default ... eet_en.pdf), it can be read that ESP32 support up to (maximum value that can be written to this register)/(APB clock frequency = 80 MHz?)=13 msec. Did I get that right??

●sending data to AWSIoT
The sample code that keeps sending character strings to AWSIoT that comes with ESP-IDF is working fine.
I am trying to exploit the parallel processing of FreeRTOS in order to run both the function of sending the data and the function of acquiring the sensor information by I2C on the assumption that the above two topics could be solved.
Question:
· Is there anything to be aware of when implementing parallel processing using the dual core?
· Is there any electrical problem that you are worried about moving both WiFi module and I2C?

There may also be other problems that I have not noticed on my own.

In short, I want you to tell me as many hints as possible to make SCD 30 work with ESPr developper 32.
I am sorry including questions out of hardware.
please help me. Thank you.
Attachments
Figs.pdf
(173.59 KiB) Downloaded 403 times

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: [ESP-WROOM-32]Mainly, How to communicate with I2C sensor requiring higher current than GPIO can flow.

Postby ESP_Sprite » Thu Feb 07, 2019 5:03 am

First of all, the 75mA is the power supply usage, not the I2S current. Assuming you power the device from your 3.3V or 5V rail (and not a GPIO), the I2C current shouldn't be an issue. Wrt clock stretching: You may indeed run into issues with the maximum clock stretching time, the 13mS sounds right. I see the sensor also supports modbus, you may be able to use that instead; perhaps there's also some way to do 'polling' i2c that works around the lack of clock stretching. Finally, FreeRTOS fully supports multitasking, so as long as you write your program correctly (use queues/muxes/... to handle inter-task communication correctly), you should be free to do whatever you want.

omomom
Posts: 3
Joined: Wed Feb 06, 2019 6:27 am

Re: [ESP-WROOM-32]Mainly, How to communicate with I2C sensor requiring higher current than GPIO can flow.

Postby omomom » Thu Feb 07, 2019 6:33 am

Thank you for teaching politely!
it is helpful for me.

I could understand that 75 mA does not flow through I2C.

I'm happy if you could answer additional questions.

1. I'm thinking of connecting the 3V3 pin of Esp32 to the power supply pin of the sensor, is it the same as what you intended? do I have to use external power supply?
2.If question 1 is true, Do you mean that there is no upper limit to the current that can flow from 3V3 of ESP 32? And, don't I have to care that how much current does it flow through the I2C SDA, SCL line?
3. If I succeed about SCD 30, I would like to connect another I2C sensor that requires 48.8 mA during measurement additionary. Even if I2C sensors are increased, is there any particular problem from the viewpoint of electricity and software? If electrical problems are likely to occur, how can I calculate whether or not electrical problems such as current shortage will occur?

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: [ESP-WROOM-32]Mainly, How to communicate with I2C sensor requiring higher current than GPIO can flow.

Postby ESP_Sprite » Sat Feb 09, 2019 10:48 am

It depends. Presumably, you feed the ESP-WROOM-32 module with some kind of power supply that can deliver 500mA. If you also use that power supply for the sensors, it needs to be able to output (worst-case scenario) 49+75=124mA more. So if the 3.3V rail can deliver at least 624mA, you should be OK.

Who is online

Users browsing this forum: Bing [Bot] and 95 guests