SlideShare a Scribd company logo
1 of 26
Turn your smartphone into a sensor
and an actuator
• he Internet of Things, or IoT, refers to the growing range of Internet-connected
devices that capture or generate an enormous amount of information every day.
For consumers, these devices include mobile phones, sports wearables, home
heating and air conditioning systems, and more. In an industrial setting, these
devices and sensors can be found in manufacturing equipment, the supply chain,
and in-vehicle components. IoT can make life easier for all of us. To easily develop
and deploy IoT solutions of all sizes, IBM created the IBM Watson IoT Platform.
• In this tutorial, you will learn how you can use the Watson IoT Platform to build a
simple IoT solution by turning your smartphone into a sensor (reading and sending
data) but also into an actuator (reading and acting on data).
• You'll use an IoT Starter Mobile app on your smartphone. To transform your
smartphone into a sensor, we will build an IoT app that reads
the accelerometer values that are sent from your smartphone and reacts with a
specific action whether the values reach a certain threshold. To transform your
smartphone into an actuator, we will build an IoT app that sends specific
commands to your smartphone that can then react to the commands it receives.
• An IBM Bluemix® account. (You can request a free
trial here.)
• A smartphone (an Android or iOS smartphone).
• For an iOS smartphone, an iTunes account to
install the IoT Starter Mobile app.
• A twitter account to be notified by a tweet
(optional).
• An email account with SMTP relay capabilities to
be notified by an email message (optional).
create your main IoT app in Bluemix
• Log in to your Bluemix account.
• In the Bluemix catalog, from the Boilerplates section,
select the Internet of Things Platform Starter
boilerplate.
• In the right pane, specify a unique name for your app,
which is used to create a unique host name for your
app. Then, click CREATE.
• The Internet of Things Platform Starter boilerplate
automatically adds the Internet of Things Platform
service and a Cloudant NoSQL Database service to your
app. It also includes a Node-RED runtime environment
for your app.
Register your smartphone in the
Watson IoT Platform
• you need to register your smartphone in the Watson
IoT Platform before you can connect it to the IoT. The
Bluemix IoT Platform service automatically allocates an
IoT organization to you. An IoT organization is a space
that is used for connecting and managing devices to
the IBM Watson IoT Platform so that your applications
can access their live and historical data.
• From your Bluemix dashboard, select the Internet of
Things Platform service. Then, click Launch
dashboard.
The dashboard for IBM Watson IoT Platform opens in a
new browser tab. The organization ID is assigned to
your app and is displayed in the upper right.
2.in the Boards page, which is where you manage your devices and data, hover over the menu on
the left and selectDevices. On the Devices page, click Add Device.
3.In the Add Device page, click Create device type. The name for the device type is case-sensitive
and must be either Android or iPhone. The IoT
Starter Mobile app expects one of these words as the device type.
Install and configure the IoT Starter
Mobile app on your smartphone
• You will use the IoT Starter Mobile app to both
read and send sensor data that comes from your
smartphone and also to transform your
smartphone to be an actuator that can receive
and run commands. This application has been
developed with native languages on both iOS and
Android platforms. With this mobile app, you can
publish the following events:
• Accelerometer X, Y, Z event of your smartphone
• touchMove event
• Text event
Install the IoT Starter Mobile app on
your Android smartphone
• If you are an experienced Android developer, you can
download the IoT Starter Mobile app for Android demo
application from the ibm-watson-iot GitHub project, import
it into your Android development environment, and then
build the .apk file yourself. These steps here demonstrate
how to manually install the .ipa package file.
• On your Android phone, go to Settings > Security. Under
Smartphone Administration, enable Unknown sources. This
setting allows you to install .apk files from outside of
Google Play.
• Open the browser on your Android smartphone, and enter
this URL:
http://ibm.biz/asdwapkInstead of typing the URL, you can
use the QRcode in this article.
• Download the iot-starter-for-android.apk file
on your Android smartphone.
• Use a file explorer app to find the file in
the Downloads folder, and select the .apk file
to install it.
• verify that smartphone messages are being sent to the
Watson IoT Platform
• After you install the IoT Starter Mobile app on your
smartphone, you need to configure it with your IoT
credentials and connect the app to the Watson IoT
Platform.
• Open the IoT Starter app on your smartphone, and
specify your organization and smartphone credentials.
• Open the profile for the app.
– For Android devices, select the menu in the upper right,
and select Open profiles.
• Click Save setting and give a name to your profile, such
as myProfile. Click Save, and go back to the login window. Your
credentials are now saved for the next time you connect.
• Click Activate Sensor, which causes your app to send messages to
the Watson IoT platform.
• In the Watson IoT Platform dashboard (in Bluemix), in the menu on
the left, select Devices. Select your smartphone in the list. Verify
that accelerometer events are displayed in the Recent
Events section.
• If you like, you can add a card to your dashboard to visualize your
smartphone data (in real-time even). Use the Watson IoT Platform
documentation on Bluemix to learn how to create boards and
cards.
• Process messages from your IoT sensor app
• Now that your smartphone is registered, and you
verified that it is sending its accelerometer data
to the Watson IoT Platform, we need to connect
the IoT app to the Watson IoT platform by using
the IoT service. We can then start to use that
smartphone data in our IoT solution.
• In the Bluemix dashboard, go to your application
and click your application route to access your
application.
now that your smartphone is registered, and you verified that it is sending its
accelerometer data to the Watson IoT Platform, we need to connect the IoT
app to the Watson IoT platform by using the IoT service. We can then start to
use that smartphone data in our IoT solution.
• In the Bluemix dashboard, go to your application and
click your application route to access your application.
• Open your Node-RED flow editor.
• In the Node-RED editor, which opens and contains a
sample flow, select all existing nodes and delete them.
• Create a new flow by dragging an ibmiot node from the
input section on to your workspace and also dragging a
debug node from the output section on to your
workspace. Connect the two nodes together.
Double-click the IBM IoT node to configure it. Specify the Bluemix service
authentication and device ID information, which is the one you choose when
you registered the smartphone with the Watson IoT Platform. Then, click
Done.
• Double-click the IBM IoT node to configure it.
Specify the Bluemix service authentication
and device ID information, which is the one
you choose when you registered the
smartphone with the Watson IoT Platform.
Then, click Done.
• send an alert when your smartphone falls down
• Now, we are going to update our Node-RED flow to use the sensor
data.
• We are going to do the following steps:
• Extract the "acceleration_y" value from the JSON payload message
• Trigger a value against an acceleration value (such
as 0.5 for iOS and 7 for Android)
• Debug the notification message
• Optionally, either post a tweet or send an email
• Go to your Node Red flow editor. You will create the following flow
by dragging the appropriate nodes and wiring them together as
shown in the following figure:
• To extract the absolute acceleration_y value of the smartphone from the JSON payload message, we'll add and
configure a function node. From the function section of the palette, drag a function node to your workspace.
Double-click the function node to configure it with these values:
– Specify getAcceleration_y as the name for this node.
– In this function node, copy and paste the following code:
return {payload: Math.abs(msg.payload.d.acceleration_y)};
– Click Done.
• To create a trigger on the acceleration_y value, we'll add and configure a switch node. From the function section
of the palette, drag a switch node to your workspace. Wire the function node to the switch node. Double-click the
switch node to configure it with these values:
– Specify testAcceleration_y as the name for this node.
– Specify msg.payload as the property.
– In the condition value drop-down list, select ">=?", and specify 0.5 for iOS or 7 for Android.
– In the last drop-down list, select stopping after first match.
– Click Done.
• To define the notification message that you want to send when your phone is falling, we'll add and configure a
template node. From the function section of the palette, drag a template node to your workspace. Wire the switch
node to the template node. Double-click the template node to configure it with these values:
– Specify Acceleration_y_exceed_message as the name for this node.
– Specify msg.payload as the property.
– Copy and paste the following code to the node editor:
Wow! Is your phone falling?
Its acceleration y = {{payload}}!
– Click Done.
• o limit the number of messages for the notification and to avoid duplicate
notification messages, we'll add and configure a delay node. From the
function section of the palette, drag a delay node to your workspace. Wire
the template node to the delay node. Double-click the delay node to
configure it with these values:
– Specify Limit Rate as the name for this node.
– From the Action drop-down list, specify Limit rate to. Then, set the rate
to 1 and select Minute.
– Check the Drop intermediate message check box.
– Click Done.
• To display the notification message in the Debug tab of your flow, we'll
add and configure a debug node. From the output section of the palette,
drag a debug node to your workspace. Wire the delay node to the debug
node.
• To avoid getting too many debug messages in the Debug tab, you can
activate and deactivate the debug node by clicking the green rectangle in
the debug node.
1.aA message is displayed at the top of your browser that explains if the
debug node is activated or deactivated.
2.To test your Bluemix application (and your Node-RED flow), complete these
steps:
a.Click Deploy to redeploy your Node-RED flow.
b.On your smartphone, run the IoT Mobile Starter app, and click Activate
Sensor.
c.Move your smartphone quickly up and down to simulate it falling down.
d.In your Node-RED flow editor, in the Debug tab, verify that cceleration_y values
are being displayed and that the notification message is also displayed.
https://www.ibm.com/developerwork
s/library/iot-smartphone-sensor-
actuator-bluemix-apps-trs/index.html

