Difference between revisions of "Open Source WIFI Weather Station System.(ESP8266 connected to Blynk)"
From Microduino Wiki
(→Outline) |
(→Programming and Uploading) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
*Objective: To get temperature, humidity, light intensity and even PM2.5 data around you. | *Objective: To get temperature, humidity, light intensity and even PM2.5 data around you. | ||
*Difficulty: Medium | *Difficulty: Medium | ||
− | *Time | + | *Project Time: 2 Hours |
− | * | + | *Creator: Ray |
Introduction: | Introduction: | ||
Line 65: | Line 65: | ||
==Principle of the Experiment== | ==Principle of the Experiment== | ||
− | This Weather Station | + | This Weather Station collects the following: |
− | *Temperature and humidity | + | *Temperature and humidity with a [[Microduino-Temp&Hum]] |
− | *Light intensity | + | *Light intensity with a [[Microduino-Light]] |
− | *Air quality | + | *Air quality with a [[Microduino-Air Quality]] |
− | *PM2.5 | + | *PM2.5 with a GP2Y1010AU0F module. |
− | * | + | *Uses a [[Microduino-Core+]] to analyze and process sensor data. |
− | *Display on [[Microduino-OLED]] | + | *Display data on a [[Microduino-OLED]] |
− | *Connect the Weather Station with Blynk via [[Microduino-WIFI(ESP)]] | + | *Connect the Weather Station with Blynk via a [[Microduino-WIFI(ESP)]] |
− | *Each sensor connects with [[Microduino-Sensorhub]] | + | *Each sensor connects with the [[Microduino-Sensorhub]] |
[[File:Wifistationtheory.jpg||600px|center]] | [[File:Wifistationtheory.jpg||600px|center]] | ||
Line 85: | Line 85: | ||
===Add Configuration Items === | ===Add Configuration Items === | ||
− | * | + | *Scan the two-dimension code below to get Weather Station APP onto Blynk. |
[[File:BlynkWeatherStationLink.png||300px|center]] | [[File:BlynkWeatherStationLink.png||300px|center]] | ||
*Also, you can make your own one. | *Also, you can make your own one. | ||
Line 151: | Line 151: | ||
[[File:BlynkSetting12.png||200px|center]] | [[File:BlynkSetting12.png||200px|center]] | ||
− | == | + | ==Programming and Uploading== |
Weather Station Code: [https://github.com/Microduino/ESP8266BlynkWeatherStation ESP8266BlynkWeatherStation] | Weather Station Code: [https://github.com/Microduino/ESP8266BlynkWeatherStation ESP8266BlynkWeatherStation] | ||
− | + | *Stack the '''[[Microduino-Core+]]''' and the '''[[Microduino-USBTTL]]''' together. | |
− | *Stack '''[[Microduino-Core+]]''' and '''[[Microduino-USBTTL]]''' together. | + | **Connect the '''[[Microduino-USBTTL]]''' to your computer with the included MicroUSB cable. |
− | **Connect '''[[Microduino-USBTTL]]''' | + | **<span style="color:red">Attention: Please upload program before stacking all modules together. As having the WiFi module connected will cause programming issues.<span> |
− | **Attention: Please upload | + | |
− | * | + | |
− | + | *Follow the software setup guide for your OS at: http://wiki.microduinoinc.com/Software_Setup:_Arduino | |
− | * | + | *Once your software is successfully installed, open the software. |
− | * | + | *Configure the software to program the Core+ module: |
+ | ** Select '''Tools > Board > Microduino/mCookie-device''' (for Windows) or '''Tools > Board > Microduino/mCookie-Core+ (644pa)''' (for Mac OS). | ||
+ | ** Select '''Tools > Processor > Microduino/mCookie Core+ (644pa)@16M,5V''' (for Windows) or '''Tools > Board > Atmega644pa@16M,5V''' (for Mac OS). | ||
+ | ** Select '''Tools > Port''' (Usually what is selectable, if using Mac, it is not the Bluetooth one). | ||
+ | |||
+ | |||
+ | *Download the code for Weather Station here: [[File:ESP8266BlynkWeatherStationV2.zip]] | ||
+ | *Unzip the file. Under the software (Arduino IDE), go to '''File > Open...''' and navigate to the unzipped folder and open the '''ESP8266BlynkWeatherStation.ino''' file. | ||
+ | *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== | ==Hardware Buildup== |
Latest revision as of 19:13, 17 April 2018
ContentsOutline
Introduction:
Bill of MaterialMicroduino Equipment
Other Equipment
Principle of the ExperimentThis Weather Station collects the following:
Get and Configure BlynkNext, we'll learn how Microduino interacts with Blynk through the configuration process of the Weather Station. Getting Started with Blynk
Add Configuration Items
The corresponding code at the Microduino Client is: 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);
}
The frequency of the timer can be achieved by codes below: void senTempHumi() {
SimpleTimer temHumtimer;
temHumtimer.setInterval(2000L, senTempHumi);
}
The corresponding code at the Microduino Client is: BLYNK_READ(V6) {
Blynk.virtualWrite(V6, sensorPM25);
}
The corresponding code at the Microduino Client is: BLYNK_READ(V4) {
sensor_light = map(analogRead(A0), 0, 1023, 0, 255);
Blynk.virtualWrite(V4, sensor_light);
}
The corresponding code at the Microduino Client is: BLYNK_READ(V5) {
Sensor_etoh= map(analogRead(A2), 0, 1023, 0, 30);
Blynk.virtualWrite(V5, Sensor_etoh);
}
Programming and UploadingWeather Station Code: ESP8266BlynkWeatherStation
Hardware Buildup
Notes
|