SlideShare a Scribd company logo
1 of 47
Using the Cloud
To water my plants...
The Problem
I have plants at work.
I water them.
Sometimes I’m away and
they don’t get watered…
Times were tough...
Seriously!
They go from
this...
To This!!
But I had 2 options...
Leave them to
their inevitable
Death.
or...
Automate my
way out of it!
The Choice was EASY!
We already know I chose
automation.
Next, project planning;
What technology and
hardware to use...
Project Planning
As per all my well thought out projects, I needed a 3 step plan.
Step 1
I know AWS.
I’m going to use AWS.
IoT everything!!!
Step 2
Acquire the hardware.
Assemble the hardware.
Plug it in.
Step 3
Watch my plants live
on!
● AWS Managed Service
● Built-In Integrations with other AWS services
● Highly Scalable to billions of devices
● MQTT & Websockets
● Cost effective
● Rule Engines
AWS IoT
The Workhorse...
● WiFi 802.11b/g/n enabled development board
● USB interface
I decided to flash the firmware with Mongoose OS
● Web-based IDE
● Over-The-Air Updates
● Javascript & C/C++
● Built in support for AWS IoT & MQTT
● https://mongoose-os.com/
NodeMCU ESP8266
A brief overview of the hardware I used...
● Soil Moisture Sensor
● 12v Peristaltic liquid pump
● Water tubing
● Reservoir
● Wires
Purchased in minutes from:
Sensors & Equipment
A brief overview of the hardware I used...
While I waited for
everything to arrive...
I Needed Objectives!
Moisture
Tracking
I need to track the plant
moisture.
1. Get the data
2. Send the data!
Notifications Automated Watering
I need to know if the plant is
dry.
If sensor reading is less than
dryness threshold => ALERT!
Fix the problem!
If dry,
1. Issue Watering Command
2. Water the Plant
Extensibility
Ability to grow, extend and
scale my solution.
No better place than on
AWS for this :)
My High Level
Architecture
Sneak peak of final state…
No good project can exist
without a quick but helpful
AWS architecture diagram!
And then the parcels
arrived!!
The NodeMCU
arrived first!
Import The Libraries
Connect to MQTT topics
Send the Sensor Data!
Flash the Hardware
In short, it was time to get
coding!
Code Overview
IoT device code written in
javascript!
Full-stack JS anyone?
Import the Libraries
Publish the data via
MQTT
Read from the sensor
Connect to WiFi
Connect to MQTT
Send all the data!
But no one is home...
Time to process
the data!
AWS IoT Rules, here I come!
To act on the data, you define Rules:
● They are analysed based on MQTT topic
● Actions are performed if the rule’s condition is met
Actions give IoT devices the ability to interact with AWS
services:
AWS IoT Rules Engine
And many more!
My AWS IoT Rules
Storage
Data flows straight into a
DynamoDB table!
1. Get the data
2. Store the data!
Notifications Automated Watering
I need to know if the plant is
dry.
If sensor reading is less than
dryness threshold, send alert via
Amazon SNS
IoT Rules action the response!
If dry,
Publish Watering Command to
device control MQTT topic.
Extensibility
Ability to grow, extend and
scale my solution.
So many options...
So Why DynamoDB?
● Fast, Consistent Performance
○ Single-digit millisecond responses
● Fully Managed NoSQL database service
● Document and Key-Value store
● Highly Scalable
○ use AWS AutoScaling!!
● Highly Available
● Cost effective
DynamoDB Table
Setting up my DynamoDB table was easy!
Table Name: plant_monitor
Partition Key: plant (String)
Sort Key: time_recorded
(Number)
Data Storage Rule
The AWS IoT Rule to store my data was simple!
Rule Query Statement:
SELECT topic() AS plant, timestamp() AS time_recorded,
* FROM 'plant/esp8266_4335FE'
Target:
We now store data!
My Growing
Architecture
A quick recap of where we
are up to:
● IoT Core & MQTT
● Pushing Sensor Data
● IoT Rule => DynamoDB
● DynamoDB
Time to visualise...
My simple serverless website.
Website Hosting
Stored, deployed and
hosted my static website
using Amazon S3.
So scalable, so simple.
AWS SDK Authentication
“for Javascript in the Browser”
Used for AWS calls to Amazon
Cognito and DynamoDB.
Amazon Cognito for user
Authentication.
Amazon Cognito gives the
user IAM credentials to access
the DynamoDB table.
Data Source
We’re storing the data in
DynamoDB.
I just queried and retrieved
the relevant data...
What is Amazon Cognito?
● Fully Managed Authentication Service
● Secure, Scalable User Directory
● Social and enterprise identity federation
○ i.e. Google, Facebook, Amazon
● UI for integration into your app
● Provides IAM access control for AWS resources
○ e.g. allow authenticated users of your application to retrieve data
from DynamoDB
Graphs!
Once I had the data, I passed
it into Chart.js...
Those drops in the dryness is
where I watered my plant!
My Growing
Architecture
A quick recap of where we
are up to:
● IoT Core & MQTT
● Pushing Sensor Data
● IoT Rule => DynamoDB
● DynamoDB
● Amazon Cognito
● S3 Static Website
First Objective Down!
Moisture
Tracking
I need to track the plant
moisture.
1. Get the data
2. Send the data!
Notifications Automated Watering
I need to know if the plant is
dry.
If sensor reading is less than
dryness threshold => ALERT!
Fix the problem!
If dry,
1. Issue Watering Command
2. Water the Plant
Extensibility
Ability to grow, extend and
scale my solution.
No better place than on
AWS for this :)
Next is notifications!
● Amazon Simple Notification Service (SNS)
● Fully managed AWS notification service
● Pub/Sub Messaging
○ Push messages to
■ Amazon Simple Queue Service (SQS)
■ AWS Lambda functions
■ HTTP(S) endpoints
● Mobile push notifications and SMS
Time for Amazon SNS
It does what is written on the tin in the docs...
So I created and
subscribed to
an SNS topic.
My Growing
Architecture
A quick recap of where we are
up to:
● IoT Core & MQTT
● Pushing Sensor Data
● IoT Rule => DynamoDB
● DynamoDB
● Amazon Cognito
● S3 Static Website
● IoT Rule => SNS
● Amazon SNS
Second Objective Down!
Moisture
Tracking
I need to track the plant
moisture.
1. Get the data
2. Send the data!
Notifications Automated Watering
I need to know if the plant is
dry.
If sensor reading is less than
dryness threshold => ALERT!
Fix the problem!
If dry,
1. Issue Watering Command
2. Water the Plant
Extensibility
Ability to grow, extend and
scale my solution.
No better place than on
AWS for this :)
Time to automate rain!
Additional AWS IoT Rule
The AWS IoT Rule to check my plant dryness and invoke
publish back a message to my plant!
Rule Query Statement:
SELECT topic() AS plant, * FROM 'plant/esp8266_4335FE'
WHERE sensorValuePercentage > 90
Target:
Lambda Function
I wanted to publish a different response message to
another MQTT topic, so I opted for Lambda!
Decided to stick with Javascript across
the full-stack.
Success!
Third Objective Down!
Moisture
Tracking
I need to track the plant
moisture.
1. Get the data
2. Send the data!
Notifications Automated Watering
I need to know if the plant is
dry.
If sensor reading is less than
dryness threshold => ALERT!
Fix the problem!
If dry,
1. Issue Watering Command
2. Water the Plant
Extensibility
Ability to grow, extend and
scale my solution.
No better place than on
AWS for this :)
My High Level
Architecture
And with that I had a
functioning prototype.
Easily scalable to 1000’s of
plants!
Now to work out my
business model...
We’re Hiring!
Come and have a chat!
Email: careers@itoc.com.au

