I sent the text below to the Core Electronics Support email address and was asked to post this here.
Any assistance would be appreciated.
Recently I purchased a couple of ENS160s from you (in separate transactions) and they are basically working well.
However, the device I want to use them with needs to be battery powered (recharged by a solar cell) and so I need the devices to draw as little power as possible when not in use. One of the things that I liked about the ENS160 was that the ’deep sleep’ mode existed and the data sheet shows a very low current draw in tis mode.
As indicated in the below email to the manufacturers, I can put the device into ‘deep sleep’ but I don’t seem to be able to recover from that state successfully.
I sent the attached email (and a reminder) to the device manufacturers but as yet I have not received a response.
Therefore I am writing to you to see if your ‘wizards’ are able to provide me with he correct way to move from ‘deep sleep’ back to an operational state, and possibly (as a company rather than an individual) get the support from the manufacturer.
I imagine that others would e interested in this as well and so it might make a good item for your web site.
Text to email@example.com
Hello tech Support,
I have an ENS160 on a PiicoDev board connected to an Digi XBee3 via I2C. The Xbee3 is running the Digi Micropython. The code is based (very heavily) on the code at GitHub - CoreElectronics/CE-PiicoDev-ENS160-MicroPython-Module: CE PiicoDev ENS160 MicroPython Module
Normally it is working well and providing me with the results I need.
However I now want to use the ‘deep sleep’ mode (to preserve battery) and I am having problems getting the sensor to work once I come out of deep sleep.
On the initial power up and after the initialisation if the ENS160 (as per the class initialisation function in the above link), the status is 0x87 and the various values are read with reasonable values.
I set the OPMODE register to 0x00 and then sleep the XBee3. When it wakes I set the OPMODE register to 0x01 (which I can see works by reading it back) and then to 0x02 before looping back to read the status and AQI, eCO2 and TVOC values again.
However the time the status is 0x01, the temperature (DATA_T after the supplied calculation) is -273.15 and humidity (DATA_RH again after the calculation) is 0. The AQI, TVOC and eCO2 are all 0.
I cannot see in the data sheet anything about how to switch between the various OPMODEs other than the state transition diagram in Section 15 and section 16.2.2. This does no indicate that any other delays or commands are required when switching between the various modes (although I do wait about 20uS between my mode switching, following the example in the initialisation code of the liked file above).
What’s the correct command sequence required to restore operation after a deep sleep?
Does the ENS160 require re-initialisation after coming out of deep sleep?