Project showcase
Arduino Environmental Monitoring

Arduino Environmental Monitoring © CC0

Inexpensive hack to monitor the temperature, humidity, barometric pressure and other factors using Windows 10 and Azure.

  • 16,247 views
  • 1 comment
  • 28 respects

Components and supplies

Ardgen mega
Arduino Mega 2560 & Genuino Mega 2560
Can Replace Mega/CC3000 with this and a dedicated ADC. Plus Secure SSL !
×1
1893 02
Adafruit Pressure/Altitude/Temperature Sensor
Output : Pa
×1
Various Gas Sensors (HANWEI)
Output : 0-1024 ADC values. Only using for danger thresholds, not accurate values.
×1
1899 00
Adafruit Humidity and Temperature Sensor
Output : °C and RH (%)
×1
AMS-TAOS TSL2561 Luminosity Sensor
Output : lux (lm/m²)
×1
SparkFun (Texas Instruments, SFE) CC3000 WiFi Breakout
Better than using another Serial Channel and buffers and all that jazz, I guess.
×1
Sharp GP2Y1010AU0F Dust Sensor
Output : µg/m³
×1
Samyoung DSM501A Dust Sensor
Output : µg/m³
×1
Lapis Semiconductor ML8511 UV-B Sensor
Output : mW/cm²
×1

Necessary tools and machines

09507 01
Soldering iron (generic)
No need to explain this :P
Hy gluegun
Hot glue gun (generic)
Prevents wobbly capacitors, I guess ?

Apps and online services

Microsoft azure logo 7qghkhuibq
Microsoft Azure
Free Developer Benefits subscription ($25/mo).
Vs2015logo
Microsoft Visual Studio 2015
Unity, Unreal, Arduino (Visual Micro), WPF, WinForms, WHATEVER, I'll always be using it. And it's free!
Ide web
Arduino IDE
Works good when you want to edit a single line and don't want to load Visual Studio
Fritzing
Gonna replace with Upverter
Syncfusion Controls
Free unlike Telerik Controls, works good enough (a little slow though, but it's free.)
Xamarin
Courtesy of DreamSpark. Not actually using it, but planning to. C# FTW.
Upverter logo
Upverter
better than Fritzing, I realized halfway through the project.

About this project

About

This project consists of an Arduino, a UWP app and an Azure service.

Arduino sends all it's data over HTTP to the app service instance, which stores it in a database (easy tables), and the records are retreived on the UWP app using the app service SDK.

Since my AVR based mega was too slow for TLS and didn't have space for a certificate, I had to settle on HTTP.

I considered using MQTT - but I didn't find any well documented broker written in C#, then looked at CoAP, when I realized, app service was only intended for HTTP traffic on port 80 and 443. 

Json is not the most efficient data transport, seems like a crazy way to do it. But it meets the target performance and also shows that there is always a quick hack for everything..

If you are experience enough then you can set it all up (minus the sensors, etc) in less than 6 hours, because using "easy tables" is really easy (since it has a http api) and using the SDK for a UWP app (with a wonderful language like C#) is easy too.. And you won't have to deal with marshalling and all since the json libraries on the arduino and .net are both easy to use, allowing for a flexible schema..

The App

The Parts

Misc. Pictures

  • This project uses Microsoft trademarks under the Contest Rules which states:
You may include Microsoft trademarks, logos, and designs, for which Microsoft grants you a limited license to use for the sole purposes of submitting an entry into this Contest.

And for the rest:

This project documentation is licensed under CC0 (including all images except the images using Microsoft trademarks).

Code

Arduino code flowchartPlain text
This is my visio flowchart - I am pretty new to flowcharts and visio- forgive me.
No preview (download only).
Server codeJavaScript
WeatherDataItem.js
var table = module.exports = require('azure-mobile-apps').table();
table.columns =
{
	"err": "string",
	"mq2_max": "number", "mq2_min": "number", "mq2_avg": "number",
	"mq3_max": "number", "mq3_min": "number", "mq3_avg": "number",
	"mq4_max": "number", "mq4_min": "number", "mq4_avg": "number",
	"mq5_max": "number", "mq5_min": "number", "mq5_avg": "number",
	"mq6_max": "number", "mq6_min": "number", "mq6_avg": "number",
	"mq7_max": "number", "mq7_min": "number", "mq7_avg": "number",
	"mq8_max": "number", "mq8_min": "number", "mq8_avg": "number",
	"mq9_max": "number", "mq9_min": "number", "mq9_avg": "number",
	"mq135_max": "number", "mq135_min": "number", "mq135_avg": "number",
	"temperature_max": "number", "temperature_min": "number", "temperature_avg": "number",
	"humidity_max": "number", "humidity_min": "number", "humidity_avg": "number",
	"pressure_max": "number", "pressure_min": "number", "pressure_avg": "number",
	"uvb_max": "number", "uvb_min": "number", "uvb_avg": "number",
	"dust1_max": "number", "dust1_min": "number", "dust1_avg": "number",
	"dust_max": "number", "dust_min": "number", "dust_avg": "number",
	"dust25_max": "number", "dust25_min": "number", "dust25_avg": "number",
	"lux_avg": "number", "lux_max": "number", "lux_min": "number", "deviceId": "number"
}
table.dynamicSchema = true;
Main Repository
GitHub main repository, where I commit all of my code. You'll need a Xamarin sub for ArduinoEM.Android, though.

Schematics

Old Schematic
This is a rough schematic of how things are connected. View the Upverter schematic for latest schematic - it's easier to make new parts there than Fritzing. I WILL NOT UPDATE FRITZING REPO ANYMORE. Note : Only view schematic view; breadboard view and PCB view are a rat's nest !
Fritzing OLD Schematic
Exported as .png
To view with more detail, download the .fzz file from the fritzing project and view it in Fritzing (fritzing.org) - it's free !
I WILL NOT UPDATE FRITZING SCHEMATICS ANYMORE - MAKING NEW PARTS IS EASIER ON UPVERTER.
Arduinoem schem
Latest Schematic
WORK IN PROGRESS : Latest schematic - it's easier to make schematics on Upverter than Fritzing. This project is not really viable on Fritzing's breadboard view or any PCB.

Comments

Author

Jqp4ppvj
Prajay Basu
  • 2 projects
  • 6 followers

Additional contributors

Published on

March 19, 2016

Members who respect this project

1510909 501269813310730 7749049296334786199 n6849e377033c8edf81b7093b793c7299Ricardo santo andreKurt portrait cartoon 256h1959330 738784679474769 2043547170 nDefaultDefaultEuleer

and 20 others

See similar projects
you might like

Similar projects you might like

MKR1000 Temp and Humidity Sensor

Project tutorial by Don Coleman

  • 21,499 views
  • 11 comments
  • 34 respects

Multiple mode Environmental Sensor Deck with MKR1000

Project tutorial by ConsoleTeam

  • 13,415 views
  • 14 comments
  • 50 respects

PlantAnalyzer

Project in progress by Ryan Michaud

  • 10,058 views
  • 3 comments
  • 36 respects

Arduino Environmental Monitoring

Project tutorial by WolkWriter

  • 5,875 views
  • 22 comments
  • 26 respects

An Environmental Monitoring Tool

Project in progress by Pyre Mage

  • 4,511 views
  • 3 comments
  • 19 respects

GPS Datalogger, Spatial Analysis, and Azure IoT Hub.

Project tutorial by Shawn Cruise

  • 21,485 views
  • 4 comments
  • 79 respects
Add projectSign up / Login