More Related Content

What's hot

Introduction to Cloud computing
Introduction to Cloud computingIntroduction to Cloud computing
Introduction to Cloud computingKumayl Rajani
 
Cloud computing presentation.
Cloud computing presentation.Cloud computing presentation.
Cloud computing presentation.Ali Raxa
 
Cloud Computing for Beginners
Cloud Computing for BeginnersCloud Computing for Beginners
Cloud Computing for BeginnersJainul Musani
 
Cloud computing and Advantages
Cloud computing and AdvantagesCloud computing and Advantages
Cloud computing and AdvantagesToneshkumar Pardhi
 
How Cloud Computing Works?
How Cloud Computing Works?How Cloud Computing Works?
How Cloud Computing Works?icloud9
 
Cloud computing presentation
Cloud computing presentationCloud computing presentation
Cloud computing presentationAhmed Abdisalan
 
How Cloud Computing Works?
How Cloud Computing Works?How Cloud Computing Works?
How Cloud Computing Works?icloud9
 
How cloud computing work
How cloud computing workHow cloud computing work
How cloud computing workicloud9
 
Intro To Cloud Computing
Intro To Cloud ComputingIntro To Cloud Computing
Intro To Cloud Computingprakashjjaya
 
Introduction to cloud computing
Introduction to cloud computingIntroduction to cloud computing
Introduction to cloud computingThulasi Ram
 
Seminar on cloud computing
Seminar on cloud computingSeminar on cloud computing
Seminar on cloud computingAKSHAY p
 
Cloud computing abstract
Cloud computing abstractCloud computing abstract
Cloud computing abstractJagadeesh Kumar
 
Chapeter 2 introduction to cloud computing
Chapeter 2   introduction to cloud computingChapeter 2   introduction to cloud computing
Chapeter 2 introduction to cloud computingeShikshak
 
Cloud computing introduction
Cloud computing introductionCloud computing introduction
Cloud computing introductionLap Doan
 

What's hot (20)

cloud computing basics
cloud computing basicscloud computing basics
cloud computing basics
 
Introduction to Cloud computing
Introduction to Cloud computingIntroduction to Cloud computing
Introduction to Cloud computing
 
Cloud computing presentation.
Cloud computing presentation.Cloud computing presentation.
Cloud computing presentation.
 
Cloud Computing for Beginners
Cloud Computing for BeginnersCloud Computing for Beginners
Cloud Computing for Beginners
 
Cloud computing and Advantages
Cloud computing and AdvantagesCloud computing and Advantages
Cloud computing and Advantages
 
How Cloud Computing Works?
How Cloud Computing Works?How Cloud Computing Works?
How Cloud Computing Works?
 
cloud computing
cloud computingcloud computing
cloud computing
 
Cloud computing presentation
Cloud computing presentationCloud computing presentation
Cloud computing presentation
 
How Cloud Computing Works?
How Cloud Computing Works?How Cloud Computing Works?
How Cloud Computing Works?
 
How cloud computing work
How cloud computing workHow cloud computing work
How cloud computing work
 
Intro To Cloud Computing
Intro To Cloud ComputingIntro To Cloud Computing
Intro To Cloud Computing
 
Introduction to cloud computing
Introduction to cloud computingIntroduction to cloud computing
Introduction to cloud computing
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Seminar on cloud computing
Seminar on cloud computingSeminar on cloud computing
Seminar on cloud computing
 
web application.pptx
web application.pptxweb application.pptx
web application.pptx
 
cloude computing
cloude computingcloude computing
cloude computing
 
Cloud computing abstract
Cloud computing abstractCloud computing abstract
Cloud computing abstract
 
Chapeter 2 introduction to cloud computing
Chapeter 2   introduction to cloud computingChapeter 2   introduction to cloud computing
Chapeter 2 introduction to cloud computing
 
