iotempire / iotempower

IoTempower is a framework and environment for making the Internet of Things (IoT) accessible for everyone
MIT License
24 stars 18 forks source link

ENS160 sensor support package #119

Open mbz4 opened 1 month ago

mbz4 commented 1 month ago

This is a very affordable gas sensor but a pain to work with.

Using this board for building the support package, and it features both the ENS160 (gas; driver target) and a AHT2X (temp, humidity; follow-on driver target) built-in:

Image

This instructables guide details more on how to set it up: https://www.instructables.com/ENS160-AHT21-Sensor-for-Arduino/

...where this link to aliexpress shows the board retails at ~3USD: https://www.aliexpress.us/w/wholesale-ens160%2Baht21.html?spm=a2g0o.detail.search.0

Here is the ENS160 product page (sciosense): https://www.sciosense.com/ens16x-digital-metal-oxide-multi-gas-sensor-family/

And the ENS160 datasheet: https://www.sciosense.com/wp-content/uploads/2023/12/ENS160-Datasheet.pdf

Sciosense prepared this official (arduino) driver: https://github.com/sciosense/ens16x-arduino

And it is also on Platformio Registry here: https://registry.platformio.org/libraries/sciosense/ScioSense_ENS16x (tested partially working)

There is also this driver: https://registry.platformio.org/libraries/dfrobot/DFRobot_ENS160 (tested also partially working .-.)

The major pain with this sensor is the 24 hour initial startup phase: the device must be powered non-stop during this period. In case of any power interruption, the timer resets...

While testing, the sensor did not yield usable measurements but perhaps after several iterations of the initial phase it might start producing useful data.

mbz4 commented 1 month ago

Official ENS161 Evaluation Kit V1, sold on Mouser ( ~40 EUR): https://eu.mouser.com/ProductDetail/ScioSense/ENS161-Evaluation-Kit-V1?qs=17ckDYBRdel4dMyrxJwCbw%3D%3D

Image

Adding this comment for reference - note the 10x price difference between official eval sensor and aliexpress.

mbz4 commented 1 month ago

Tested all PlatformIO registry listed libraries for the ENS160:

Not one worked with the aliexpress board. Assuming the sensor board at hand may be defective.

Will prepare the IoTempower driver with the DFRobot_ENS160 library. For the AHT2X can also test libraries (separate item).

mbz4 commented 1 month ago

rather incoherent behaviour

momentarily functioning: (with sciosense library - adjusted address, interrupts) Image

...but only 10 seconds later: Image

I like the DFRobot MIT licensed library the most because its organized in a sensible manner... but it also does not result in anything usable... although once or twice it did work ok...

Image

I think it will take a lot of time to get this 3 EUR sensor working... reliably... IoTempower driver next...