More Related Content

Similar to Using the Cloud to water my plants

IoT with Salesforce - India Dreamin Presentation
IoT with Salesforce - India Dreamin PresentationIoT with Salesforce - India Dreamin Presentation
IoT with Salesforce - India Dreamin PresentationDinesh Kumar Wickramasinghe
 
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
 
Iot meets Serverless
Iot meets ServerlessIot meets Serverless
Iot meets ServerlessNarendran R
 
Ovations AWS pop-up loft 2019 Technical presentation
Ovations AWS pop-up loft 2019 Technical presentationOvations AWS pop-up loft 2019 Technical presentation
Ovations AWS pop-up loft 2019 Technical presentationGeanBoegman
 
An Overview of AWS IoT (November 2016)
An Overview of AWS IoT (November 2016)An Overview of AWS IoT (November 2016)
An Overview of AWS IoT (November 2016)Julien SIMON
 
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...Amazon Web Services
 
Getting started with aws io t.compressed.compressed
Getting started with aws io t.compressed.compressedGetting started with aws io t.compressed.compressed
Getting started with aws io t.compressed.compressedAmazon Web Services
 
Building Microservices with Scala, functional domain models and Spring Boot -...
Building Microservices with Scala, functional domain models and Spring Boot -...Building Microservices with Scala, functional domain models and Spring Boot -...
Building Microservices with Scala, functional domain models and Spring Boot -...JAXLondon2014
 
