fbpx

The Microsoft Azure IoT Developer Kit is an Arduino compatible board built for helping with prototyping Internet of Things (IoT) solutions. The key difference with this board compared to many others available is that, unlike most, the Microsoft Azure IoT Developer Kit has a number of hardware sensors built directly on the board. This eliminates the need to have electronics knowledge and the need to do any wiring or soldering in order to get started prototyping IoT solutions. This article gives an overview of the built-in sensors on this board.

Built-in IoT Sensors

The Microsoft Azure IoT Developer Kit has 4 hardware sensors built directly on the board. Prototyping IoT solutions is much easier having these sensors built directly on the board. This eliminates the need to do any wiring or soldering of components to get started building and coding an IoT solution. This board greatly helps lower the barrier to entry of prototyping out IoT solutions and integrating the hardware with software and the Azure cloud.

Here’s a list of the telemetry readings that these hardware sensors easily make available:

  • Temperature
  • Humidity
  • Barometric Pressure
  • Magnetometer
  • Motion / Gyroscope

The following photo shows the row towards the “bottom” of the Microsoft Azure IoT Developer Kit where these sensors are located. You can see the locations of each one as denoted on the board by the labeling that is printed directly on the board.

Azure IoT Developer Kit: Sensor Overview 1

Firmware Display of Sensor Readings

One of the nice features of the Microsoft Azure IoT Developer Kit board is that the firmware doesn’t just let you load programs to the board, but it also allows you to easily see telemetry readings from the built-in sensors immediately once powered on. The onboard OLED display screen is used to display the telemetry readings, and the built-in hardware buttons enable the readings to be toggled through.

The following photo shows the middle of the board where the OLED display and the hardware buttons are. The display in this photo shows the default display the firmware shows when first powering on the device. As it indicates, pressing the hardware button labelled “B” (located to the right side of the OLED display) will enable the ability to toggle through the telemetry readings of each of the built-in sensors.

Azure IoT Developer Kit: Sensor Overview 2

Upon pressing the “B” button to the right of the OLED display once the device is powered on will toggle through the sensor readings for the built-in sensor hardware on the board.

Here’s a view of the first Environment display showing readings from the Humidity & Temperature sensor. In this view it displays the Temperature in Fahrenheit, with the Humidity represented as a Percentage.

Azure IoT Developer Kit: Sensor Overview 3

Here’s a view of the second Environment display showing readings from the reading from the Barometric Pressure sensor. This view also displays the Temperature, however it’s displayed in Celsius in this case.

Azure IoT Developer Kit: Sensor Overview 4

Here’s a view of the Magnetometer sensor reading. It shows a representation of the Magnetometer sensor reading as positive / negative integer values for X, Y, and Z.

Azure IoT Developer Kit: Sensor Overview 5

Here’s a view of the Gyroscope sensor reading. It shows a representation of the Gyroscope sensor reading as positive / negative integer values for X, Y, and Z.

Azure IoT Developer Kit: Sensor Overview 6

As you can see the device firmware of the Microsoft Azure IoT Developer Kit makes it easy to read the values of the built-in sensors. This is good validation that the board is functioning once powered on. It’s also a good feature that helps make this board feel more approachable, and it’s really all enabled by the great integrated hardware on this tiny, little, credit card sized board in addition to the sensors discussed in this article.

Sensor Hardware

The Microsoft Azure IoT Developer Kit is really great for prototyping with all the integrated hardware and sensors. Just as the OLED display and buttons are hardware, so are the sensors. But, exactly what sensors are being used on this board?

Humidity and Temperature Sensor

The built-in Humidity and Temperature sensor is implemented using the ST HTS221 humidity sensor. This is a capacitive digital sensor for relative humidity and temperature. This sensor is designed to operate within a temperature range from -40C to +120C. Here’s a few more specifications for this sensor:

  • 0 to 100% relative humidity range
  • Humidity accuracy: ±3.5% rH, 20 to +80% rH
  • Temperature accuracy: ±0.5C, 15 to +40 C

Here’s some short sample source code shown in the official MS Azure IoT Dev Kit documentation for reading this sensor:

#include "HTS221Sensor.h"
DevI2C *i2c;
HTS221Sensor *sensor;
float humidity = 0;
float temperature = 0;
unsigned char id;
void setup() {
i2c = new DevI2C(D14, D15);
sensor = new HTS221Sensor(*i2c);
// init the sensor
sensor -> init(NULL);
}
void loop() {
// enable
sensor -> enable();
// read id
sensor -> readId(&id);
Serial.printf("ID: %d\r\n", id);
// get humidity
sensor -> getHumidity(&humidity);
Serial.print("Humidity: ");
Serial.println(humidity);
// get temperature
sensor -> getTemperature(&temperature);
Serial.print("Temperature: ");
Serial.println(temperature);
// disable the sensor
sensor -> disable();
// reset
sensor -> reset();
delay(1000);
}

Gyroscope Sensor

The built-in Gyroscope sensor utilizes the ST LSM6DSL sensor. This is a 3D digital accelerometer and gyroscope offering a low-power motion experience.

Here’s some additional features of the Gyroscope:

  • “Always-on” experience with low power consumption for both accelerometer and gyroscope
  • Pedometer, step detector and step counter
  • Significant motion and tilt function

Here’s some short sample source code shown in the official MS Azure IoT Dev Kit documentation for reading this sensor:

#include "LSM6DSLSensor.h"
DevI2C *i2c;
LSM6DSLSensor *sensor;
int32_t axes[3];
int16_t raws[3];
float data;
void setup(){
i2c = new DevI2C(D14, D15);
sensor = new LSM6DSLSensor(*i2c, D4, D5);
// init
sensor->init(NULL);
}
void loop(){
// Accelerometer test
accelerometer_test();
// Gyroscope test
gyroscope_test();
delay(1000);
}
void accelerometer_test(){
Serial.println("***Accelerator***");
// enableAccelerator
sensor->enableAccelerator();
// getXAxes
sensor->getXAxes(axes);
Serial.printf("Axes: x: %d, y: %d, z: %d\n", axes[0], axes[1], axes[2]);
// getXSensitivity
sensor->getXSensitivity(&data);
Serial.print("Sensitivity: ");
Serial.println(data);
// getXAxesRaw
sensor->getXAxesRaw(raws);
Serial.printf("Raw: x: %d, y: %d, z: %d\n", raws[0], raws[1], raws[2]);
}
void gyroscope_test(){
Serial.println("***Gyroscope***");
// enableGyroscope
sensor->enableGyroscope();
// getGAxes
sensor->getGAxes(axes);
Serial.printf("Axes: x: %d, y: %d, z: %d\n", axes[0], axes[1], axes[2]);
// getGSensitivity
sensor->getGSensitivity(&data);
Serial.print("Sensitivity: ");
Serial.println(data);
// getGAxesRaw
sensor->getGAxesRaw(raws);
Serial.printf("Raw: x: %d, y: %d, z: %d\n", raws[0], raws[1], raws[2]);
}

Magnetometer Sensor

The built-in Magnetometer sensor utilizes the ST LIS2MDL sensor. This is an ultra-low power high performance 3-axis magnetometer.

Here are some additional features of this sensor:

  • 3 magnetic field channels
  • Embedded temperature sensor <- this doesn’t seem to be utilized on this board

Here’s some short sample source code shown in the official MS Azure IoT Dev Kit documentation for reading this sensor:

#include "lis2mdl_class.h"
DevI2C *i2c;
LIS2MDL *lis2mdl;
int32_t axes[3];
int16_t raw[3];
uint8_t id;
void setup(){
i2c = new DevI2C(D14, D15);
lis2mdl = new LIS2MDL(*i2c);
// init
lis2mdl-&amp;amp;amp;gt;init(NULL);
}
void loop(){
// read id
lis2mdl-&amp;amp;amp;gt;readId(&amp;amp;amp;amp;id);
Serial.printf("Id: %d\n", id);
// getMAxes
lis2mdl-&amp;amp;amp;gt;getMAxes(axes);
Serial.printf("Axes: x - %d, y - %d, z - %d\n", axes[0], axes[1], axes[2]);
delay(1000);
}

Pressure Sensor

The built-in Pressure sensor utilizes the ST LPS22HB sensor. This is an ultra compact absolute piezoresistive pressure sensor.

Here’s some additional features of this sensor:

  • High overpressure capability: 20x full-scale
  • 260 to 1260 hPa absolute pressure range
  • High shock survivability: 22,000 g

Happy prototyping and building your IoT solutions! Please subscribe to Build Azure for more articles like this, including one on the eventual announcement of the public general availability of the Microsoft Azure IoT Developer Kit, so you can buy them for yourself or your team!

Microsoft MVP

Chris Pietschmann is a Microsoft MVP, HashiCorp Ambassador, and Microsoft Certified Trainer (MCT) with 20+ years of experience designing and building Cloud & Enterprise systems. He has worked with companies of all sizes from startups to large enterprises. He has a passion for technology and sharing what he learns with others to help enable them to learn faster and be more productive.
HashiCorp Ambassador Microsoft Certified Trainer (MCT) Microsoft Certified: Azure Solutions Architect

Discover more from Build5Nines

Subscribe now to keep reading and get access to the full archive.

Continue reading