Cloud computing introduction
Cloud computing introductionCloud computing introduction
Cloud computing introduction
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 

Similar to Turn your smartphone into a sensor.pptx

A step by step guide to develop temperature sensor io t application using ibm...
A step by step guide to develop temperature sensor io t application using ibm...A step by step guide to develop temperature sensor io t application using ibm...
A step by step guide to develop temperature sensor io t application using ibm...Azilen Technologies Pvt. Ltd.
 
Simplifying IoT App Development - A Whitepaper by RapidValue
Simplifying IoT App Development - A Whitepaper by RapidValueSimplifying IoT App Development - A Whitepaper by RapidValue
Simplifying IoT App Development - A Whitepaper by RapidValueRapidValue
 
Integrating IBM Watson IoT Platform IBM Blockchain Lab
Integrating IBM Watson IoT Platform IBM Blockchain LabIntegrating IBM Watson IoT Platform IBM Blockchain Lab
Integrating IBM Watson IoT Platform IBM Blockchain LabRahul Gupta
 
Internet of Things exercise on IBM Bluemix
Internet of Things exercise on IBM BluemixInternet of Things exercise on IBM Bluemix
Internet of Things exercise on IBM BluemixLennartF
 
IBM Bluemix Nice Meetup #1 - CEEI NCA - 20160630 -
IBM Bluemix Nice Meetup #1 - CEEI NCA - 20160630 - IBM Bluemix Nice Meetup #1 - CEEI NCA - 20160630 -
IBM Bluemix Nice Meetup #1 - CEEI NCA - 20160630 - IBM France Lab
 
Steps to be done in blynk app for monitoring
Steps to be done in blynk app for monitoringSteps to be done in blynk app for monitoring
Steps to be done in blynk app for monitoringCitharthan Durairaj
 
Connecting devices to the internet of things
Connecting devices to the internet of thingsConnecting devices to the internet of things
Connecting devices to the internet of thingsBernard Kufluk
 
Iot 1906 - approaches for building applications with the IBM IoT cloud
Iot 1906 - approaches for building applications with the IBM IoT cloudIot 1906 - approaches for building applications with the IBM IoT cloud
Iot 1906 - approaches for building applications with the IBM IoT cloudPeterNiblett
 
One Click Enterprise IoT Services - March 2017 AWS Online Tech Talks
One Click Enterprise IoT Services - March 2017 AWS Online Tech TalksOne Click Enterprise IoT Services - March 2017 AWS Online Tech Talks
One Click Enterprise IoT Services - March 2017 AWS Online Tech TalksAmazon Web Services
 
Android Wearable App Development - 1
Android Wearable App Development - 1Android Wearable App Development - 1
Android Wearable App Development - 1Ketan Raval
 
IBM MobileFirst Platform v7.0 POT App Mgmt Lab v1.1
IBM MobileFirst Platform  v7.0 POT App Mgmt Lab v1.1IBM MobileFirst Platform  v7.0 POT App Mgmt Lab v1.1
IBM MobileFirst Platform v7.0 POT App Mgmt Lab v1.1Banking at Ho Chi Minh city
 
Can we build an Azure IoT controlled device in less than 40 minutes that cost...
Can we build an Azure IoT controlled device in less than 40 minutes that cost...Can we build an Azure IoT controlled device in less than 40 minutes that cost...
Can we build an Azure IoT controlled device in less than 40 minutes that cost...Codemotion Tel Aviv
 
Loyalty & Rewards Points Application on your mobile, iPhone, Android
Loyalty & Rewards Points Application on your mobile, iPhone, AndroidLoyalty & Rewards Points Application on your mobile, iPhone, Android
Loyalty & Rewards Points Application on your mobile, iPhone, AndroidMike Taylor
 
Switzercloud How to visualise a The Things Network Device on Colibird
Switzercloud How to visualise a The Things Network Device on ColibirdSwitzercloud How to visualise a The Things Network Device on Colibird
Switzercloud How to visualise a The Things Network Device on ColibirdVal Jelinic
 
Developing Applications with the IoT Button - DevDay Austin 2017
Developing Applications with the IoT Button - DevDay Austin 2017Developing Applications with the IoT Button - DevDay Austin 2017
Developing Applications with the IoT Button - DevDay Austin 2017Amazon Web Services
 
