SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

How cloud computing work
How cloud computing workHow cloud computing work
How cloud computing work
icloud9
 
Cloud computing abstract
Cloud computing abstractCloud computing abstract
Cloud computing abstract
Jagadeesh Kumar
 

Was ist angesagt? (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
 

Ähnlich wie Turn your smartphone into a sensor.pptx

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
Amazon Web Services
 

Ähnlich wie 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
 
Iot physical servers and cloud offerings
Iot physical servers and cloud offeringsIot physical servers and cloud offerings
Iot physical servers and cloud offerings
 
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
 

Mehr von vishal choudhary

Mehr von 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
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

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.