#JaxLondon: Building microservices with Scala, functional domain models and S...
#JaxLondon: Building microservices with Scala, functional domain models and S...#JaxLondon: Building microservices with Scala, functional domain models and S...
#JaxLondon: Building microservices with Scala, functional domain models and S...Chris Richardson
 
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake ScherrerAWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake ScherrerAWS Chicago
 
AWS Lambda Presentation (Tech Talk DC)
AWS Lambda Presentation (Tech Talk DC)AWS Lambda Presentation (Tech Talk DC)
AWS Lambda Presentation (Tech Talk DC)Doguhan Uluca
 
BigData in IoT #iotconfua
BigData in IoT #iotconfuaBigData in IoT #iotconfua
BigData in IoT #iotconfuaAndy Shutka
 
AWS IoT Edge Management
AWS IoT Edge ManagementAWS IoT Edge Management
AWS IoT Edge ManagementAvinash Patil
 

Similar to Using the Cloud to water my plants (20)

IoT with Salesforce - India Dreamin Presentation
IoT with Salesforce - India Dreamin PresentationIoT with Salesforce - India Dreamin Presentation
IoT with Salesforce - India Dreamin Presentation
 
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
 
Iot meets Serverless
Iot meets ServerlessIot meets Serverless
Iot meets Serverless
 
Ovations AWS pop-up loft 2019 Technical presentation
Ovations AWS pop-up loft 2019 Technical presentationOvations AWS pop-up loft 2019 Technical presentation
Ovations AWS pop-up loft 2019 Technical presentation
 
An Overview of AWS IoT (November 2016)
An Overview of AWS IoT (November 2016)An Overview of AWS IoT (November 2016)
An Overview of AWS IoT (November 2016)
 
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
 
Mobile apps and iot aws lambda
Mobile apps and iot aws lambdaMobile apps and iot aws lambda
Mobile apps and iot aws lambda
 
Web + AWS + IoT, how to
Web + AWS + IoT, how to Web + AWS + IoT, how to
Web + AWS + IoT, how to
 
Getting started with aws io t.compressed.compressed
Getting started with aws io t.compressed.compressedGetting started with aws io t.compressed.compressed
Getting started with aws io t.compressed.compressed
 
IoT on azure
IoT on azureIoT on azure
IoT on azure
 
Building Microservices with Scala, functional domain models and Spring Boot -...
Building Microservices with Scala, functional domain models and Spring Boot -...Building Microservices with Scala, functional domain models and Spring Boot -...
Building Microservices with Scala, functional domain models and Spring Boot -...
 
#JaxLondon: Building microservices with Scala, functional domain models and S...
#JaxLondon: Building microservices with Scala, functional domain models and S...#JaxLondon: Building microservices with Scala, functional domain models and S...
#JaxLondon: Building microservices with Scala, functional domain models and S...
 
Internet of Things on AWS
Internet of Things on AWSInternet of Things on AWS
Internet of Things on AWS
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake ScherrerAWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
AWS IoT Services Overview- IoT Core, Monitoring, Analytics by Jake Scherrer
 
