element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Shift it! Warehouse Automation Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Shift it! Warehouse Automation Design Challenge
  • More
  • Cancel
Shift it! Warehouse Automation Design Challenge
Forum Integrating Blynk to Arduino MKR WiFi 1010
  • News
  • Forum
  • Projects
  • Leaderboard
  • Files
  • Members
  • Mentions
  • More
  • Cancel
  • New
Join Shift it! Warehouse Automation Design Challenge to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 41 subscribers
  • Views 70 views
  • Users 0 members are here
  • Shift it! Warehouse Automation Design Challenge
Related

Integrating Blynk to Arduino MKR WiFi 1010

taifur
taifur 1 month ago

In this stage I integrated the Blynk cloud to the Arduino MKR WiFi 1010 board. I downloaded the latest release of the Blynk library from the link: https://github.com/blynkkk/blynk-library/releases. 

image

I created a template and made a dashboard for visualizing the sensors data. Initially I included temperature, humidity and air quality reading in the dashboard shown in the screenshot below.  

image

Then for programming I started with the example program for Arduino MKR 1010 board that is included in the blynk library. 

image

I made all the necessary modification in the code and uploaded the code to the Arduino MKR board. 

image

This is the arduino program that sends the sensor reading every three seconds in the blynk cloud.

//#define BLYNK_PRINT Serial

/* Fill in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "TMPL6ZkZE1Xre"
#define BLYNK_TEMPLATE_NAME "warehouse monitoring"
#define BLYNK_AUTH_TOKEN "PNyrxA02ZuutaYsfYdUJMj1x_jCM9gLx"


#include <SPI.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>
#include "DHT.h"
#include "Air_Quality_Sensor.h"

BlynkTimer timer;

#define DHTPIN 2
AirQualitySensor air_sensor(A0);

#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "*************"; //put your wifi name
char pass[] = "*************"; //put your wifi password

float temperature, humidity;
String air_quality = ""; 

void send_to_blynk()
{
  read_temp_humidity(); //read temperature & humidity
  read_air();           //read air quality
  Blynk.virtualWrite(V0, temperature);
  Blynk.virtualWrite(V1, humidity);
  Blynk.virtualWrite(V2, air_quality);
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  // You can also specify server:
  //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, IPAddress(192,168,1,100), 8080);
  dht.begin();
  air_sensor.init();
  timer.setInterval(3000L, send_to_blynk); //call in every three seconds
}

void read_temp_humidity(){
  temperature = dht.readHumidity();
  // Read temperature as Celsius (the default)
  humidity = dht.readTemperature();
}

void read_air(){
  int quality = air_sensor.slope(); 
  if (quality == AirQualitySensor::FORCE_SIGNAL) {
      air_quality = "High pollution!";
  } else if (quality == AirQualitySensor::HIGH_POLLUTION) {
      air_quality = "High pollution!";
  } else if (quality == AirQualitySensor::LOW_POLLUTION) {
      air_quality = "Low pollution!";
  } else if (quality == AirQualitySensor::FRESH_AIR) {
      air_quality = "Fresh air.";
  }
}

void loop()
{
  Blynk.run();
  timer.run(); 
}
 

  • Sign in to reply
  • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube