The MKR ENV Shield allows a MKR board to acquire environmental data collected by an array of sensors. These sensors are of the latest generation and measure atmospheric pressure, temperature, humidity, UVa intensity, UVb intensity, UV Index and light intensity (in LUX). To help you build projects with locally stored data, this shield has a microSD slot.
This shield has all the sensors on one side and should be kept on top of any pile of shields, otherwise it won't be able to measure properly all the values related to light.
The first sensor on the left is an LPS22HB and measures atmospheric pressure; the next one is an HTS221 and measures temperature and humidity, next is the reset button that has been replicated on the shield to allow you to reset the MKR board below. The top sensor on the right is a TEMT6000 and measures the Lux of the ambient. The last sensor, just below the Lux, is a VEML6075 and measures the two UV wavelenghts named as A and B. This last sensor is also capable of producing the UV Index through some calculations performed by our MKRENV library. On the left of the board the metallic square is the slot for a microSD.
The interfaces used by this shield are i2c, analog and SPI. i2c is used by pressure, temperature, humidity and UV; the interface is the usual 12 (SCL) and 11 (SDA) . Analog is for the Lux ambient light sensor and is connected to A2. The SD card relies on SPI interface, therefore it uses 8 (MOSI), 9 (SCK) and 10 (MISO). Other pins used by the shield are the SD CS on D4 to select the microSD, HTS221 DataReaDY on pin D6 and LPS22HB DataReaDY on pin D7.
This shield uses sensors that communicate with the board using the i2c protocol and a two wire interface. Only the Lux sensor is analog, nevertheless we have prepared a library, Arduino_MKRENV, that takes care of all the protocols and parameters, allowing you to read al the values from all the sensors with a simple set of APIs. You need to download it using our Library Manager.
Please refer to Arduino_MKRENV library to get full details about the available functions.
Now that you have a basic knowledge of the shield, you may find inspiration in our Project Hub tutorial platform.
Here is a sketch that reads all the sensors each second and prints out type and value of the parameter sampled from the environment
The text of the Arduino getting started guide is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the guide are released into the public domain.