Android On Your Sleeve - DroidCon Montreal 2015
Android On Your Sleeve - DroidCon Montreal 2015Android On Your Sleeve - DroidCon Montreal 2015
Android On Your Sleeve - DroidCon Montreal 2015Neal Sanche
 
From IoT Central to IoT Hub
From IoT Central to IoT HubFrom IoT Central to IoT Hub
From IoT Central to IoT HubMarco Parenzan
 
IAB3948 Wiring the internet of things with Node-RED
IAB3948 Wiring the internet of things with Node-REDIAB3948 Wiring the internet of things with Node-RED
IAB3948 Wiring the internet of things with Node-REDPeterNiblett
 
Watson IoT @Ryerson University - IEEE Chapter
Watson IoT  @Ryerson University - IEEE Chapter  Watson IoT  @Ryerson University - IEEE Chapter
Watson IoT @Ryerson University - IEEE Chapter Markus Van Kempen
 

Similar to Turn your smartphone into a sensor.pptx (20)

A step by step guide to develop temperature sensor io t application using ibm...
A step by step guide to develop temperature sensor io t application using ibm...A step by step guide to develop temperature sensor io t application using ibm...
A step by step guide to develop temperature sensor io t application using ibm...
 
Simplifying IoT App Development - A Whitepaper by RapidValue
Simplifying IoT App Development - A Whitepaper by RapidValueSimplifying IoT App Development - A Whitepaper by RapidValue
Simplifying IoT App Development - A Whitepaper by RapidValue
 
Integrating IBM Watson IoT Platform IBM Blockchain Lab
Integrating IBM Watson IoT Platform IBM Blockchain LabIntegrating IBM Watson IoT Platform IBM Blockchain Lab
Integrating IBM Watson IoT Platform IBM Blockchain Lab
 
Internet of Things exercise on IBM Bluemix
Internet of Things exercise on IBM BluemixInternet of Things exercise on IBM Bluemix
Internet of Things exercise on IBM Bluemix
 
IBM Bluemix Nice Meetup #1 - CEEI NCA - 20160630 -
IBM Bluemix Nice Meetup #1 - CEEI NCA - 20160630 - IBM Bluemix Nice Meetup #1 - CEEI NCA - 20160630 -
IBM Bluemix Nice Meetup #1 - CEEI NCA - 20160630 -
 
Steps to be done in blynk app for monitoring
Steps to be done in blynk app for monitoringSteps to be done in blynk app for monitoring
Steps to be done in blynk app for monitoring
 
Connecting devices to the internet of things
Connecting devices to the internet of thingsConnecting devices to the internet of things
Connecting devices to the internet of things
 
Iot 1906 - approaches for building applications with the IBM IoT cloud
Iot 1906 - approaches for building applications with the IBM IoT cloudIot 1906 - approaches for building applications with the IBM IoT cloud
Iot 1906 - approaches for building applications with the IBM IoT cloud
 
One Click Enterprise IoT Services - March 2017 AWS Online Tech Talks
One Click Enterprise IoT Services - March 2017 AWS Online Tech TalksOne Click Enterprise IoT Services - March 2017 AWS Online Tech Talks
One Click Enterprise IoT Services - March 2017 AWS Online Tech Talks
 
Android Wearable App Development - 1
Android Wearable App Development - 1Android Wearable App Development - 1
Android Wearable App Development - 1
 
IBM MobileFirst Platform v7.0 POT App Mgmt Lab v1.1
IBM MobileFirst Platform  v7.0 POT App Mgmt Lab v1.1IBM MobileFirst Platform  v7.0 POT App Mgmt Lab v1.1
IBM MobileFirst Platform v7.0 POT App Mgmt Lab v1.1
 
Can we build an Azure IoT controlled device in less than 40 minutes that cost...
Can we build an Azure IoT controlled device in less than 40 minutes that cost...Can we build an Azure IoT controlled device in less than 40 minutes that cost...
Can we build an Azure IoT controlled device in less than 40 minutes that cost...
 
Loyalty & Rewards Points Application on your mobile, iPhone, Android
Loyalty & Rewards Points Application on your mobile, iPhone, AndroidLoyalty & Rewards Points Application on your mobile, iPhone, Android
Loyalty & Rewards Points Application on your mobile, iPhone, Android
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
Switzercloud How to visualise a The Things Network Device on Colibird
Switzercloud How to visualise a The Things Network Device on ColibirdSwitzercloud How to visualise a The Things Network Device on Colibird
Switzercloud How to visualise a The Things Network Device on Colibird
 
