Brittany Bull
Published © MIT

Blynk Weather Station

Receive weather updates directly to your mobile device from your very own weather station! Astonishingly quick & easy build with ☒CHIPS.

EasyFull instructions provided5 minutes1,918
Blynk Weather Station

Things used in this project

Hardware components

CW01
XinaBox CW01
×1
SW01
XinaBox SW01
×1
XinaBox SL01
×1
OD01
XinaBox OD01
×1
IP01
XinaBox IP01
×1
XC10
XinaBox XC10
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Story

Read more

Code

Blynk_Weather_Station.ino

Arduino
Arduino code for Weather Station with Blynk and xCHIPS. This code allows you to wirelessly control the weather station from your mobile device and receive weather data updates straight to your mobile device from the xCHIP weather station
#include <xCore.h>                    //include core library
#include <xSW01.h>                    //include weather sensor library
#include <xSL01.h>                    //include light sensor library
#include <ESP8266WiFi.h>              //include ESP8266 library for WiFi
#include <BlynkSimpleEsp8266.h>       //include Blynk library for use with ESP8266
#include <xOD01.h>                    //include OLED library

xSW01 SW01;
//xSL01 SL01;
float TempC;
float Humidity;
float UVA;
float UV_Index;

// authentication token that was emailed to you
// copy and paste the token between double quotes
char auth[] = "your auth token";

// your wifi credentials
char WIFI_SSID[] = "your WiFi name";         // enter your wifi name between the double quotes
char WIFI_PASS[] = "your WiFi password";        // enter your wifi password between the double quotes



BlynkTimer timer;


  // VirtualPin for Temperature
  
  BLYNK_WRITE(V2){
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  if(pinValue == 1) {
  Blynk.virtualWrite(V1, TempC);
  OD01.println("Temp_C:");
  OD01.println(TempC);
  } 
  else{
     
  }

  }
  
  // VirtualPin for Humidity
  
  BLYNK_WRITE(V4){
  int pin_value = param.asInt(); // assigning incoming value from pin V3 to a variable
  if(pin_value == 1) {
  Blynk.virtualWrite(V3, Humidity);
  OD01.println("Humidity:");
  OD01.println(Humidity);
  } 
  else{
     
  }

  }

// VirtualPin for UVA
  
  BLYNK_WRITE(V6){
  int pinvalue = param.asInt(); // assigning incoming value from pin V5 to a variable
  if(pinvalue == 1) {
  Blynk.virtualWrite(V5, UVA);
  OD01.println("UVA:");
  OD01.println(UVA);
  } 
  else{
     
  }

  }
  // VirtualPin for UV_Index
  
  BLYNK_WRITE(V8){
  int pin_Value = param.asInt(); // assigning incoming value from pin V7 to a variable
  if(pin_Value == 1) {
  Blynk.virtualWrite(V7, UV_Index);
  OD01.println("UV_Index:");
  OD01.println(UV_Index);
  } 
  else{
     
  }

  }
  

void setup() 
{
  // Debug console
  TempC = 0;
  Serial.begin(115200);
  Wire.begin(2, 14);
  SW01.begin();
  OLED.begin();
  SL01.begin();
  Blynk.begin(auth, WIFI_SSID, WIFI_PASS);
  delay(2000);

}

void loop() 
{
  
  SW01.poll();
  TempC = SW01.getTempC(); 
  Humidity = SW01.getHumidity();
  SL01.poll();
  UVA = SL01.getUVA();
  UV_Index = SL01.getUV Index();
  Blynk.run();
  

}

Credits

Brittany Bull

Brittany Bull

12 projects • 5 followers
A student exploring the world of coding and IoT from a beginners' perspective

Comments