Difference between revisions of "Open Source WiFi Weather Station System"

From Microduino Wiki
Jump to: navigation, search
(Get and Configure Blynk)
(Programming the Weather Station)
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| style="width: 840px;"
 
|-
 
|
 
 
==Outline==
 
==Outline==
 
*Project: Open Source WIFI Weather Station System.(ESP8266 connected to Blynk)   
 
*Project: Open Source WIFI Weather Station System.(ESP8266 connected to Blynk)   
*Objective: To get temperature, humidity, light intensity and even PM2.5 data around you.   
+
*Objective: To get temperature, humidity, light intensity and PM2.5 at the weather station.
 +
**Note: PM2.5 refers to atmospheric particulate matter (PM) that have a diameter of less than 2.5 micrometers  
 
*Difficulty: Medium   
 
*Difficulty: Medium   
*Project Time: 2 Hours
+
*Time-consuming: 2-Hour
*Creator: Ray   
+
*Maker: Ray   
  
 
Introduction:   
 
Introduction:   
*The station monitors temperature, humidity, light intensity and even PM2.5 (particulate matter) data around you.
+
*Read temperature, humidity, light intensity and PM2.5 data and display those data on the screen.   
*Display the sensor data on the OLED screen.   
+
*Upload the data to Blynk.
*The station can be synced with Blynk to upload sensor data.  
+
*View data on phone anywhere using the Blynk app
*Access the data anytime using the Blynk app.
+
*Created by Microduino with Microduino components.
  
 
==Bill of Material==
 
==Bill of Material==
 
===Microduino Equipment===
 
===Microduino Equipment===
 +
 +
{| class="wikitable" style="background-color:#FEF9E7;"
 +
|'''Note:''' Different revisions may contain different components.
 +
|}
 +
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
 
|Module||Number||Function  
 
|Module||Number||Function  
 
|-
 
|-
|[[Microduino-Core+]]||1||Core board   
+
|[[Microduino-Core+]]||1|| Core board (Arduino)  
 
|-
 
|-
|[[Microduino-USBTTL]] ||1||Program download 
+
|[[Microduino-USBTTL]] -OR- Microduino-USBTLL-C ||1|| Programmer for Core board
 
|-
 
|-
|[[Microduino-WIFI(ESP)]] ||1||Internet connection 
+
|[[Microduino-WIFI(ESP)]] ||1|| WiFi communication module
 
|-
 
|-
|[[Microduino-Sensorhub]] ||1||Sensor pin board 
+
|[[Microduino-Sensorhub]] ||1|| Connector Hub to connect sensors
 
|-
 
|-
|[[Microduino-Duo-h]] ||1||Extension board   
+
|[[Microduino-Duo-h]] -OR- Microduino-Cube-S1 ||1|| Extension board   
 
|-
 
|-
 
|[[Microduino-OLED]] ||1||Display   
 
|[[Microduino-OLED]] ||1||Display   
Line 38: Line 41:
 
|Sensor||Number||Function  
 
|Sensor||Number||Function  
 
|-
 
|-
|[[Microduino-Temp&Hum]] ||1||Digital temperature and humidity sensor  
+
|[[Microduino-Temp&Hum]] -OR- [[Sensor-Tem&Hum-S2]] ||1||Digital temperature and humidity sensor  
 
|-
 
|-
 
|[[Microduino-Air Quality]] ||1||Air quality detector   
 
|[[Microduino-Air Quality]] ||1||Air quality detector   
Line 44: Line 47:
 
|[[Microduino-Light]] ||1||Light-sensitive sensor   
 
|[[Microduino-Light]] ||1||Light-sensitive sensor   
 
|-
 
|-
|[[GP2Y1010AU0F]] ||1||PM2.5 sensor   
+
|GP2Y1010AU0F ||1||PM2.5 sensor   
 
|}
 
|}
  
Line 62: Line 65:
 
|Shell ||1||
 
|Shell ||1||
 
|}
 
|}
[[File:weatherStationMatiralAll.png||1000px|center]]
+
[[File:weatherStationMatiralAll.png||1000px]]
 +
 
 +
{| class="wikitable" style="background-color:#FEF9E7;"
 +
|'''Note:''' Different revisions will contain different components.
 +
Most noteable are:
 +
*Duo-V will be replaced with a Microduino-Cube-S1.
 +
*Humidity/TempSensor will be replaced with a Tem&Hum-S2.
 +
|}
  
 
==Principle of the Experiment==
 