AWS Lambda Presentation (Tech Talk DC)
AWS Lambda Presentation (Tech Talk DC)AWS Lambda Presentation (Tech Talk DC)
AWS Lambda Presentation (Tech Talk DC)
 
IoT meets Big Data
IoT meets Big DataIoT meets Big Data
IoT meets Big Data
 
BigData in IoT #iotconfua
BigData in IoT #iotconfuaBigData in IoT #iotconfua
BigData in IoT #iotconfua
 
Introduction to AWS IoT
Introduction to AWS IoTIntroduction to AWS IoT
Introduction to AWS IoT
 
AWS IoT Edge Management
AWS IoT Edge ManagementAWS IoT Edge Management
AWS IoT Edge Management
 

Recently uploaded

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Using the Cloud to water my plants

  • 1. Using the Cloud To water my plants...
  • 2. The Problem I have plants at work. I water them. Sometimes I’m away and they don’t get watered…
  • 6. But I had 2 options...
  • 7. Leave them to their inevitable Death. or...
  • 9. The Choice was EASY! We already know I chose automation. Next, project planning; What technology and hardware to use...
  • 10. Project Planning As per all my well thought out projects, I needed a 3 step plan. Step 1 I know AWS. I’m going to use AWS. IoT everything!!! Step 2 Acquire the hardware. Assemble the hardware. Plug it in. Step 3 Watch my plants live on!
  • 11. ● AWS Managed Service ● Built-In Integrations with other AWS services ● Highly Scalable to billions of devices ● MQTT & Websockets ● Cost effective ● Rule Engines AWS IoT The Workhorse...
  • 12. ● WiFi 802.11b/g/n enabled development board ● USB interface I decided to flash the firmware with Mongoose OS ● Web-based IDE ● Over-The-Air Updates ● Javascript & C/C++ ● Built in support for AWS IoT & MQTT ● https://mongoose-os.com/ NodeMCU ESP8266 A brief overview of the hardware I used...
  • 13. ● Soil Moisture Sensor ● 12v Peristaltic liquid pump ● Water tubing ● Reservoir ● Wires Purchased in minutes from: Sensors & Equipment A brief overview of the hardware I used...
  • 14. While I waited for everything to arrive...
  • 15. I Needed Objectives! Moisture Tracking I need to track the plant moisture. 1. Get the data 2. Send the data! Notifications Automated Watering I need to know if the plant is dry. If sensor reading is less than dryness threshold => ALERT! Fix the problem! If dry, 1. Issue Watering Command 2. Water the Plant Extensibility Ability to grow, extend and scale my solution. No better place than on AWS for this :)
  • 16. My High Level Architecture Sneak peak of final state… No good project can exist without a quick but helpful AWS architecture diagram!
  • 17. And then the parcels arrived!!
  • 18. The NodeMCU arrived first! Import The Libraries Connect to MQTT topics Send the Sensor Data! Flash the Hardware In short, it was time to get coding!
  • 19. Code Overview IoT device code written in javascript! Full-stack JS anyone? Import the Libraries Publish the data via MQTT Read from the sensor Connect to WiFi Connect to MQTT
  • 20. Send all the data!
  • 21. But no one is home...
  • 22. Time to process the data! AWS IoT Rules, here I come! To act on the data, you define Rules: ● They are analysed based on MQTT topic ● Actions are performed if the rule’s condition is met Actions give IoT devices the ability to interact with AWS services: AWS IoT Rules Engine And many more!
  • 23. My AWS IoT Rules Storage Data flows straight into a DynamoDB table! 1. Get the data 2. Store the data! Notifications Automated Watering I need to know if the plant is dry. If sensor reading is less than dryness threshold, send alert via Amazon SNS IoT Rules action the response! If dry, Publish Watering Command to device control MQTT topic. Extensibility Ability to grow, extend and scale my solution. So many options...
  • 24. So Why DynamoDB? ● Fast, Consistent Performance ○ Single-digit millisecond responses ● Fully Managed NoSQL database service ● Document and Key-Value store ● Highly Scalable ○ use AWS AutoScaling!! ● Highly Available ● Cost effective
  • 25. DynamoDB Table Setting up my DynamoDB table was easy! Table Name: plant_monitor Partition Key: plant (String) Sort Key: time_recorded (Number)
  • 26. Data Storage Rule The AWS IoT Rule to store my data was simple! Rule Query Statement: SELECT topic() AS plant, timestamp() AS time_recorded, * FROM 'plant/esp8266_4335FE' Target:
  • 27. We now store data!
  • 28. My Growing Architecture A quick recap of where we are up to: ● IoT Core & MQTT ● Pushing Sensor Data ● IoT Rule => DynamoDB ● DynamoDB
  • 30. My simple serverless website. Website Hosting Stored, deployed and hosted my static website using Amazon S3. So scalable, so simple. AWS SDK Authentication “for Javascript in the Browser” Used for AWS calls to Amazon Cognito and DynamoDB. Amazon Cognito for user Authentication. Amazon Cognito gives the user IAM credentials to access the DynamoDB table. Data Source We’re storing the data in DynamoDB. I just queried and retrieved the relevant data...
  • 31. What is Amazon Cognito? ● Fully Managed Authentication Service ● Secure, Scalable User Directory ● Social and enterprise identity federation ○ i.e. Google, Facebook, Amazon ● UI for integration into your app ● Provides IAM access control for AWS resources ○ e.g. allow authenticated users of your application to retrieve data from DynamoDB
  • 32. Graphs! Once I had the data, I passed it into Chart.js... Those drops in the dryness is where I watered my plant!
  • 33. My Growing Architecture A quick recap of where we are up to: ● IoT Core & MQTT ● Pushing Sensor Data ● IoT Rule => DynamoDB ● DynamoDB ● Amazon Cognito ● S3 Static Website
  • 34. First Objective Down! Moisture Tracking I need to track the plant moisture. 1. Get the data 2. Send the data! Notifications Automated Watering I need to know if the plant is dry. If sensor reading is less than dryness threshold => ALERT! Fix the problem! If dry, 1. Issue Watering Command 2. Water the Plant Extensibility Ability to grow, extend and scale my solution. No better place than on AWS for this :)
  • 36. ● Amazon Simple Notification Service (SNS) ● Fully managed AWS notification service ● Pub/Sub Messaging ○ Push messages to ■ Amazon Simple Queue Service (SQS) ■ AWS Lambda functions ■ HTTP(S) endpoints ● Mobile push notifications and SMS Time for Amazon SNS It does what is written on the tin in the docs...
  • 37. So I created and subscribed to an SNS topic.
  • 38. My Growing Architecture A quick recap of where we are up to: ● IoT Core & MQTT ● Pushing Sensor Data ● IoT Rule => DynamoDB ● DynamoDB ● Amazon Cognito ● S3 Static Website ● IoT Rule => SNS ● Amazon SNS
  • 39. Second Objective Down! Moisture Tracking I need to track the plant moisture. 1. Get the data 2. Send the data! Notifications Automated Watering I need to know if the plant is dry. If sensor reading is less than dryness threshold => ALERT! Fix the problem! If dry, 1. Issue Watering Command 2. Water the Plant Extensibility Ability to grow, extend and scale my solution. No better place than on AWS for this :)
  • 41. Additional AWS IoT Rule The AWS IoT Rule to check my plant dryness and invoke publish back a message to my plant! Rule Query Statement: SELECT topic() AS plant, * FROM 'plant/esp8266_4335FE' WHERE sensorValuePercentage > 90 Target:
  • 42. Lambda Function I wanted to publish a different response message to another MQTT topic, so I opted for Lambda! Decided to stick with Javascript across the full-stack.
  • 44. Third Objective Down! Moisture Tracking I need to track the plant moisture. 1. Get the data 2. Send the data! Notifications Automated Watering I need to know if the plant is dry. If sensor reading is less than dryness threshold => ALERT! Fix the problem! If dry, 1. Issue Watering Command 2. Water the Plant Extensibility Ability to grow, extend and scale my solution. No better place than on AWS for this :)
  • 45. My High Level Architecture And with that I had a functioning prototype. Easily scalable to 1000’s of plants!
  • 46. Now to work out my business model...
  • 47. We’re Hiring! Come and have a chat! Email: careers@itoc.com.au