Arduino library for the ENS220 high-accuracy barometric pressure and temperature sensor.
The ENS220 is an ultra-low-power, high-accuracy barometric pressure and temperature sensor produced by ScioSense. It comes in the smallest size LGA package with digital I2C and SPI interfaces. This enables new use cases in activity tracking, indoor navigation/localization, fall- and liquid-level detection.
- Datasheet
- Application notes
- Buy the ENS220 on Mouser or Digikey
- Buy the ENS220 evaluation kit on Mouser
- Further information about the ENS220
This library includes two special examples:
- 05_Event_Detection: This algorithm allows you to detect when a door or window has been opened in your room.
- 06_Fall_Detection: This algorithm allows you to detect falls with the ENS220S only (no accelerometer required). More detailed documentation can be found here.
Both libraries demonstrate the amazing capabilities of the ENS220 to measure relative pressure with low noise and high data rate.
It is assumed that
- The Arduino IDE has been installed. If not, refer to "Install the Arduino Desktop IDE" on the Arduino site.
- The library directory is at its default location. Normally this is
C:\Users\[your_username]\Documents\Arduino\libraries
.
You might need to add your board to the Arduino IDE. This library was tested with the Espressif ESP32. For the installation of the ESP32 in the Arduino IDE, see Arduino ESP32 Installation
- In the Arduino IDE, navigate to the Arduino Library Manager on the left side (or, alternatively, select Sketch > Include Library > Manage Libraries...)
- Search for
ScioSense_ENS220
- Select the library from the search results and press
Install
- Download the code from this repository via "Download ZIP".
- In Arduino IDE, select Sketch > Include Library > Add .ZIP library... and browse to the just downloaded ZIP file.
- When the IDE is ready this README.md should be located at
C:\Users\[your_username]\Documents\Arduino\libraries\ScioSense_ENS220\README.md
.
Please make sure that you use the correct supply voltage:
- The ENS220 runs at VDD = 1.8 V. If you are using the Sciosense ENS220 breakout board, you can use VDD = 3.3 V thanks to the onboard LDO.
- The I2C communication is 3.3 V tolerant.
This example shows how to wire a ESP32DevKitC with the ENS220 breakout board for I2C communication.
ENS220 breakout board | ESP32 |
---|---|
VDD | 3V3 |
GND | GND |
SDA | G21 |
SCL | G22 |
This example shows how to wire a ESP32DevKitC with the ENS220 breakout board for SPI communication.
ENS220 breakout board | ESP32 |
---|---|
VDD | 3V3 |
GND | GND |
SDI | G23 |
SDO | G19 |
CSN | G05 |
To use the ENS220's interrupt functionality connect the interrupt pin of the ENS220 to a GPIO pin of your Arduino. The interrupt pin uses 1.8 V (logic level shifter might be required).
To build an example sketch
- (Re)start Arduino.
- Open File > Examples > Examples from Custom Libraries > ScioSense ENS220 > 01_Basic_I2C_SingleShot (or any other of the provided examples you wish to run)
- Make sure Tools > Board lists the correct board.
- Select Sketch > Verify/Compile.
Contributions in the form of issue opening or creating pull requests are very welcome!
This library is developed for ScioSense by at² GmbH
@at2software