Developing Applications with the IoT Button - DevDay Austin 2017
Developing Applications with the IoT Button - DevDay Austin 2017Developing Applications with the IoT Button - DevDay Austin 2017
Developing Applications with the IoT Button - DevDay Austin 2017
 
Android On Your Sleeve - DroidCon Montreal 2015
Android On Your Sleeve - DroidCon Montreal 2015Android On Your Sleeve - DroidCon Montreal 2015
Android On Your Sleeve - DroidCon Montreal 2015
 
From IoT Central to IoT Hub
From IoT Central to IoT HubFrom IoT Central to IoT Hub
From IoT Central to IoT Hub
 
IAB3948 Wiring the internet of things with Node-RED
IAB3948 Wiring the internet of things with Node-REDIAB3948 Wiring the internet of things with Node-RED
IAB3948 Wiring the internet of things with Node-RED
 
Watson IoT @Ryerson University - IEEE Chapter
Watson IoT  @Ryerson University - IEEE Chapter  Watson IoT  @Ryerson University - IEEE Chapter
Watson IoT @Ryerson University - IEEE Chapter
 

More from vishal choudhary (20)

SE-Lecture1.ppt
SE-Lecture1.pptSE-Lecture1.ppt
SE-Lecture1.ppt
 
SE-Testing.ppt
SE-Testing.pptSE-Testing.ppt
SE-Testing.ppt
 
SE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.pptSE-CyclomaticComplexityand Testing.ppt
SE-CyclomaticComplexityand Testing.ppt
 
SE-Lecture-7.pptx
SE-Lecture-7.pptxSE-Lecture-7.pptx
SE-Lecture-7.pptx
 
Se-Lecture-6.ppt
Se-Lecture-6.pptSe-Lecture-6.ppt
Se-Lecture-6.ppt
 
SE-Lecture-5.pptx
SE-Lecture-5.pptxSE-Lecture-5.pptx
SE-Lecture-5.pptx
 
XML.pptx
XML.pptxXML.pptx
XML.pptx
 
SE-Lecture-8.pptx
SE-Lecture-8.pptxSE-Lecture-8.pptx
SE-Lecture-8.pptx
 
SE-coupling and cohesion.ppt
SE-coupling and cohesion.pptSE-coupling and cohesion.ppt
SE-coupling and cohesion.ppt
 
SE-Lecture-2.pptx
SE-Lecture-2.pptxSE-Lecture-2.pptx
SE-Lecture-2.pptx
 
SE-software design.ppt
SE-software design.pptSE-software design.ppt
SE-software design.ppt
 
SE1.ppt
SE1.pptSE1.ppt
SE1.ppt
 
SE-Lecture-4.pptx
SE-Lecture-4.pptxSE-Lecture-4.pptx
SE-Lecture-4.pptx
 
SE-Lecture=3.pptx
SE-Lecture=3.pptxSE-Lecture=3.pptx
SE-Lecture=3.pptx
 
Multimedia-Lecture-Animation.pptx
Multimedia-Lecture-Animation.pptxMultimedia-Lecture-Animation.pptx
Multimedia-Lecture-Animation.pptx
 
MultimediaLecture5.pptx
MultimediaLecture5.pptxMultimediaLecture5.pptx
MultimediaLecture5.pptx
 
Multimedia-Lecture-7.pptx
Multimedia-Lecture-7.pptxMultimedia-Lecture-7.pptx
Multimedia-Lecture-7.pptx
 
MultiMedia-Lecture-4.pptx
MultiMedia-Lecture-4.pptxMultiMedia-Lecture-4.pptx
MultiMedia-Lecture-4.pptx
 
Multimedia-Lecture-6.pptx
Multimedia-Lecture-6.pptxMultimedia-Lecture-6.pptx
Multimedia-Lecture-6.pptx
 
Multimedia-Lecture-3.pptx
Multimedia-Lecture-3.pptxMultimedia-Lecture-3.pptx
Multimedia-Lecture-3.pptx
 

Recently uploaded

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 

Recently uploaded (20)

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 

