Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Internet of Things with Arduino Cookbook
Internet of Things with Arduino Cookbook

Internet of Things with Arduino Cookbook: Build exciting IoT projects using the Arduino platform

Arrow left icon
Profile Icon Marco Schwartz
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (2 Ratings)
Paperback Sep 2016 188 pages 1st Edition
eBook
$20.98 $29.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Marco Schwartz
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (2 Ratings)
Paperback Sep 2016 188 pages 1st Edition
eBook
$20.98 $29.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$20.98 $29.99
Paperback
$38.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Internet of Things with Arduino Cookbook

Chapter 2. Cloud Data Monitoring

In this chapter, we will cover:

  • Internet of Things platforms for Arduino
  • Connecting sensors to your Arduino board
  • Posting the sensor data online
  • Retrieving your online data
  • Monitoring sensor data from a cloud dashboard
  • Monitoring several Arduino boards at once
  • Troubleshooting issues with cloud data monitoring

Introduction

One of the most important things you can do with an Internet of Things project is to send data online, so it can be stored, retrieved later, and plotted inside a nice dashboard. Of course, it needs to be accessible from any web browser or application in the world.

In this chapter, this is exactly what we are going to do with Arduino. We are going to use an Arduino board to log sensor data online, and then we'll see how to exploit this data. We are first going to get an overview of what options are available when you want to log data online from an Arduino project. Then, we are going to connect sensors to the Arduino board, and log this data online. Finally, we'll see how to access this data, plot it, and also visualize data coming from several boards at once.

Internet of Things platforms for Arduino

In the first recipe of this chapter, we are going to see the different platforms that are available for us, if we want to store data online from an Arduino project. We'll see what are the strengths and the weaknesses of each platform, so we can make a choice for the rest of this chapter.

Available platforms

The first platform that I wanted to mention here is called Dweet.io. You can learn more about it at:

https://dweet.io/

Available platforms

Dweet.io is basically a simple API that can be called from any web browser or application, and it is so simple to use that even a human can use it without problems! It's really easy to store data there from an Arduino project, and then to retrieve this data using other applications.

The next platform I wanted to mention here is Xively. This is the main page of Xively:

https://xively.com/

Available platforms

Xively is a complete IoT platform, which is more dedicated to the business world than Dweet.io, for example. It includes more functions...

Connecting sensors to your Arduino board

In this recipe, we are going to build the project that we will use for the rest of this chapter. We basically want to connect sensors to the Arduino MKR1000 board that will continuously measure data. As an example here, we are going to connect a photocell (that we already used in the first chapter of this book), as well as a DHT11 temperature and humidity sensor.

Getting ready

Let's first see what additional components we will need for this project:

You will also need to install the Adafruit DHT library that you can find inside the Arduino board manager.

We are now going to assemble the project. First, place the resistor in series with the photocell on the breadboard, next to the MKR1000 board.

Now, connect the other end of the resistor to GND on the MKR1000 board, and the other end of the...

Posting the sensor data online

Using the Arduino MKR1000 board and the sensors that we connected to it, we are finally going to log data online, using the Dweet.io service.

Getting ready

For this recipe, you simply need to have the previous recipe up and running, so make sure you have all the sensors connected to your board, and that you have tested them with the test sketch.

You should already have it by now, but make sure that you have the Arduino WiFi101 library installed inside the Arduino IDE.

How to do it...

We are now going to configure the board so it sends the measurements from the sensor to Dweet.io at regular intervals. As this sketch is quite similar to what we already saw in previous chapters, I will only highlight the most important parts of the code here:

  1. First, we need to define the libraries that we are going to use in this project:
    #include <SPI.h>
    #include <WiFi101.h>
    #include "DHT.h"
  2. Then, we need to define a name for our thing on Dweet.io, which is the...

Retrieving your online data

Now that we have stored measurement data in the previous recipe, we are now going to learn how to retrieve it and possibly use it inside applications.

Getting ready

For this recipe, you need to have some data stored on the Dweet.io server. For that, please follow the previous recipe if that's not done yet.

How to do it...

Let's suppose that you have data stored for a device called "mymkr1000" on the Dweet.io server. You can easily access the latest data that was stored on the server by typing the following command inside any web browser:

https://dweet.io/get/latest/dweet/for/mymkr1000

This will be the result:

