Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the lib in deep sleep #1

Open
Stormhand opened this issue Apr 2, 2018 · 1 comment
Open

Using the lib in deep sleep #1

Stormhand opened this issue Apr 2, 2018 · 1 comment
Assignees

Comments

@Stormhand
Copy link

Hello,

Im using this library on ESP32 Wroom and its working good. I have some questions:

  1. Can i use it in deep sleep? It might need to avoid using ccs811_init_sensor() so the sensor is not reset every time (may be parameter ccs811_init_sensor(bool reset = false) )

  2. If i pull the WAK pin up to sleep it, do i need to hold it up during the ESP deep_sleep?

Thanks!

@gschorcht
Copy link
Owner

Sorry for the late answer, I didn't get a notification for the issue.

I'm not quite familiar yet with deep sleep in ESP32. If it is the same as in ESP8266, the system restarts completely after waking up and the sensor is soft reset.

Your suggestion to introduce an additional parameter to avoid the soft reset and setting the default sensor mode could solve this problem. Application would also have to set sensor mode to the same mode as before deep sleep to let the sensor continue in same operation mode and to bring the driver in this sensor mode. Maybe something would have to be changed in ccs811_set_mode to avoid the setting sensor mode if it is already in this mode.

Concerning the nWAKE signal. As I understand, it simply controls the state of the communication processor. The sensor operation is not affected by nWAKE signal. You have to drive nWAKE down before and throughout each I2C communication to activate the interface. From my point of view, the GPIO for nWAKE signal should be configured as open-drain pulled-up and actively driven to low. I don't know whether ESP32 preserves pull-up state of a GPIO during deep sleep or whether you need an external pull-up resistor.

@gschorcht gschorcht self-assigned this Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants