element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
Sensors Projects
  • Challenges & Projects
  • Project14
  • Sensors Projects
  • More
  • Cancel
Sensors Projects
Blog Wio Terminal Sensor Fusion - Remote Data Display and Control using Blynk
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 9 Nov 2020 12:07 AM Date Created
  • Views 2362 views
  • Likes 4 likes
  • Comments 0 comments
  • sensorsch
  • blynk
  • neopixel
  • ms8607
  • wio terminal
Related
Recommended

Wio Terminal Sensor Fusion - Remote Data Display and Control using Blynk

ralphjy
ralphjy
9 Nov 2020
image

Sensors

Enter Your Electronics & Design Project for a chance to win a $200 shopping cart!

Submit an EntrySubmit an Entry  Back to homepage image
Project14 Home
Monthly Themes
Monthly Theme Poll

 

The Wio Terminal has both WiFi and Bluetooth capability and I thought that I'd demonstrate both of those features using the Blynk application running on my Android tablet.  Blynk is an IOT platform that allows you to create simple projects that allow interaction between mobile devices and IOT hardware via WiFi and Bluetooth https://blynk.io/en/getting-started .

 

Using Blynk is very straightforward and doesn't require any coding on the mobile device.

 

Here's a quick description of the steps involved.

  • Download the Blynk mobile app - in my case I downloaded it from the Google Play Store for my Android tablet
  • Create a new account in the app - just requires a valid email address
  • Create a new project - need to specify connection method and device type
  • Get Auth Token - this is automatically generated and emailed to you when the project is created
  • Install Blynk Library in device IDE - in my case I'm using the Arduino IDE and I installed Blynk version 0.6.1 using the Library Manager (there are libraries available in other programming languages besides C++)
  • Create the device program and include the Auth Token (also need to include BlynkSimpleWioTerminal.h which includes the Blynk library) - there were both WiFi and Bluetooth examples available for the Wio Terminal https://wiki.seeedstudio.com/Wio-Terminal-Blynk/

 

WiFi Test

To demonstrate WiFi connectivity I'm going to modify my MS8607 program to send data via WiFi to the Blynk app.

 

I created the project configured to use WiFi (I selected Arduino Uno for the device since the Wio Terminal isn't listed).

image

 

Then added 3 Value Display widgets to display the MS8607 measurements ( simply drag and drop the widgets on the project window).

image

The widgets are configured to use Virtual Pins.

image

 

Here is a screen capture of the project display window from the tablet.

image

 

Here is a quick video of the data tracking.  I perturbed the readings by touching the sensor but it seems it affected humidity the most.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Arduino code

Wio_Terminal_Blynk_Temperature.ino

 

#define BLYNK_PRINT Serial

#include <AtWiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleWioTerminal.h>
#include <Wire.h>
#include <Adafruit_MS8607.h>
#include <Adafruit_Sensor.h>
#include <TFT_eSPI.h>

#if defined(ARDUINO_ARCH_AVR)
    #define debug  Serial

#elif defined(ARDUINO_ARCH_SAMD) ||  defined(ARDUINO_ARCH_SAM)
    #define debug  SerialUSB
#else
    #define debug  Serial
#endif

Adafruit_MS8607 ms8607;
TFT_eSPI tft = TFT_eSPI();

// Your WiFi credentials.
const char* ssid = "xxxxxxxx";
const char* pass = "yyyyyyyy";

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "aaaaaaaaaaaa";

BlynkTimer timer;

void sendTemperature() {
  float tempC, tempF, humid, press;
  sensors_event_t temp, pressure, humidity;
  ms8607.getEvent(&pressure, &temp, &humidity);

  tempC = temp.temperature;
  tempF = tempC * 9 / 5 + 32;
  humid = humidity.relative_humidity;
  press = pressure.pressure;
  
  // Display values
  tft.setTextSize(2);

  tft.drawString("Temperature: ",20, 55, 1);
  tft.drawString("Humidity: ", 20, 100, 1);
  tft.drawString("Pressure: ", 20, 145, 1);

  tft.setTextDatum(TR_DATUM);
  tft.setTextPadding(tft.textWidth("999", 1));
  tft.drawNumber(tempF, 255, 55, 1);
  tft.drawNumber(humid, 255, 100, 1);
  tft.setTextPadding(tft.textWidth("99999", 1));
  tft.drawNumber(press, 255, 145, 1);
  tft.setTextPadding(0);
  tft.setTextDatum(TL_DATUM);

  tft.drawString("F", 265, 55, 1);
  tft.drawString("%rH", 265, 100, 1);
  tft.drawString("hPa", 265, 145, 1);  

  // Send to Blynk
  // Format: 1 decimal place, add F
  String str = String(tempF, 1) + " F";
  // Send it to the server
  Blynk.virtualWrite(V0, str);
  // Format: 1 decimal place, add %rH
  str = String(humid, 1) + " %rH";
  // Send it to the server
  Blynk.virtualWrite(V1, str);  
  // Format: 1 decimal place, add hPa
  str = String(press, 0) + " hPa";
  // Send it to the server
  Blynk.virtualWrite(V2, str);  
}

void setup() {
  // Debug console
  debug.begin(115200);
  debug.println("MS8607 Blynk test!");

  tft.init();
  tft.setRotation(3);
  tft.fillScreen(TFT_BLACK);
  tft.setTextSize(1);
  tft.setTextColor(TFT_WHITE, TFT_BLACK);  // Adding a background color erases previous text automatically
  tft.setTextSize(2);
  tft.setTextDatum(TC_DATUM);
  tft.drawString("MS8607 Readings",160, 15, 1);
  tft.setTextDatum(TL_DATUM);  


// Try to initialize!
  if (!ms8607.begin()) {
    debug.println("Failed to find MS8607 chip");
    while (1) { delay(10); }
  }
  debug.println("MS8607 Found!");
      
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(1000L, sendTemperature);
}

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

 

 

No BLE Test yet image

I had planned including a BLE test to control the NeoPixel strip from Blynk in this post but I'm running into a compile error, I'll post when I resolve it.  Seems like a simple problem of missing an include file Seeed_erpcUnified.h but I'm having no luck locating it.  I'm sure one of the Seeed support people will tell me what I forgot to install.

 

Blynk observations

I've used Blynk before but it seems like the app has improved quite a bit (certainly has more widgets and supported boards).  It is free if you stay within your "Energy Balance".  You'll notice that each widget has a value that shows how much energy is consumed when a widget is used, e.g. each Value Display used 200 units.  You get 2000 units for free and need to buy energy beyond that.  If you delete projects/widgets you recover the "Energy" used so if you're using Blynk for prototyping it probably isn't an issue.  The pricing otherwise is indicated in the app.  Very convenient to use.  I'm starting to learn Kotlin with Android Studio so I'll probably create my own permanent apps.

image

 

Links to related posts

Wio Terminal Sensor Fusion - Introduction

Wio Terminal Sensor Fusion - Sensor Integration

  • Sign in to reply
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