MKR1000 Temp and Humidity Sensor
Send temperature and humidity data from an Arduino MKR1000 to Microsoft Azure.
Things used in this project
Paul DeCarlo has a great article on sending weather data from a Particle Photon to Microsoft Azure. I wanted to duplicate this with the new Arduino MKR1000.
The Photon uses a webhook to send data from the Particle cloud to Azure. Since the MKR1000 supports HTTPS, data can be sent directly to Azure. This guide will get your MKR1000 connected to Azure and reuse a lot of the server side code from the Microsoft Connect the Dots project.
A DHT22 sensor is used to measure temperature and humidity. You could also modify the code to support the DHT11 sensor. Wire the DHT sensor on the breadboard. Send 3.3 volts from the MKR1000 to the first pin. Place a 10,000Ω pullup resistor from 3.3V to pin 2. Connect pin 3 to ground. Run a wire from pin 2 on the DHT22 to pin 6 on the MKR1000.
Open the Arduino IDE. Use the Boards Manager to install the MKR1000 board. Use the Library Manager to install the WiFi101 library.
The Arduino MKR1000 supports HTTPS, but we need to manually install the certificates for the sites we will visit. This is necessary since the memory on the device is limited. This is a two step process. First we load a sketch on the board and then run a program on our computer to upload the certificates.
Use the Arduino IDE to load the Firmware Updater Sketch onto your board.
Examples -> WiFi101 -> Firmware Updater
Download the WiFi101 Firmware Updater. Unzip the archive and run winc1500-uploader-gui.exe.
The HTTPS certificate for Azure Event hubs is issued to servicebus.windows.net so any service bus URL should work. Enter ctd-ns.servicebus.windows.net in the text field. Choose your COM port and upload the certificates.
Clone or download the Arudino sketch from https://github.com/don/MKR1000-Azure. Edit the ssid tab and change the
password to match your network settings. Upload the sketch to your MKR1000 board.
If you get errors, you might need to use the Arduino Library Manger (Sketch -> Include Library -> Manage Libraries…) to install the “DHT sensor library”, ArduinoJson, or RTCZero library.
Open the Arduino Serial Monitor (Tools -> Serial Monitor) and ensure that data is begin sent to Azure.
Read more: MKR1000 Temp and Humidity Sensor