Skip to content

Commit

Permalink
Add ENS16x (air quality) and ENS210 (temp & RH) sensors (arendst#19479)
Browse files Browse the repository at this point in the history
* Add files via upload

Added ENS16x library enabling read-out of ENS160 and ENS161 sensor component (follow-up of CCS811 and iAQcore)
Added ENS210 library to read out ENS210 temperature & humidity sensor

* Add files via upload

Add air quality sensor readout for ENS160 and ENS161 checking two possible I2C addresses (follow up sensor for CCS811 and iAQcore)
Add temperature and humidity sensor readout checking two possible I2C addresses

* Update BUILDS.md

Add USE_ENS16x and USE_ENS210

* Update decode-status.py

Add USE_ENS16x and ENS210

* Update I2CDEVICES.md

Add USE_ENS16x and USE_ENS210

* Update my_user_config.h

Add USE_ENS16x and USE_ENS210

* Update support_features.ino

Add USE_ENS16x and USE_ENS210

* Update tasmota_configurations.h

Add USE_ENS16x and ENS210

* Update tasmota_configurations_ESP32.h

Add USE_ENS16x and USE_ENS210

* Update xsns_111_ens16x.ino

Corrected I2X number

* Update xsns_112_ens210.ino

Corrected I2C number

* Disable USE_ENS16x and USE_ENS210 by default

* Added code size information

* cut down in libs

* optimize tasmota side

* fix ens16x web display

* final fix on alternate addresses

* update code & RAM usage

---------

Co-authored-by: Barbudor <barbudor@barbudor.net>
  • Loading branch information
2 people authored and dilyanpalauzov committed Oct 1, 2023
1 parent cd54a92 commit fa1bdaf
Show file tree
Hide file tree
Showing 20 changed files with 2,070 additions and 3 deletions.
2 changes: 2 additions & 0 deletions BUILDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ Note: `minimal` variant is not listed as it shouldn't be used outside of the [up
| USE_MPR121 | - | - / - | - | - | - | - |
| USE_CCS811 | - | - / - | - | x | - | - |
| USE_CCS811_V2 | - | - / x | - | - | - | - |
| USE_ENS16x | - | - / - | - | - | - | - |
| USE_ENS210 | - | - / - | - | - | - | - |
| USE_MPU6050 | - | - / - | - | - | - | - |
| USE_DS3231 | - | - / - | - | - | - | - |
| USE_MGC3130 | - | - / - | - | - | - | - |
Expand Down
3 changes: 3 additions & 0 deletions I2CDEVICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,6 @@ Index | Define | Driver | Device | Address(es) | Description
81 | USE_PCA9557 | xdrv_69 | PCA95xx | 0x18 - 0x1F | 8-bit I/O expander as virtual button/switch/relay
82 | USE_SGP4X | xsns_109 | SGP4X | 0x59 | Gas (TVOC/NOx index)
83 | USE_MAX17043 | xsns_110 | MAX17043 | 0x36 | Fuel-gauge for 3.7 Volt Lipo battery
84 | USE_ENS16x | xsns_111 | ENS16x | 0x52 - 0x53 | Gas (TVOC, eCO2) and air quality sensor
85 | USE_ENS210 | xsns_112 | ENS210 | 0x43 - 0x44 | Temperature and humidity sensor

21 changes: 21 additions & 0 deletions lib/lib_i2c/ScioSense_ENS16x/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Sciosense

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
38 changes: 38 additions & 0 deletions lib/lib_i2c/ScioSense_ENS16x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ScioSense ENS16x
Arduino library for the ENS160 and ENS161 digital four channel MOX gas sensor with I2C interface from ScioSense

## Introduction
This project is an Arduino *library*. It implements a driver with examples for the ENS160 and ENS161.
The ENS16x chip is a digital gas sensor for TVOC and eCO2 with an I2C interface.
The driver in this Arduino library is based on the code supplied by *Sciosense*, the manufacturer of the chip.

Note that the ENS16x requires a supply voltage of 1.71V .. 1.98V.
The ENS16x also requires a IO voltage of 1.71V .. 3.6V.

## Links
The ENS16x is made by [Sciosense](http://www.sciosense.com).
- The datasheet of the ENS160 is available through the website. The datasheet of ENS161 is not yet released but can be provided on request

## Prerequisites
It is assumed that
- The Arduino IDE has been installed.
If not, refer to "Install the Arduino Desktop IDE" on the
[Arduino site](https://www.arduino.cc/en/Guide/HomePage).
- The library directory is at its default location.
For me, that is `C:\Users\sciosense\Documents\Arduino\libraries`.

## Installation
- Visit the project page for the Arduino ENS16x library.
- Click the green button Clone or download on the right side.
- From the pop-up choose Download ZIP.
- In Arduino IDE, select Sketch > Include Library > Manage Libraries ... and browse to the just downloaded ZIP file.
- When the IDE is ready this README.md should be located at e.g. `C:\Users\sciosense\Documents\Arduino\libraries\ScioSense_ENS16x\README.md`.

## Build an example
To build an example sketch
- (Re)start Arduino.
- Open File > Example > Examples from Custom Libraries > ENS16x > ENS16xbasic_normal
- Make sure Tools > Board lists the correct board.
- Select Sketch > Verify/Compile.

### ScioSense is a Joint Venture of ams AG
65 changes: 65 additions & 0 deletions lib/lib_i2c/ScioSense_ENS16x/keywords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#######################################
# Syntax Coloring Map
#######################################
# https://spencer.bliven.us/index.php/2012/01/18/arduino-ide-keywords/
# KEYWORD1 Classes, datatypes, and C++ keywords
# KEYWORD2 Methods and functions
# KEYWORD3 setup and loop functions, as well as the Serial keywords
# LITERAL1 Constants
# LITERAL2 Built-in variables (unused by default)


#######################################
# Classes, datatypes (KEYWORD1)
#######################################
ENS160 KEYWORD1
ens160 KEYWORD1
ENS161 KEYWORD1
ens161 KEYWORD1
ScioSense_ENS16x KEYWORD1
ScioSense_ens16x KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################
begin KEYWORD2
setI2C KEYWORD2
available KEYWORD2
revENS16x KEYWORD2
setMode KEYWORD2

initCustomMode KEYWORD2
addCustomStep KEYWORD2

measure KEYWORD2
measureRaw KEYWORD2
set_envdata KEYWORD2
set_envdata210 KEYWORD2
getMajorRev KEYWORD2
getMinorRev KEYWORD2
getBuild KEYWORD2

getAQI KEYWORD2
getTVOC KEYWORD2
geteCO2 KEYWORD2
getAQIS KEYWORD2
getHP0 KEYWORD2
getHP0BL KEYWORD2
getHP1 KEYWORD2
getHP1BL KEYWORD2
getHP2 KEYWORD2
getHP2BL KEYWORD2
getHP3 KEYWORD2
getHP3BL KEYWORD2
getMISR KEYWORD2

######################################
# Constants (LITERAL1)
#######################################

ENS16x_I2CADDR_0 LITERAL1
ENS16x_I2CADDR_1 LITERAL1
ENS16x_OPMODE_IDLE LITERAL1
ENS16x_OPMODE_STD LITERAL1
ENS161_OPMODE_LP LITERAL1
ENS16x_OPMODE_CUSTOM LITERAL1
9 changes: 9 additions & 0 deletions lib/lib_i2c/ScioSense_ENS16x/library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=ScioSense ENS16x
version=8.0.0
author=Christoph Friese
maintainer=ScioSense
sentence=Arduino library for the ENS160 and ENS161 digital four channel MOX gas sensor with I2C interface from ScioSense
paragraph=This library controls the ENS160 and ENS161. The main feature of this library is performing a single shot measurement, retrieving the measurement data.
category=Device Control
url=https://github.com/sciosense/ens16x
architectures=*
Loading

0 comments on commit fa1bdaf

Please sign in to comment.