0% found this document useful (0 votes)
5 views2 pages

A Comprehensive Review of IoT

The document is a comprehensive review of IoT-based carbon dioxide monitoring systems, authored by Siddu from the Dept. of AI & Robotics at Dayananda Sagar University. It includes MATLAB code for simulating and uploading CO2 data to ThingSpeak, detailing the configuration and data upload process. Additionally, it mentions retrieving and plotting CO2 data for analysis.

Uploaded by

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

A Comprehensive Review of IoT

The document is a comprehensive review of IoT-based carbon dioxide monitoring systems, authored by Siddu from the Dept. of AI & Robotics at Dayananda Sagar University. It includes MATLAB code for simulating and uploading CO2 data to ThingSpeak, detailing the configuration and data upload process. Additionally, it mentions retrieving and plotting CO2 data for analysis.

Uploaded by

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

“A Comprehensive Review of IoT-Based Carbon Dioxide Monitoring

Systems”
NAME = Siddu

USN = ENG23RA0018

ROLL NO = 18

Dept. of AI & Robotics, Dayananda Sagar University

[email protected]

matlab code
% File: co2_monitor_thingspeak.m

% ThingSpeak Configuration
writeAPIKey = 'EVM65B75T8QRTUZI'; % Replace with your ThingSpeak write API key
readChannelID = 2974704; % Replace with your ThingSpeak channel ID
readAPIKey = 'MC3WWPGBSIJSSP0X'; % Replace with your ThingSpeak read API key (optional
for public channels)
fieldNum = 1; % Field number for CO₂ data

% Setup
thingSpeakURL = 'https://api.thingspeak.com/update';
numDataPoints = 20; % Number of points to simulate
pauseTime = 15; % Seconds between uploads (ThingSpeak min is 15 seconds)

% Simulate and Upload CO2 Data


disp('Starting CO₂ data upload simulation...');
for i = 1:numDataPoints
% Simulate CO2 data (ppm)
co2ppm = 400 + 200 * rand(); % e.g., random between 400-600 ppm
disp(['Uploading CO₂ data point ', num2str(i), ': ', num2str(co2ppm), ' ppm']);

% Send data to ThingSpeak


response = webwrite(thingSpeakURL, ...
'api_key', writeAPIKey, ...
['field', num2str(fieldNum)], co2ppm);

% Wait before next upload


pause(pauseTime);
end

disp('Data upload completed.');

%% Retrieve and Plot CO₂ Data from ThingSpeak


% Optional analysis section

data = thingSpeakRead(readChannelID, ...


'Fields', fieldNum, ...
'NumPoints', numDataPoints, ...
'ReadKey', readAPIKey);

You might also like