Turn your smartphone into a sensor.pptx

  • 1. Turn your smartphone into a sensor and an actuator
  • 2. • he Internet of Things, or IoT, refers to the growing range of Internet-connected devices that capture or generate an enormous amount of information every day. For consumers, these devices include mobile phones, sports wearables, home heating and air conditioning systems, and more. In an industrial setting, these devices and sensors can be found in manufacturing equipment, the supply chain, and in-vehicle components. IoT can make life easier for all of us. To easily develop and deploy IoT solutions of all sizes, IBM created the IBM Watson IoT Platform. • In this tutorial, you will learn how you can use the Watson IoT Platform to build a simple IoT solution by turning your smartphone into a sensor (reading and sending data) but also into an actuator (reading and acting on data). • You'll use an IoT Starter Mobile app on your smartphone. To transform your smartphone into a sensor, we will build an IoT app that reads the accelerometer values that are sent from your smartphone and reacts with a specific action whether the values reach a certain threshold. To transform your smartphone into an actuator, we will build an IoT app that sends specific commands to your smartphone that can then react to the commands it receives.
  • 3. • An IBM Bluemix® account. (You can request a free trial here.) • A smartphone (an Android or iOS smartphone). • For an iOS smartphone, an iTunes account to install the IoT Starter Mobile app. • A twitter account to be notified by a tweet (optional). • An email account with SMTP relay capabilities to be notified by an email message (optional).
  • 4.
  • 5. create your main IoT app in Bluemix • Log in to your Bluemix account. • In the Bluemix catalog, from the Boilerplates section, select the Internet of Things Platform Starter boilerplate. • In the right pane, specify a unique name for your app, which is used to create a unique host name for your app. Then, click CREATE. • The Internet of Things Platform Starter boilerplate automatically adds the Internet of Things Platform service and a Cloudant NoSQL Database service to your app. It also includes a Node-RED runtime environment for your app.
  • 6. Register your smartphone in the Watson IoT Platform • you need to register your smartphone in the Watson IoT Platform before you can connect it to the IoT. The Bluemix IoT Platform service automatically allocates an IoT organization to you. An IoT organization is a space that is used for connecting and managing devices to the IBM Watson IoT Platform so that your applications can access their live and historical data. • From your Bluemix dashboard, select the Internet of Things Platform service. Then, click Launch dashboard. The dashboard for IBM Watson IoT Platform opens in a new browser tab. The organization ID is assigned to your app and is displayed in the upper right.
  • 7. 2.in the Boards page, which is where you manage your devices and data, hover over the menu on the left and selectDevices. On the Devices page, click Add Device. 3.In the Add Device page, click Create device type. The name for the device type is case-sensitive and must be either Android or iPhone. The IoT Starter Mobile app expects one of these words as the device type.
  • 8. Install and configure the IoT Starter Mobile app on your smartphone • You will use the IoT Starter Mobile app to both read and send sensor data that comes from your smartphone and also to transform your smartphone to be an actuator that can receive and run commands. This application has been developed with native languages on both iOS and Android platforms. With this mobile app, you can publish the following events: • Accelerometer X, Y, Z event of your smartphone • touchMove event • Text event
  • 9. Install the IoT Starter Mobile app on your Android smartphone • If you are an experienced Android developer, you can download the IoT Starter Mobile app for Android demo application from the ibm-watson-iot GitHub project, import it into your Android development environment, and then build the .apk file yourself. These steps here demonstrate how to manually install the .ipa package file. • On your Android phone, go to Settings > Security. Under Smartphone Administration, enable Unknown sources. This setting allows you to install .apk files from outside of Google Play. • Open the browser on your Android smartphone, and enter this URL: http://ibm.biz/asdwapkInstead of typing the URL, you can use the QRcode in this article.
  • 10. • Download the iot-starter-for-android.apk file on your Android smartphone. • Use a file explorer app to find the file in the Downloads folder, and select the .apk file to install it.
  • 11. • verify that smartphone messages are being sent to the Watson IoT Platform • After you install the IoT Starter Mobile app on your smartphone, you need to configure it with your IoT credentials and connect the app to the Watson IoT Platform. • Open the IoT Starter app on your smartphone, and specify your organization and smartphone credentials. • Open the profile for the app. – For Android devices, select the menu in the upper right, and select Open profiles.
  • 12.
  • 13. • Click Save setting and give a name to your profile, such as myProfile. Click Save, and go back to the login window. Your credentials are now saved for the next time you connect. • Click Activate Sensor, which causes your app to send messages to the Watson IoT platform. • In the Watson IoT Platform dashboard (in Bluemix), in the menu on the left, select Devices. Select your smartphone in the list. Verify that accelerometer events are displayed in the Recent Events section. • If you like, you can add a card to your dashboard to visualize your smartphone data (in real-time even). Use the Watson IoT Platform documentation on Bluemix to learn how to create boards and cards.
  • 14. • Process messages from your IoT sensor app • Now that your smartphone is registered, and you verified that it is sending its accelerometer data to the Watson IoT Platform, we need to connect the IoT app to the Watson IoT platform by using the IoT service. We can then start to use that smartphone data in our IoT solution. • In the Bluemix dashboard, go to your application and click your application route to access your application.
  • 15. now that your smartphone is registered, and you verified that it is sending its accelerometer data to the Watson IoT Platform, we need to connect the IoT app to the Watson IoT platform by using the IoT service. We can then start to use that smartphone data in our IoT solution.
  • 16. • In the Bluemix dashboard, go to your application and click your application route to access your application. • Open your Node-RED flow editor. • In the Node-RED editor, which opens and contains a sample flow, select all existing nodes and delete them. • Create a new flow by dragging an ibmiot node from the input section on to your workspace and also dragging a debug node from the output section on to your workspace. Connect the two nodes together.
  • 17. Double-click the IBM IoT node to configure it. Specify the Bluemix service authentication and device ID information, which is the one you choose when you registered the smartphone with the Watson IoT Platform. Then, click Done.
  • 18.
  • 19. • Double-click the IBM IoT node to configure it. Specify the Bluemix service authentication and device ID information, which is the one you choose when you registered the smartphone with the Watson IoT Platform. Then, click Done.
  • 20.
  • 21. • send an alert when your smartphone falls down • Now, we are going to update our Node-RED flow to use the sensor data. • We are going to do the following steps: • Extract the "acceleration_y" value from the JSON payload message • Trigger a value against an acceleration value (such as 0.5 for iOS and 7 for Android) • Debug the notification message • Optionally, either post a tweet or send an email • Go to your Node Red flow editor. You will create the following flow by dragging the appropriate nodes and wiring them together as shown in the following figure:
  • 22.
  • 23. • To extract the absolute acceleration_y value of the smartphone from the JSON payload message, we'll add and configure a function node. From the function section of the palette, drag a function node to your workspace. Double-click the function node to configure it with these values: – Specify getAcceleration_y as the name for this node. – In this function node, copy and paste the following code: return {payload: Math.abs(msg.payload.d.acceleration_y)}; – Click Done. • To create a trigger on the acceleration_y value, we'll add and configure a switch node. From the function section of the palette, drag a switch node to your workspace. Wire the function node to the switch node. Double-click the switch node to configure it with these values: – Specify testAcceleration_y as the name for this node. – Specify msg.payload as the property. – In the condition value drop-down list, select ">=?", and specify 0.5 for iOS or 7 for Android. – In the last drop-down list, select stopping after first match. – Click Done. • To define the notification message that you want to send when your phone is falling, we'll add and configure a template node. From the function section of the palette, drag a template node to your workspace. Wire the switch node to the template node. Double-click the template node to configure it with these values: – Specify Acceleration_y_exceed_message as the name for this node. – Specify msg.payload as the property. – Copy and paste the following code to the node editor: Wow! Is your phone falling? Its acceleration y = {{payload}}! – Click Done.
  • 24. • o limit the number of messages for the notification and to avoid duplicate notification messages, we'll add and configure a delay node. From the function section of the palette, drag a delay node to your workspace. Wire the template node to the delay node. Double-click the delay node to configure it with these values: – Specify Limit Rate as the name for this node. – From the Action drop-down list, specify Limit rate to. Then, set the rate to 1 and select Minute. – Check the Drop intermediate message check box. – Click Done. • To display the notification message in the Debug tab of your flow, we'll add and configure a debug node. From the output section of the palette, drag a debug node to your workspace. Wire the delay node to the debug node. • To avoid getting too many debug messages in the Debug tab, you can activate and deactivate the debug node by clicking the green rectangle in the debug node.
  • 25. 1.aA message is displayed at the top of your browser that explains if the debug node is activated or deactivated. 2.To test your Bluemix application (and your Node-RED flow), complete these steps: a.Click Deploy to redeploy your Node-RED flow. b.On your smartphone, run the IoT Mobile Starter app, and click Activate Sensor. c.Move your smartphone quickly up and down to simulate it falling down. d.In your Node-RED flow editor, in the Debug tab, verify that cceleration_y values are being displayed and that the notification message is also displayed.