The Arduino MKR ENV Shield rev2 is a versatile sensor shield designed for the Arduino MKR series. It provides a range of environmental sensing capabilities, including temperature, humidity, barometric pressure, light intensity, and air quality measurements. This shield is ideal for projects that require environmental monitoring, such as weather stations, smart agriculture, and indoor air quality systems.
By integrating multiple sensors into a single shield, the MKR ENV Shield rev2 simplifies the process of collecting environmental data, making it a powerful tool for both hobbyists and professionals.
The following table outlines the key technical specifications of the Arduino MKR ENV Shield rev2:
Specification | Details |
---|---|
Operating Voltage | 3.3V (supplied by the MKR board) |
Sensors Included | Temperature, Humidity, Barometric Pressure, Light Intensity, Air Quality |
Communication Interface | I2C |
Operating Temperature Range | -40°C to 85°C |
Dimensions | 61.5mm x 25mm |
The MKR ENV Shield rev2 connects directly to the MKR series boards via the standard MKR pin headers. Below is a description of the key pins used by the shield:
Pin | Function | Description |
---|---|---|
SDA | I2C Data Line | Used for communication with the onboard sensors. |
SCL | I2C Clock Line | Provides the clock signal for I2C communication. |
3.3V | Power Supply | Supplies power to the shield from the MKR board. |
GND | Ground | Common ground connection. |
Arduino_MKRENV
library, which provides functions to interact with the shield's sensors.Below is an example code snippet to read temperature, humidity, and pressure data from the MKR ENV Shield rev2:
#include <Arduino_MKRENV.h> // Include the library for the MKR ENV Shield
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
while (!Serial); // Wait for the serial monitor to open
if (!ENV.begin()) { // Initialize the ENV Shield
Serial.println("Failed to initialize MKR ENV Shield!");
while (1); // Halt execution if initialization fails
}
Serial.println("MKR ENV Shield initialized successfully.");
}
void loop() {
// Read temperature, humidity, and pressure from the shield
float temperature = ENV.readTemperature(); // Temperature in °C
float humidity = ENV.readHumidity(); // Relative humidity in %
float pressure = ENV.readPressure(); // Pressure in hPa
// Print the sensor readings to the serial monitor
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
Serial.print("Pressure: ");
Serial.print(pressure);
Serial.println(" hPa");
delay(1000); // Wait for 1 second before the next reading
}
Shield Not Detected:
Arduino_MKRENV
library is installed.Incorrect Sensor Readings:
I2C Communication Errors:
Arduino_MKRENV
library.By following this documentation, you can effectively integrate the Arduino MKR ENV Shield rev2 into your projects and take full advantage of its environmental sensing capabilities.