Project tutorial
Arduino & ASP.NET Core Project: Weather Station

Arduino & ASP.NET Core Project: Weather Station © MIT

Build a weather station with Arduino & ASP.NET Core.

  • 5,230 views
  • 0 comments
  • 20 respects

Components and supplies

Ard nano
Arduino Nano R3
×1
Arduino Nano shield
×1
AM2320
Digital Temperature and Humidity Sensor
×1
Ovna7lqwpyyfnb674kepm9w7
Seeed Grove - Barometer Sensor (BMP280)
×1
ML8511
UV sensor
×1
Sharp GP2Y1010F45
Optical Dust Sensor
×1
Ds3231mpmb1 en4txppxku
Maxim Integrated DS3231MPMB1 Peripheral Module
×1
Esp01
Espressif ESP8266 ESP-01
×1
Pmod sd  29825.1456867304.1280.1280
Digilent Pmod SD
×1
18650 Li-ion and Charger
18650 Li-ion and Charger (Optional)
×1

Apps and online services

Ide web
Arduino IDE
Visual Studio 2017
SQL Server

About this project

Introduction

This project includes an Arduino-based weather station, an ASP.NET Core MVC data presentation page, and an ASP.NET Core WebAPI. The collected data is sent using ESP8266 and written to the SQL Server database via WebAPI. The weather station consists of the following parts:

  • Arduino Nano
  • Nano Shield
  • AM2320 - Digital Temperature and Humidity Sensor
  • BMP280 - Barometric Pressure and Altitude Sensor
  • ML8511 - UV sensor
  • GP2Y1010F45 - Optical Dust Sensor
  • DS3231 - RTC
  • ESP8266 - WIFI
  • SD card module
  • 18650 Li-ion and Charger (Optional)

Most of the referenced libraries come from Adafruit and Aduino Playground, and some I don't know who written it. AM2320 comes from thakshak.

GitHub: https://github.com/ZhangGaoxing/weather-station-arduino

Arduino Connection

I2C Sensors

  • VCC - 5V
  • GND - GND
  • SDA - A4
  • SCL - A5
  • ML8511

ML8511

  • VIN - 3.3V
  • OUT - A0
  • GND - GND
  • EN - 3.3V
  • 3.3V - A1

GP2Y1010F45

  • Sharp pin 1 (V-LED) - 5V (Series 150Ω resistor, pin 1 and resistance connected to 220 μF capacitor and grounded)
  • Sharp pin 2 (LED-GND) - GND
  • Sharp pin 3 (LED) - pin 4
  • Sharp pin 4 (S-GND) - GND
  • Sharp pin 5 (Vo) - A2
  • Sharp pin 6 (Vcc) - 5V

ESP8266

  • TX - pin 3
  • RX - pin 2
  • CH_PD - pin 5
  • VCC - 3.3V
  • GND - GND

SD Card

  • MOSI - pin 11
  • MISO - pin 12
  • CLK - pin 13
  • CS - pin 10

How to Use

Connect sensors to Arduino.

In ASP.NET Core

  • Open "WeatherStation.sln" and rebuild solution
  • In project API, WebPage, open Startup.cs, change connection string
  • In project API, open Controllers - WeatherController.cs, change token
  • Open Tools - NuGet Package Manager - Package Manager Console, change Default project to Utility

in PMC run this

Add-Migration
InitialUpdate-Database

or use SSMS run this SQL

CREATE DATABASE WeatherStation
CREATE TABLE [dbo].[Weathers] (
    [ID]          INT           IDENTITY (1, 1) NOT NULL,
    [DateTime]    DATETIME2 (7) NOT NULL,
    [Temperature] FLOAT (53)    NOT NULL,
    [Humidity]    FLOAT (53)    NOT NULL,
    [Pressure]    FLOAT (53)    NOT NULL,
    [Dust]        FLOAT (53)    NOT NULL,
    [UV]          FLOAT (53)    NOT NULL,
    CONSTRAINT [PK_Weathers] PRIMARY KEY CLUSTERED ([ID] ASC)
);
  • Publish API, WebPage to your server

In Arduino

  • Copy libraries to x:\Program Files (x86)\Arduino\libraries
  • Open "WeatherStation.ino"
  • In Line 134, replace your WIFI name and password
  • In Line 139, replace your server address and port
  • In Line 150, replace your Token
  • In Line 155, replace your Host
  • Upload program to your Arduino

Demo Page

http://weatherstation.zhangyue.xin/

Code

Comments

Author

Ava2 odjokaja9u
Zhang Yuexin
  • 1 project
  • 5 followers

Published on

January 3, 2019

Members who respect this project

Avatar fofgrbxpczAva2 odjokaja9uFamilyBernice ssnx2i8cqqSketter1969Albert einsteinBaqwasDe69a62a2b35333cd5fa834c6f202b80 qq25e5259b25be25e72589258720160323205203 uugfypsuzu

and 12 others

See similar projects
you might like

Similar projects you might like

Personal Weather Station (Arduino+ ESP8266 + Thingspeak)

Project tutorial by Jayraj Desai

  • 52,298 views
  • 34 comments
  • 110 respects

How To Make An Mini IOT Weather Station

Project tutorial by Austin Detzel

  • 4,066 views
  • 3 comments
  • 15 respects

Weather forecast station with LYT led bulb and IFTTT

Project tutorial by Team Authometion

  • 2,984 views
  • 0 comments
  • 2 respects

OH HAI! on Windows 10 IoT Core

Project in progress by BuddyC

  • 12,625 views
  • 3 comments
  • 48 respects

Arduino Weather Station v1.0 (BMP280)

Project tutorial by Gabriele Scordamaglia

  • 7,311 views
  • 15 comments
  • 43 respects

$10 Portable Arduino Weather Station (AWS)

Project tutorial by Prajjwal Nag

  • 31,938 views
  • 6 comments
  • 60 respects
Add projectSign up / Login