{  
   "this":"succeeded",
   "by":"getting",
   "the":"dweets",
   "with":[  
      {  
         "thing":"mymkr1000",
         "created":"2016-05-06T09:35:31.110Z",
         "content":{  
            "temperature&quot...

Introduction


One of the most important things you can do with an Internet of Things project is to send data online, so it can be stored, retrieved later, and plotted inside a nice dashboard. Of course, it needs to be accessible from any web browser or application in the world.

In this chapter, this is exactly what we are going to do with Arduino. We are going to use an Arduino board to log sensor data online, and then we'll see how to exploit this data. We are first going to get an overview of what options are available when you want to log data online from an Arduino project. Then, we are going to connect sensors to the Arduino board, and log this data online. Finally, we'll see how to access this data, plot it, and also visualize data coming from several boards at once.

Internet of Things platforms for Arduino


In the first recipe of this chapter, we are going to see the different platforms that are available for us, if we want to store data online from an Arduino project. We'll see what are the strengths and the weaknesses of each platform, so we can make a choice for the rest of this chapter.

Available platforms

The first platform that I wanted to mention here is called Dweet.io. You can learn more about it at:

https://dweet.io/

Dweet.io is basically a simple API that can be called from any web browser or application, and it is so simple to use that even a human can use it without problems! It's really easy to store data there from an Arduino project, and then to retrieve this data using other applications.

The next platform I wanted to mention here is Xively. This is the main page of Xively:

https://xively.com/

Xively is a complete IoT platform, which is more dedicated to the business world than Dweet.io, for example. It includes more functions than just...

Connecting sensors to your Arduino board


In this recipe, we are going to build the project that we will use for the rest of this chapter. We basically want to connect sensors to the Arduino MKR1000 board that will continuously measure data. As an example here, we are going to connect a photocell (that we already used in the first chapter of this book), as well as a DHT11 temperature and humidity sensor.

Getting ready

Let's first see what additional components we will need for this project:

You will also need to install the Adafruit DHT library that you can find inside the Arduino board manager.

We are now going to assemble the project. First, place the resistor in series with the photocell on the breadboard, next to the MKR1000 board.

Now, connect the other end of the resistor to GND on the MKR1000 board, and the other end of the photocell...

Posting the sensor data online


Using the Arduino MKR1000 board and the sensors that we connected to it, we are finally going to log data online, using the Dweet.io service.

Getting ready

For this recipe, you simply need to have the previous recipe up and running, so make sure you have all the sensors connected to your board, and that you have tested them with the test sketch.

You should already have it by now, but make sure that you have the Arduino WiFi101 library installed inside the Arduino IDE.

How to do it...

We are now going to configure the board so it sends the measurements from the sensor to Dweet.io at regular intervals. As this sketch is quite similar to what we already saw in previous chapters, I will only highlight the most important parts of the code here:

  1. First, we need to define the libraries that we are going to use in this project:

    #include <SPI.h>
    #include <WiFi101.h>
    #include "DHT.h"
  2. Then, we need to define a name for our thing on Dweet.io, which is the name we will...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • This book offers key solutions and advice to address the hiccups faced when working on Arduino-based IoT projects in the real world
  • Take your existing skills and capabilities to the next level by building challenging IoT applications with ease.
  • Be the tech disruptor you always wanted to be with key recipes that help you solve Arduino IoT related problems smarter and faster.
  • Put IoT to work through recipes on building Arduino-based devices that take control of your home, health, and life!

Description

Arduino is a powerful and very versatile platform used by millions of people around the world to create DIY electronics projects. It can be connected to a wide variety of sensors and other components, making it the ideal platform to build amazing Internet of Things (IoT) projects on—the next wave in the era of computing. This book takes a recipe-based approach, giving you precise examples on how to build IoT projects of all types using the Arduino platform. You will come across projects from several fields, including the popular robotics and home automation domains. Along with being introduced to several forms of interactions within IoT, including projects that directly interact with well-known web services such as Twitter, Facebook, and Dropbox we will also focus on Machine-to-Machine (M2M) interactions, where Arduino projects interact without any human intervention. You will learn to build a few quick and easy-to-make fun projects that will really expand your horizons in the world of IoT and Arduino. Each chapter ends with a troubleshooting recipe that will help you overcome any problems faced while building these projects. By the end of this book, you will not only know how to build these projects, but also have the skills necessary to build your own IoT projects in the future.

Who is this book for?

This book is primarily for tech enthusiasts and early IoT adopters who would like to make the most of IoT and address the challenges encountered while developing IoT-based applications with Arduino. This book is also good for developers with basic electronics knowledge who need help to successfully build Arduino projects.

What you will learn

  • Monitor several Arduino boards simultaneously
  • Tweet sensor data directly from your Arduino board
  • Post updates on your Facebook wall directly from your Arduino board
  • Create an automated access control with a fingerprint sensor
  • Control your entire home from a single dashboard
  • Make a GPS tracker that you can track in Google Maps
  • Build a live camera that streams directly from your robot

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 30, 2016
Length: 188 pages
Edition : 1st
Language : English
ISBN-13 : 9781785286582
Category :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 30, 2016
Length: 188 pages
Edition : 1st
Language : English
ISBN-13 : 9781785286582
Category :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 152.97
Arduino: Building exciting LED based projects and espionage devices
$69.99
Smart Internet of Things Projects
$43.99
Internet of Things with Arduino Cookbook
$38.99
Total $ 152.97 Stars icon
Banner background image

Table of Contents

8 Chapters
1. Connecting an Arduino to the Web Chevron down icon Chevron up icon
2. Cloud Data Monitoring Chevron down icon Chevron up icon
3. Interacting with Web Services Chevron down icon Chevron up icon
4. Machine-to-Machine Interactions Chevron down icon Chevron up icon
5. Home Automation Projects Chevron down icon Chevron up icon
6. Fun Internet of Things Projects Chevron down icon Chevron up icon
7. Mobile Robot Applications Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Martha Cuellar Nov 12, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Llego en tiempo y forma en buenas condiciones
Amazon Verified review Amazon
keith wootton Jan 18, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Was a gift. Very well liked.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.