Description
ENV is a environment sensor, can be used for temperature, humidity, and atmospheric pressure measurement. Build with DHT12 and BMP280.
DHT12 is a upgradation version of DHT11 humidity temperature sensor, fully downward compatible, more precise and add I2C interface. BMP280 is an absolute barometric pressure sensor especially designed for mobile applications, offers highest flexibility to optimize the device regarding power consumption, resolution and filter performance.
Product Features
- Temperature:
- measuring range: -20 ~ 60 ℃
- resolution: ±0.2℃
- Humidity:
- measuring range: 20 ~ 95 %RH
- resolution: 0.1%
- Air pressure
- measuring range: 300 ~ 1100hPa
- resolution: ±1hPa
- Program Platform: Arduino, UIFlow(Blockly,Python)
- Two Lego-compatible holes
Kit includes
- 1x ENV Unit
- 1x Grove Cable
Learn
Example
1. Arduino IDE
This is a ENV example, implemented reading temperature, humidity and atmospheric pressure function. 1, Before compiling, please install Adafruit BMP280 Library
2, copy Adafruit_Sensor.h
to C:\Users\<user_name>\Documents\Arduino\libraries\Adafruit_BMP280_Library
The code below is incomplete. To get the complete code, please click here.
/*
Install Adafruit BMP280 Library first.
*/
#include <M5Stack.h>
#include "DHT12.h"
#include <Wire.h> //The DHT12 uses I2C comunication.
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
// new two objects
DHT12 dht12;
Adafruit_BMP280 bme;
// initialization
M5.begin();
Wire.begin();
bmp.begin();
// read data
float tmp = dht12.readTemperature();
float hum = dht12.readHumidity();
float pressure = bme.readPressure();
2. UIFlow
To get the complete code, please click here.
More information
Schematic
PinMap
M5Core(GROVE A) | GPIO22 | GPIO21 | 5V | GND |
ENV Unit | SCL | SDA | 5V | GND |