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
IoT: In the Cloud
  • Challenges & Projects
  • Project14
  • IoT: In the Cloud
  • More
  • Cancel
IoT: In the Cloud
Blog Manage Arduino MKR WIFI 1010 Battery Life in the Cloud - AWS, Graphs and Alerts
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join IoT: In the Cloud to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 22 Mar 2019 3:43 PM Date Created
  • Views 1737 views
  • Likes 11 likes
  • Comments 5 comments
  • sql
  • mqtt
  • mkr_1010
  • p14 mkr 1010
  • arduino_iot_cloud
  • arduino_mkr_wifi_1010
  • aws
  • iotcloudch
  • arduino
Related
Recommended

Manage Arduino MKR WIFI 1010 Battery Life in the Cloud - AWS, Graphs and Alerts

Jan Cumps
Jan Cumps
22 Mar 2019

My project for Arduino Day 2019 is an autonomous sensor device that reports its battery status to Amazon Web Services.

It uses AWS for data insight, graphs and to indicate how long it's expected to continue living without charging.

It raises an email alarm at near death.

 

This post shows the AWS modules used to store, report and mail, and how they interact.

image

 

The connectivity to AWS - safe, with certificate authentication - is covered in its own blog post.

 

The activities I explain here are:

  • Receive metrics from Arduino
  • Enrich the data, add calculations for reporting and alerting
  • Store the enriched data
  • Report and Graph on the stored data
  • Alert on low battery

 

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

 

Receive

In this part, the data arrives in the AWS domain

 

The messages from the Arduino arrive in the AWS IoT Core module, on the MQTT server, as a JSON payload

 

image

 

If we don't do anything, the data will get lost. We'll use rules in the same module to decide what to do with the data.

 

Enrich

In this part, we calculate the timestamp of arrival and the active time left in the battery.

 

A rule subscribes to the MQTT topic. It uses SQL to calculate additional info.

That data is then sent onwards for the two different functions:

  • to AWS IoT Analytics for data collection
  • to a new MQTT topic, to prime the alerting functions.

 

image

 

Store

In this part, the enriched data is sent ot AWS IoT Analytics, where it is stored for later reporting.

 

AWS has several storage options. I'm using a data set in the IoT Analytics module here.

The rule from the previous section streams the data, via a data channel, to the data set.

It's stored here for as long as you define, and can be used in the reporting module later on.

 

image

You can configure the refresh rate of the data set. If you don't set that up, refresh can be done from the web console.

MQTT messages are volatile. If you want to work with your gizmo's data later on, take care to use one of the AWS services to persist it.

 

 

Report and Graph

In AWS Quicksight, I retrieve the data from IoT analytics. It can be presented, analyzed and shared in various formats.

 

While most of the other modules get data pushed, the reporting module pulls data from the IoT Analytics data set.

 

image

You can create dashboards, snapshots, etc...

The capture below shows the battery charge % over time, and a silly pie chart with number of messages per charge %.

image

 

Alert

The AWS SNS (Simple Notification Service)  can send push notifications.

It supports messages to a phone, mails and (also external) web services.

 

I set up an sql filter in IoT Core to only call a rule when the battery authonomy is below 1 day.

When that rule is triggered, it sends the MQTT payload to an SNS topic.

 

 

image

In SNS, I subscribe to that topic The subscription is configured to shoot a mail to my personal mailbox.

 

image

I selected RAW format when moving data to SNS. That's why you see the raw payload in the contents.

 

 

Tutorials

 

If you want to make a similar setup, you can check these tutorials and how-to's:

 

image

image: tutorial map

 

  • red area -connect: Arduino MKR WIFI 1010 and Amazon Web Services: Safe MQTT with SSL and Certificate
  • yellow area - receive and report, subscription required: IoT Foundation: Telemetry and Internet of Things Foundation Series
  • green area - alert: Set Up Email Alerts

 

Try it!

 

related blog posts
Manage Arduino MKR WIFI 1010 Battery Life in the Cloud - How Long until the Next Recharge?
Arduino MKR WIFI 1010 and Amazon Web Services: Safe MQTT with SSL and Certificate
Project14 | IoT in the Cloud: Make Use of a Wireless Technology and a Cloud Provider!
Keithley DMM6500: Measure Amp-Hours of an Arduino MKR WIFI 1010
Manage Arduino MKR WIFI 1010 Battery Life in the Cloud - AWS, Graphs and Alerts
Arduino MKR 10xx, ETH Shield and Amazon Web Services: Safe MQTT with SSL and Certificate
  • Sign in to reply

Top Comments

  • aabhas
    aabhas over 6 years ago +1
    Very nice idea Jan Cumps Aabhas Senapati
  • kiri-ll
    kiri-ll over 6 years ago +1
    That's a very good description of what you did! Personally, I would also like to read *how* you did Your decision making, how you hit into problems and solve them, what you like or dislike on some implementation…
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to kiri-ll +1
    kiri-ll wrote: That's a very good description of what you did! Personally, I would also like to read *how* you did Your decision making, how you hit into problems and solve them, what you like or dislike…
  • kiri-ll
    kiri-ll over 6 years ago in reply to Jan Cumps

    Thanks for your answer! I think I need to read a book

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to kiri-ll

    kiri-ll  wrote:

     

    That's a very good description of what you did! Personally, I would also like to read *how* you did image

    Your decision making, how you hit into problems and solve them, what you like or dislike on some implementation steps. Your thoughts and your feeling, which made this project an adventure.

     

    I understand, that it is not fair to expect something like this from anyone. You are the author, so I should not teach how to tell *your* story. You can throw tomatoes at me, and I will agree with it. Or, you can throw me exciting details, and I will enjoy it image

    I deliberately did not tell the how, because I exactly folowed the tutorials that I linked to in the Tutorials section. I can’t replicate a 2 1/2 hour online training in a blog post.

     

    However, the video that I embedded reviews most of my the AWS setup.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kiri-ll
    kiri-ll over 6 years ago

    That's a very good description of what you did! Personally, I would also like to read *how* you did image

    Your decision making, how you hit into problems and solve them, what you like or dislike on some implementation steps. Your thoughts and your feeling, which made this project an adventure.

     

    I understand, that it is not fair to expect something like this from anyone. You are the author, so I should not teach how to tell *your* story. You can throw tomatoes at me, and I will agree with it. Or, you can throw me exciting details, and I will enjoy it image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • aabhas
    aabhas over 6 years ago

    Very nice idea Jan Cumps

    Aabhas Senapati

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 6 years ago

    Very good update Jan.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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