==Principle of the Experiment==
This Weather Station collects the following:
+
This Weather Station can detect data including:
*Temperature and humidity with a [[Microduino-Temp&Hum]]
+
*Temperature and humidity via [[Microduino-Temp&Hum]]
*Light intensity with a [[Microduino-Light]]
+
*Light intensity via [[Microduino-Light]]
*Air quality with a [[Microduino-Air Quality]]
+
*Air quality via [[Microduino-Air Quality]]
*PM2.5 with a GP2Y1010AU0F module.
+
*PM2.5 via GP2Y1010AU0F
  
  
*Uses a [[Microduino-Core+]] to analyze and process sensor data.   
+
Other functions:
*Display data on a [[Microduino-OLED]]
+
*Use the [[Microduino-Core+]] to analyze and process sensor data.   
*Connect the Weather Station with Blynk via a [[Microduino-WIFI(ESP)]]  
+
*Display data on the [[Microduino-OLED]].
*Each sensor connects with the [[Microduino-Sensorhub]]  
+
*Connect the Weather Station with Blynk via [[Microduino-WIFI(ESP)]].
[[File:Wifistationtheory.jpg||600px|center]]
+
*Each sensor connects with [[Microduino-Sensorhub]].
  
 
==Get and Configure Blynk==
 
==Get and Configure Blynk==
 
Next, we'll learn how Microduino interacts with Blynk through the configuration process of the Weather Station.   
 
Next, we'll learn how Microduino interacts with Blynk through the configuration process of the Weather Station.   
  
===Get Blynk Phone Client===
+
===Download the Blynk App===
*Please follow the getting started with Blynk guide: https://www.blynk.cc/getting-started/
 
  
===Add Configuration Items ===
+
Visit the Google Play Store or the Apple App Store and download the '''Blynk''' app.
  
{| border="0" cellpadding="10" width="100%"
+
You'll need to setup an account with Blynk before proceeding. Please use a valid e-mail as your authentication tokens will be sent to that e-mail.
|-
 
|width="50%" valign="top" align="left"|
 
*Scan the two-dimension code below to get Weather Station APP onto Blynk.  
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkWeatherStationLink.png||300px|center]]
 
|}
 
  
 +
==Using the Blynk App==
  
{| border="0" cellpadding="10" width="100%"
+
*On the main screen of the Blynk app. Click on the '''QR code scanner''' to scan the Weather Station app.  
|-
+
::[[File:wws_qr_scan.png|300px]]
|width="50%" valign="top" align="left"|
 
*Also, you can make your own one.
 
*In this case, you can click the panel and call out '''WIDGET BOX''', on which you can see many choices.  
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting3.png||200px|center]]
 
|}
 
  
  
 +
*Scan the QR code below.
 +
::[[File:Wws_qr_code.png|300px]]
  
{| border="0" cellpadding="10" width="100%"
 
|-
 
|width="50%" valign="top" align="left"|
 
*Add '''Value Display''' item and name "temperature" to display '''Temperature value''' acquired. 
 
*Select V2 on '''INPUT'''; Choose PUSH on '''READING FREQUENCY''', which indicates the temperature is sent from the Weather Station and the frequency is controlled by Microduino Client. 
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting4.png||200px|center]]
 
|}
 
  
 +
*Once the project has loaded, click on '''Project Settings''' (nut icon).
 +
::[[File:wws_project_settings.png|300px]]
  
  
{| border="0" cellpadding="10" width="100%"
+
*Under Auth Tokens, click on '''Email all'''. This will send the authentication token to your registered e-mail. Make note of this, as you will need this token later.
|-
+
::[[File:wws_auth_token.png|300px]]
|width="50%" valign="top" align="left"|
 
The corresponding code at the Microduino Client is: 
 
|width="50%" valign="top" align="left"|
 
<source lang="cpp">
 
void senTempHumi() {
 
  am2321.read();
 
  float sensor_tem = am2321.temperature / 10.0;
 
  float sensor_hum = am2321.humidity / 10.0;
 
  Blynk.virtualWrite(V2, sensor_tem);
 
  Blynk.virtualWrite(V3, sensor_hum);
 
  
  oled(sensor_tem, sensor_hum, sensor_light, sensorPM25, Sensor_etoh);
 
}
 
</source>
 
|}
 
  
 +
*Click back to return to the Weather Station app.
 +
::[[File:Wws_weather_app.png|300px]]
  
 +
==Programming==
  
{| border="0" cellpadding="10" width="100%"
+
===Software Setup===
|-
+
Please follow the guide to ensure your software is correctly setup. The software is required to program the WiFi Weather Station.
|width="50%" valign="top" align="left"|
 
* The setting of the humidity is similar with that of temperature; Set '''INPUT''' as V3 and send it through a timer function " senTempHumi()".
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting5.png||200px|center]]
 
|}
 
  
 +
Download the latest software for your operating system and follow the getting started guides:
 +
{{Clickable software guide boxes}}
 +
{{Clickable_headed_image_table_box_clear}}
  
 +
===Programming the Weather Station===
 +
*Stack '''[[Microduino-Core+]]''' and '''[[Microduino-USBTTL]]''' together. 
 +
*Connect '''[[Microduino-USBTTL]]''' with a USB cable. Connect the other end to the PC being used.
 +
*Open the Arduino IDE for Microduino development environment. (Please refer to the [[#Software Setup]] section).
 +
*Configure the software to upload to the Core+ module as follows:
 +
**Tools > Board > '''Microduino/mCookie-device'''
 +
**Tools > Processor > '''Microduino/mCookie-Core+ (644pa)@16M,5V'''
 +
**Tools > Port > '''select the port''' (On MacOS, NOT the Bluetooth one).
 +
*'''Download'''
 +
**Code for Weather Station here: <big>'''[[File:WiFiWeatherStationV3.zip]]'''</big>
 +
*Unzip the file. Under the software (Arduino IDE), go to '''File > Open...''' and navigate to the unzipped folder and open the '''WiFiWeatherStationV3.ino''' file.
 +
*The sketch with multiple files will open. Click on the '''userDef.h''' tab. You'll need to configure the WiFi connection (2.4GHz networks, non 5GHz) with:
 +
**'''SSID'''
 +
**'''PASS''' (WiFi password)
 +
**'''auth''' key as noted earlier in the Blynk app sent to you via e-mail.
 +
**'''#define ENABLE WIFI'''
 +
***Uncommented: WiFi is enabled. (default)
 +
***Comment out: WiFi is disabled. (Add to 2 slashes to comment out: //#define ENABLE WIFI)
 +
**'''#define ENABLE_FAHRENHEIT'''
 +
***Uncommented: Temperature is displayed in Fahrenheit units. (default)
 +
***Comment out: Temperature is displayed in Celsius units. (Add to 2 slashes to comment out: //#define ENABLE_FAHRENHEIT)
 +
::[[File:Wws_configuration.png|500px]]
 +
*Click on the '''upload button''' (right arrow icon on the top left) to upload the program.
 +
*The program will compile and upload. Once completed a upload successful message will appear on the bottom left.
  
{| border="0" cellpadding="10" width="100%"
+
==Hardware Buildup==
|-
+
===Step 1===
|width="50%" valign="top" align="left"|
+
*Fixate [[Microduino-OLED]] and '''Structure-A1''' with screws.
* The frequency of the timer can be achieved by codes below: 
+
[[File:Waetherstep1.jpg||600px]]
|width="50%" valign="top" align="left"|
 
<source lang="cpp">
 
void senTempHumi() {
 
  SimpleTimer temHumtimer;
 
  temHumtimer.setInterval(2000L, senTempHumi);
 
}
 
</source>
 
|}
 
 
 
 
 
 
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|width="50%" valign="top" align="left"|
 
* Set PM2.5's '''INPUT''' as V6, '''READING FREQUENCY''' as 5s, which represents frequency of the acquired PM2.5 data. 
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting6.png||200px|center]]
 
|}
 
 
 
 
 
 
 
 
 
 
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|width="50%" valign="top" align="left"|
 
* The corresponding code at the Microduino Client is:
 
|width="50%" valign="top" align="left"|
 
<source lang="cpp">
 
BLYNK_READ(V6) {
 
  Blynk.virtualWrite(V6, sensorPM25);
 
}
 
</source>
 
|}
 
 
 
 
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|width="50%" valign="top" align="left"|
 
* Similarly, set the '''INPUT''' of the Light Sensor as V4 and the frequency is to get value every 3s.  
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting7.png||200px|center]]
 
|}
 
  
 +
===Step 2===
 +
*Assemble '''Structure-B1~B5''' with '''Structure-B6'''. 
 +
[[File:Waetherstep2.jpg||600px]]
  
 
+
===Step 3===
 
+
{| class="wikitable" style="background-color:#FEF9E7;"
{| border="0" cellpadding="10" width="100%"
+
|'''Note:''' Different revisions of this kit may contain different components. Either a '''Duo-H''' or '''Cube-S1''' should be used. '''Duo-H''' is illustrated.
|-
 
|width="50%" valign="top" align="left"|
 
* The corresponding code at the Microduino Client is:
 
|width="50%" valign="top" align="left"|
 
<source lang="cpp">
 
BLYNK_READ(V4) {
 
  sensor_light = map(analogRead(A0), 0, 1023, 0, 255);
 
  Blynk.virtualWrite(V4, sensor_light);
 
}
 
</source>
 
 
|}
 
|}
 +
*Fixate [[Microduino-Duo-h]] / Microduino-Cube-S1 on '''Structure-A2''' with screws and nuts. 
 +
*Stack the following modules on [[Microduino-Duo-h]] / Microduino-Cube-S1. 
 +
**[[Microduino-Core+]]
 +
**[[Microduino-USBTTL]]
 +
**[[Microduino-WiFi]]
 +
**[[Microduino-Sensorhub]] (on the very top of the stack)
 +
*Attach the included adhesive strip onto the '''PM2.5 Sensor''' GP2Y1010AU0F, then to the base board. 
 +
[[File:Waetherstep3.jpg||600px]]
  
 
+
===Step 4===
 
+
{| class="wikitable" style="background-color:#FEF9E7;"
 
+
|'''Note:''' Different revisions of this kit may contain different components. Either a '''Temp&Hum''' or '''Tem&Hum-S2''' should be used. '''Temp&Hum''' is illustrated.
{| border="0" cellpadding="10" width="100%"
 
|-
 
|width="50%" valign="top" align="left"|
 
* The '''INPUT''' of the methane gas is V5 and the frequency is to get value every 5s.
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting8.png||200px|center]]
 
 
|}
 
|}
 +
*Assemble the following sensors with '''Structure-B7, B8, B9'''. 
 +
**Temperature and humidity sensor ([[Microduino-Temp&Hum]] / Tem&Hum-S2)
 +
**Air quality detector ([[Microduino-Air Quality]])
 +
**Light sensor ([[Microduino-Light]])
 +
[[File:Waetherstep4.jpg||600px]]
  
 
+
===Step 5===
 
+
{| class="wikitable" style="background-color:#FEF9E7;"
 
+
|'''Note:''' Different revisions of this kit may contain different components. Either a '''Temp&Hum''' or '''Tem&Hum-S2''' should be used. '''Temp&Hum''' is illustrated.
{| border="0" cellpadding="10" width="100%"
 
|-
 
|width="50%" valign="top" align="left"|
 
* The corresponding code at the Microduino Client is: 
 
|width="50%" valign="top" align="left"|
 
<source lang="cpp">
 
BLYNK_READ(V5) {
 
  Sensor_etoh= map(analogRead(A2), 0, 1023, 0, 30);
 
  Blynk.virtualWrite(V5, Sensor_etoh);
 
}
 
</source>
 
 
|}
 
|}
  
 +
*Connect the sensors below to [[Microduino-Sensorhub]] using a '''connector wire'''.
 +
**Temperature and humidity sensor ([[Microduino-Temp&Hum]] / Tem&Hum-S2) to a '''pin IIC'''.
 +
**Air quality detector ([[Microduino-Air Quality]]) to '''pin A2/A3'''.
 +
**Light sensor ([[Microduino-Light]]) to '''pin A0/A1'''.
 +
**PM2.5 to '''pin 4/5'''.
 +
**<span style="background:yellow">OLED screen to a '''pin IIC'''. (Not illustrated).</span>
 +
*Refer to the picture below, stack all sensors on the slot of '''Structure-B1''' and '''Structure-B2'''. 
 +
*After that, connect '''Structure-A1''' and '''Structure-A2''' at the top and bottom of the system respectively. 
 +
[[File:Waetherstep5.jpg||600px]]
  
 +
===Step 6===
 +
*Complete the steps above, plug in a USB cable then fixate '''Structure-B0'''. Congratulations! You finished the buildup of the Weather Station.
  
{| border="0" cellpadding="10" width="100%"
+
===Step 7===
|-
+
*Power on the Weather Station.
|width="50%" valign="top" align="left"|
+
*The Weather Station will connect to the WiFi network. This may take a minute or so.
* See "Button Setting" next.  
+
*After connecting, the OLED screen will display the sensor data.
* Set '''OUTPUT''' as V6 and '''MODE''' as SWITCH, meaning each time you press the button, you can switch electric level of the D6 pin at the Microduino Client.  
+
*If the data does not display, check the serial port in the IDE. It should display debugging information.
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting9.png||200px|center]]
 
|}
 
  
 +
===Step 8===
 +
*If the Weather Station successfully connect to the WiFi network. You can now view the data on the Blynk Phone app.
 +
**WiFi Weather Station successfully connected to the WiFi network.
 +
::[[File:Wws_connected_to_wifi.png|Wws_connected_to_wifi.png]]
  
  
{| border="0" cellpadding="10" width="100%"
+
*Return to your phone which is running Blynk. Open the Weather Station project. Click on Start (play icon).  
|-
+
::[[File:Wws_start_project.png|300px]]
|width="50%" valign="top" align="left"|
 
*For more intuitive data display, you can add one or more '''History Graph'''.
 
*Can be set as data graph displaying V2 and V3. (can achieve four data display at most.)
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting10.png||200px|center]]
 
|}
 
 
 
  
  
{| border="0" cellpadding="10" width="100%"
+
*The sensor data should start streaming to the Blynk app.
|-
+
::[[File:Wws_project_running.png|300px]]
|width="50%" valign="top" align="left"|
 
*The second '''History Graph''' can be used for displaying V6, PM2.5. 
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting11.png||200px|center]]
 
|}
 
 
 
 
 
 
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|width="50%" valign="top" align="left"|
 
*Finally, your phone panel turns into this: 
 
|width="50%" valign="top" align="left"|
 
[[File:BlynkSetting12.png||200px|center]]
 
|}
 
 
 
==Program Download==
 
 
 
Weather Station Code: [https://github.com/Microduino/ESP8266BlynkWeatherStation ESP8266BlynkWeatherStation]
 
 
 
==Programming==
 
*Stack '''[[Microduino-Core+]]''' and '''[[Microduino-USBTTL]]''' together. 
 
**Connect '''[[Microduino-USBTTL]]''' for program uploading with a USB cable. 
 
**Attention: Please upload programs before stacking all modules together. 
 
*Open Arduino IDE for Microduino development environment. (Please refer to: '''[[AVR Core:Getting started]]''')
 
*Click '''【Tool】''', make sure the right ''' board card(Microduino-Core+) and processor(Atmega644pa@16M,5V)''', select the corresponding '''port (COMX) '''.   
 
*Click'''【File】'''->'''【Open】''', scan to the program address, click '''"ESP8266BlynkWeatherStation.ino"''' and open it. 
 
*After that, please click the button '''"→"''' to upload programs to the development board. 
 
 
 
==Hardware Buildup==
 
*Step1
 
**Fixate [[Microduino-OLED]] and '''Structure-A1''' with screws. 
 
[[File:Waetherstep1.jpg||600px|center]]
 
*Step2
 
**Assemble '''Structure-B1~B5''' with '''Structure-B6'''. 
 
[[File:Waetherstep2.jpg||600px|center]]
 
 
 
*Step3
 
**Fixate [[Microduino-Duo-h]] on '''Structure-A2''' with screws and nuts. 
 
**Stack the following modules on [[Microduino-Duo-h]]. 
 
***[[Microduino-Core+]]
 
***[[Microduino-USBTTL]]
 
***[[Microduino-Sensorhub]]
 
**Stick the well prepared'''PM2.5 Sensor'''[[GP2Y1010AU0F]] to the base board. 
 
[[File:Waetherstep3.jpg||600px|center]]
 
 
 
*Step4
 
**Assemble the following sensors with '''Structure-B7, B8, B9'''. 
 
***Temperature and humidity sensor[[Microduino-Temp&Hum]]
 
***Air quality detector[[Microduino-Air Quality]]
 
***Light sensor[[Microduino-Light]]
 
[[File:Waetherstep4.jpg||600px|center]]
 
*Step5
 
**Connect the sensors below to [[Microduino-Sensorhub]].
 
***Temperature and humidity sensor[[Microduino-Temp&Hum]]
 
***Air quality detector[[Microduino-Air Quality]]
 
***Light sensor[[Microduino-Light]]
 
**Refer to the picture below, stack all sensors on the slot of '''Structure-B1''' and '''Structure-B2'''. 
 
**After that, connect '''Structure-A1''' and '''Structure-A2''' at the top and bottom of the system respectively. 
 
[[File:Waetherstep5.jpg||600px|center]]
 
 
 
*Step6
 
**Complete the steps above, then fixate with '''Structure-B0''' and plug in a USB cable. Congratulations! You just finished the buildup of the Weather Station.   
 
 
 
*Step7
 
**You can see sensor data on [[Microduino-OLED]] after setting. 
 
**At the same time, you can also see uploaded data of the Weather Station on your phone Blynk. 
 
[[File:BlynkSetting13.png||300px|center]]
 
  
 
==Notes==
 
==Notes==
 
*Please make sure the verification code is configured right.   
 
*Please make sure the verification code is configured right.   
*Make sure your router runs normally, the SSID and password are correct.
+
*Make sure your router runs normally, the SSID and password are correct.
 
 
|}
 

Revision as of 22:01, 19 April 2019

Outline

  • Project: Open Source WIFI Weather Station System.(ESP8266 connected to Blynk)
  • Objective: To get temperature, humidity, light intensity and PM2.5 at the weather station.
    • Note: PM2.5 refers to atmospheric particulate matter (PM) that have a diameter of less than 2.5 micrometers
  • Difficulty: Medium
  • Time-consuming: 2-Hour
  • Maker: Ray

Introduction:

  • Read temperature, humidity, light intensity and PM2.5 data and display those data on the screen.
  • Upload the data to Blynk.
  • View data on phone anywhere using the Blynk app.
  • Created by Microduino with Microduino components.

Bill of Material

Microduino Equipment

Note: Different revisions may contain different components.
Module Number Function
Microduino-Core+ 1 Core board (Arduino)
Microduino-USBTTL -OR- Microduino-USBTLL-C 1 Programmer for Core board
Microduino-WIFI(ESP) 1 WiFi communication module
Microduino-Sensorhub 1 Connector Hub to connect sensors
Microduino-Duo-h -OR- Microduino-Cube-S1 1 Extension board
Microduino-OLED 1 Display
Sensor Number Function
Microduino-Temp&Hum -OR- Sensor-Tem&Hum-S2 1 Digital temperature and humidity sensor
Microduino-Air Quality 1 Air quality detector
Microduino-Light 1 Light-sensitive sensor
GP2Y1010AU0F 1 PM2.5 sensor

Other Equipment

Equipment Number Function
Micro-USB cable 1 For program download and power supply
GP2Y1010AU0F 1 PM2.5 sensor
Screw 7 Fixate modules
Screwdriver 1 Fixate screws
Shell 1

WeatherStationMatiralAll.png

Note: Different revisions will contain different components.

Most noteable are:

  • Duo-V will be replaced with a Microduino-Cube-S1.
  • Humidity/TempSensor will be replaced with a Tem&Hum-S2.

Principle of the Experiment

This Weather Station can detect data including:


Other functions:

Get and Configure Blynk

Next, we'll learn how Microduino interacts with Blynk through the configuration process of the Weather Station.

Download the Blynk App

Visit the Google Play Store or the Apple App Store and download the Blynk app.

You'll need to setup an account with Blynk before proceeding. Please use a valid e-mail as your authentication tokens will be sent to that e-mail.

Using the Blynk App

  • On the main screen of the Blynk app. Click on the QR code scanner to scan the Weather Station app.
Wws qr scan.png


  • Scan the QR code below.
Wws qr code.png


  • Once the project has loaded, click on Project Settings (nut icon).
Wws project settings.png


  • Under Auth Tokens, click on Email all. This will send the authentication token to your registered e-mail. Make note of this, as you will need this token later.
Wws auth token.png


  • Click back to return to the Weather Station app.
Wws weather app.png

Programming

Software Setup

Please follow the guide to ensure your software is correctly setup. The software is required to program the WiFi Weather Station.

Download the latest software for your operating system and follow the getting started guides:

Windows
MicroduinoGettingStart-ForWindows.jpg
IDE Install Guide for Windows
MAC
MicroduinoGettingStart-ForMAC.jpg
IDE Install Guide for MAC

Programming the Weather Station

  • Stack Microduino-Core+ and Microduino-USBTTL together.
  • Connect Microduino-USBTTL with a USB cable. Connect the other end to the PC being used.
  • Open the Arduino IDE for Microduino development environment. (Please refer to the #Software Setup section).
  • Configure the software to upload to the Core+ module as follows:
    • Tools > Board > Microduino/mCookie-device
    • Tools > Processor > Microduino/mCookie-Core+ (644pa)@16M,5V
    • Tools > Port > select the port (On MacOS, NOT the Bluetooth one).
  • Download
  • Unzip the file. Under the software (Arduino IDE), go to File > Open... and navigate to the unzipped folder and open the WiFiWeatherStationV3.ino file.
  • The sketch with multiple files will open. Click on the userDef.h tab. You'll need to configure the WiFi connection (2.4GHz networks, non 5GHz) with:
    • SSID
    • PASS (WiFi password)
    • auth key as noted earlier in the Blynk app sent to you via e-mail.
    • #define ENABLE WIFI
      • Uncommented: WiFi is enabled. (default)
      • Comment out: WiFi is disabled. (Add to 2 slashes to comment out: //#define ENABLE WIFI)
    • #define ENABLE_FAHRENHEIT
      • Uncommented: Temperature is displayed in Fahrenheit units. (default)
      • Comment out: Temperature is displayed in Celsius units. (Add to 2 slashes to comment out: //#define ENABLE_FAHRENHEIT)
Wws configuration.png
  • Click on the upload button (right arrow icon on the top left) to upload the program.
  • The program will compile and upload. Once completed a upload successful message will appear on the bottom left.

Hardware Buildup

Step 1

Waetherstep1.jpg

Step 2

  • Assemble Structure-B1~B5 with Structure-B6.

Waetherstep2.jpg

Step 3

Note: Different revisions of this kit may contain different components. Either a Duo-H or Cube-S1 should be used. Duo-H is illustrated.

Waetherstep3.jpg

Step 4

Note: Different revisions of this kit may contain different components. Either a Temp&Hum or Tem&Hum-S2 should be used. Temp&Hum is illustrated.

Waetherstep4.jpg

Step 5

Note: Different revisions of this kit may contain different components. Either a Temp&Hum or Tem&Hum-S2 should be used. Temp&Hum is illustrated.
  • Connect the sensors below to Microduino-Sensorhub using a connector wire.
  • Refer to the picture below, stack all sensors on the slot of Structure-B1 and Structure-B2.
  • After that, connect Structure-A1 and Structure-A2 at the top and bottom of the system respectively.

Waetherstep5.jpg

Step 6

  • Complete the steps above, plug in a USB cable then fixate Structure-B0. Congratulations! You finished the buildup of the Weather Station.

Step 7

  • Power on the Weather Station.
  • The Weather Station will connect to the WiFi network. This may take a minute or so.
  • After connecting, the OLED screen will display the sensor data.
  • If the data does not display, check the serial port in the IDE. It should display debugging information.

Step 8

  • If the Weather Station successfully connect to the WiFi network. You can now view the data on the Blynk Phone app.
    • WiFi Weather Station successfully connected to the WiFi network.
Wws_connected_to_wifi.png


  • Return to your phone which is running Blynk. Open the Weather Station project. Click on Start (play icon).
Wws start project.png


  • The sensor data should start streaming to the Blynk app.
Wws project running.png

Notes

  • Please make sure the verification code is configured right.
  • Make sure your router runs normally, the SSID and password are correct.