0% found this document useful (0 votes)
8 views33 pages

DAY10-Smart Weather Monotoring System

Uploaded by

Bhanu Pediredla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views33 pages

DAY10-Smart Weather Monotoring System

Uploaded by

Bhanu Pediredla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Internet

of
Things
Master Class
Day 10
M.K.Jeevarajan
www.pantechsolutions.net
Smart Humidity Sensor with
Thingspeak and IFTTT
● ESP32 HTTP GET Parts Required

(OpenWeatherMap and 1) ESP32


ThingSpeak & IFTTT) 2) Thingspeak Account
3) IFTTT Account
4) Openweathermap Account

https://thingspeak.com/
https://home.openweathermap.org/
https://ifttt.com/home
Announcement
● Attendance Link at 9 pm
● Minimum attendance required for an E-Certificate is 27
Days. Attendance link will be valid for 1 hrs. after the event.
● For Internship Candidates no attendance required ,it will be
accessed from the LMS Portal. (learn.pantechsolutions.net)
● Recorded Video Streaming for LAB classes to improve
Learning Experience
● PPT will be uploaded in facebook group
● Source code download is available only on the portal
Mindset Lesson

● Learn , Unlearn, Relearn


● Power of repetition
HTTP GET Request Method
● The Hypertext Transfer Protocol (HTTP) works as a request-response
protocol between a client and server. Here’s an example
● The ESP32 (client) submits an HTTP request to a Server (for
example: OpenWeatherMap.org or ThingSpeak);
● The server returns a response to the ESP32 (client);
● Finally, the response contains status information about the request
and may also contain the requested content.
HTTP GET
● GET is used to request data from a specified resource. It is often
used to get values from APIs.
● For example, you can use a simple request to return a value or JSON
object:
Arduino_JSON Library

https://github.com/arduino-libraries/Arduino_JSON
JSON

•JSON stands for JavaScript Object Notation


•JSON is a lightweight data-interchange format
•JSON is plain text written in JavaScript object notation
•JSON is used to send data between computers
•JSON is language independent *
Why Use JSON?
JSON Syntax Rules
JSON Data Types
JSON Strings,Numbers,Objects
JSON Arrays ,Boolean, null
Using OpenWeatherMap API
Copy the API- Key

1)Open a browser and go to https://openweathermap.org/appid/


2)Press the Sign up button and create a free account.
3)Go to this link: https://home.openweathermap.org/api_keys and get your API key.
On the API keys tab, you’ll see a default key (highlighted in a red rectangle in figure above);
this is a unique key you’ll need to pull information from the site. Copy and paste this key
somewhere; you’ll need it in a moment.
4)To pull information on weather in your chosen location, enter the following URL:
JSON

https://api.openweathermap.org/data/2.5/weather?q=Chennai,IN&a
ppid=479760abe644fb9f8f7bd341d9981199
Step 1
Step 2
Step 3
Step 4
Step 5 HTTP Get Request
function
Step 6 Decoding JSON
Step 7
Step 8-IFTTT
What is a Webhook
● Webhooks are one of a few ways web applications can
communicate with each other.
● It allows you to send real-time data from one application to
another whenever a given event occurs.
● These callbacks may be maintained, modified, and managed by
third-party users and developers who may not necessarily be
affiliated with the originating website or application.
Step 9-Create Thingspeak Channel
and Code
% Enter your MATLAB Code below
channelID = 1567694;
tempdata = thingSpeakRead(1567694,'Fields',[3],'NumPoints',1,'ReadKey','1YVL9SHOEH7QXW9P')
iftttURL='https://maker.ifttt.com/trigger/testiot/with/key/o62hoyhDX19Vj1Kntb0VdYb1idDlq62aAx7e4ePacYU'
readAPIKey = '1YVL9SHOEH7QXW9P';
Message = 'Temperature is normal';
disp(Message);
webwrite(iftttURL,'value1',tempdata,'value2',Message);
DEMO
Click here to enroll internship @750
Questions and Answers

?
Thank you

You might also like