SlideShare a Scribd company logo
Activity Recognition
Internet of Things 2019
OUR TEAM
Alessandro Giannetti | Andrea Napoletani
Riccardo Pattuglia
Activity
ML
algorithm
PredictionAccelerometer Data
visualization
Idea
Cloud
Technologies
Cloud Technologies Visualization Technologyhw/sw Technologies
Project workflow
Visualize on RedashTrain Genuino 101 and
classify the activities
Send data through BLE
to Android
Store messages in AWS
DynamoDB
Send MQTT messages
to AWS IoT
Genuino 101
Technical Specification
● Microcontroller Intel Curie
● Flash Memory 196 kB
● SRAM 24 kB
● Clock Speed 32MHz
● I/0 communication Bluetooth LE
● Sensors 6-axis
accelerometer/gyro
Genuino 101
● Low-Power Consumption
● Onboard Bluetooth LE and
a 6-axis
accelerometer/gyro.
● Dedicated core for pattern
matching capabilities.
PRO CONS
● The memory is very low
● The Pattern Matching Engine
has some limitations
Arduino IDE
● Simple (sometimes too much!)
● C/C++ support
● Many libraries implementing
the most used features (BLE,
Curie Module, …)
Setup function
BLEPeripheral blePeripheral;
BLEService fitnessService("19B10000-E8F***");
BLEUnsignedCharCharacteristic fitnessTypeChar("19B1****",
BLERead | BLENotify);
void setup() {
CurieIMU.begin();
CuriePME.begin();
CurieIMU.setAccelerometerRate(sampleRateHZ);
CurieIMU.setAccelerometerRange(1);
// CuriePME.setClassifierMode(CuriePME.KNN_Mode);
blePeripheral.setLocalName("Activity");
blePeripheral.setAdvertisedServiceUuid(fitnessService.uuid()
);
// add service and characteristic
blePeripheral.addAttribute(fitnessService);
blePeripheral.addAttribute(fitnessTypeChar);
// advertise the service
blePeripheral.begin();
}
Loop function
BLECentral central = blePeripheral.central();
byte vector[120];
unsigned int category;
if (central) {
while (central.connected()) {
readVectorFromIMU(vector);
category = CuriePME.classify(vector, 120);
switch (category) {
case 1: Serial.println(F("Still")); break;
case 2: Serial.println(F("Sit")); break;
case 3: Serial.println(F("Walk")); break;
case 4: Serial.println(F("Run")); break;
default:Serial.println(F("Unknown")); break;
}
fitnessTypeChar.setValue((byte) category);
Serial.println(fitnessTypeChar.value());
}
}
void readVectorFromIMU(byte vector[]){
byte accel[250];
int raw[3];
unsigned int samples = 0;
unsigned int i = 0;
while (samples < 250) {
if (CurieIMU.dataReady()) {
CurieIMU.readAccelerometer(raw[0], raw[1], raw[2]);
/* Map raw values to 0-255, only z axis taken */
accel[i] = (byte) map(raw[0], IMULow, IMUHigh, 0, 255);
i += 1;
++samples;
}
}
undersample(accel, samples, vector);
}
Train Genuino
101
Run Sit
Walk Stand
Solved Problems
● Progmem to load training data
at startup
● Training Datasets not working
● Manual training
Genuino 101 position
● Pocket
● Chest (discarded)
Train Genuino
101
Walk
Still
Bluetooth Low Energy (BLE)
● 2.4 GHz radio frequencies
● Simpler modulation system
● Data rate <1 Mbit/S
● No pairing required
How can we store this data?
Amazon Cognito Rule
Amazon DynamoDB
AWS IoT
MQTT protocol
MQTT
Broker
Topic
Message
Message
Subscribe
JSON
Format
Messages
Authentication with Amazon Cognito
● Create an Identity Pool with an
unauthenticated role in Amazon
Cognito
● Allows the application to perform all
operation on the Amazon IoT service
granting AWSIoTFullAcess permission
● Allow access from your Android App
to this Identity in the
awsconfiguration.json file
Configure AWS IoT
● Create a policy on AWS IoT Console
to allow connecting to AWS IoT as
well as allowing publishing,
subscribing and receiving messages
A policy ARN uniquely identifies a policy in AWS.
AWS IoT - Console
Store data on AWS DynamoDB
Store our messages in a table
We need a rule that allows us to take information from
an incoming MQTT message and write it to a
DynamoDB table
Create the rule
● Create a table in DynamoDB
● Create a rule to read
messages from our topic and
store them in our new table
Data visualization - Mango Display
PROBLEMS WITH MANGO DISPLAY/MIRROR
● Apple device + Android device.
● The software is not Open Source
● Limited Data Sources (Apple health and Fitbit)
Data visualization -
REDASH STRENGTHS
● Flexible, Powerful and Easy to Use
● Popular Open Source Project
● +50 Data Sources
(including dynamoDB)
Add DynamoDB to Redash
● Name:
DynamoDB table
● Access Key / Secret Key :
AIM Panel
How Querying the Data Sources
Querying DynamoDB
PROBLEM WITH DYNAMODB
● The QL of DynamoDB don’t support the aggregation functions like SUM(),
AVG(), complex COUNT() and specific operation for the dates like
FORMAT().
SOLUTION TO THE PROBLEM
● Redash allows you to query results from other queries
Querying on Queries results
● Add the Data Source Query Results
● Each queries constitutes its own "table" to SQLite. The
table name is the string query_ concatenated with the
Query ID.
Parameterizing Queries
Query Parameters let you insert values at
run time without editing your base query.
● Redash recognizes any string between
double curly braces {{ }} as a Query
Parameter.
● By clicking on the “{{}}” button, you can
enter the parameters.
HOURS FILTERING
SELECT substr(activity_number,11,19),
activity_type
FROM query_188916
WHERE substr(activity_number,0,11) == "{{
day }}"
ALL DAY
SELECT substr(activity_number,0,11)
FROM query_188916
GROUP BY substr(activity_number,0,11)
ALL DATA (on DynamoDB)
SCAN activity_type, activity_number
FROM activity_recognition
NUMBER OF OCCURRENCES
SELECT activity_type,count(activity_type),
FROM query_188916
WHERE substr(activity_number,0,11) == "{{day}}"
GROUP BY activity_type
Our Queries
Data visualization
Dashboard
Plan & Subscription
● 25 Gb storage
● 200 million requests per month
● 50.000 Monthly Active User
● 10 Gb storage
● 1 million operations of synchronization
● 250.000 messages per month
References
● GITHUB: https://github.com/riccardo97p/IoT_ActivityRecognition
● HACKSTER : https://www.hackster.io/andreanapoletani/activity-recognition-using-genuino-101-and-aws-
iot-fbeea2
● PROJECT
PRESENTATION: https://www.slideshare.net/AndreaNapoletani/activity-recognition-137479240
● REDASH GIFs: https://redash.io/
● IMGs: https://www.vectorstock.com/
● ALESSANDRO GIANNETTI: https://www.linkedin.com/in/alessandro-giannetti-2b1864b4/
● ANDREA NAPOLETANI: https://www.linkedin.com/in/andrea-napoletani-aa0b87166/
● RICCARDO PATTUGLIA: https://www.linkedin.com/in/riccardo-pattuglia-3a09ab182/
DEMO

More Related Content

Similar to Activity Recognition

MongoDB and the Internet of Things
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of Things
MongoDB
 
MCT Virtual Summit 2021
MCT Virtual Summit 2021MCT Virtual Summit 2021
MCT Virtual Summit 2021
Riccardo Zamana
 
IoT Smart Home
IoT Smart HomeIoT Smart Home
IoT Smart Home
Sergey Seletsky
 
IoT Solution Design based on Azure and AWS
IoT Solution Design based on Azure and AWSIoT Solution Design based on Azure and AWS
IoT Solution Design based on Azure and AWS
Michail Vatalev
 
Azure and Predix
Azure and PredixAzure and Predix
Azure and Predix
Altoros
 
Supercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuerySupercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuery
Márton Kodok
 
Industrial IoT with Azure and Open Source
Industrial IoT with Azure and Open SourceIndustrial IoT with Azure and Open Source
Industrial IoT with Azure and Open Source
Ivo Andreev
 
004 - Logging in the Cloud -- hide01.ir.pptx
004 - Logging in the Cloud  --  hide01.ir.pptx004 - Logging in the Cloud  --  hide01.ir.pptx
004 - Logging in the Cloud -- hide01.ir.pptx
nitinscribd
 
What’s new in MariaDB ColumnStore
What’s new in MariaDB ColumnStoreWhat’s new in MariaDB ColumnStore
What’s new in MariaDB ColumnStore
MariaDB plc
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure Functions
Pushkar Saraf
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB
 
Big data @ Hootsuite analtyics
Big data @ Hootsuite analtyicsBig data @ Hootsuite analtyics
Big data @ Hootsuite analtyics
Claudiu Coman
 
M|18 Analytics as a Service
M|18 Analytics as a ServiceM|18 Analytics as a Service
M|18 Analytics as a Service
MariaDB plc
 
Essential Capabilities of an IoT Cloud Platform - April 2017 AWS Online Tech ...
Essential Capabilities of an IoT Cloud Platform - April 2017 AWS Online Tech ...Essential Capabilities of an IoT Cloud Platform - April 2017 AWS Online Tech ...
Essential Capabilities of an IoT Cloud Platform - April 2017 AWS Online Tech ...
Amazon Web Services
 
Monitoring Your AWS EKS Environment with Datadog
Monitoring Your AWS EKS Environment with DatadogMonitoring Your AWS EKS Environment with Datadog
Monitoring Your AWS EKS Environment with Datadog
DevOps.com
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC
 
Old code doesn't stink
Old code doesn't stinkOld code doesn't stink
Old code doesn't stink
Martin Gutenbrunner
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
MariaDB plc
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
MariaDB plc
 
Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
Essential Capabilities of an IoT Cloud Platform - AWS Online Tech TalksEssential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
Amazon Web Services
 

Similar to Activity Recognition (20)

MongoDB and the Internet of Things
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of Things
 
MCT Virtual Summit 2021
MCT Virtual Summit 2021MCT Virtual Summit 2021
MCT Virtual Summit 2021
 
IoT Smart Home
IoT Smart HomeIoT Smart Home
IoT Smart Home
 
IoT Solution Design based on Azure and AWS
IoT Solution Design based on Azure and AWSIoT Solution Design based on Azure and AWS
IoT Solution Design based on Azure and AWS
 
Azure and Predix
Azure and PredixAzure and Predix
Azure and Predix
 
Supercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuerySupercharge your data analytics with BigQuery
Supercharge your data analytics with BigQuery
 
Industrial IoT with Azure and Open Source
Industrial IoT with Azure and Open SourceIndustrial IoT with Azure and Open Source
Industrial IoT with Azure and Open Source
 
004 - Logging in the Cloud -- hide01.ir.pptx
004 - Logging in the Cloud  --  hide01.ir.pptx004 - Logging in the Cloud  --  hide01.ir.pptx
004 - Logging in the Cloud -- hide01.ir.pptx
 
What’s new in MariaDB ColumnStore
What’s new in MariaDB ColumnStoreWhat’s new in MariaDB ColumnStore
What’s new in MariaDB ColumnStore
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure Functions
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
 
Big data @ Hootsuite analtyics
Big data @ Hootsuite analtyicsBig data @ Hootsuite analtyics
Big data @ Hootsuite analtyics
 
M|18 Analytics as a Service
M|18 Analytics as a ServiceM|18 Analytics as a Service
M|18 Analytics as a Service
 
Essential Capabilities of an IoT Cloud Platform - April 2017 AWS Online Tech ...
Essential Capabilities of an IoT Cloud Platform - April 2017 AWS Online Tech ...Essential Capabilities of an IoT Cloud Platform - April 2017 AWS Online Tech ...
Essential Capabilities of an IoT Cloud Platform - April 2017 AWS Online Tech ...
 
Monitoring Your AWS EKS Environment with Datadog
Monitoring Your AWS EKS Environment with DatadogMonitoring Your AWS EKS Environment with Datadog
Monitoring Your AWS EKS Environment with Datadog
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
 
Old code doesn't stink
Old code doesn't stinkOld code doesn't stink
Old code doesn't stink
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
 
Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
Essential Capabilities of an IoT Cloud Platform - AWS Online Tech TalksEssential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
 

Recently uploaded

MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
veerababupersonal22
 
Steel & Timber Design according to British Standard
Steel & Timber Design according to British StandardSteel & Timber Design according to British Standard
Steel & Timber Design according to British Standard
AkolbilaEmmanuel1
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
itech2017
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 

Recently uploaded (20)

MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
 
Steel & Timber Design according to British Standard
Steel & Timber Design according to British StandardSteel & Timber Design according to British Standard
Steel & Timber Design according to British Standard
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 

Activity Recognition

  • 2. OUR TEAM Alessandro Giannetti | Andrea Napoletani Riccardo Pattuglia
  • 4. Technologies Cloud Technologies Visualization Technologyhw/sw Technologies
  • 5. Project workflow Visualize on RedashTrain Genuino 101 and classify the activities Send data through BLE to Android Store messages in AWS DynamoDB Send MQTT messages to AWS IoT
  • 6. Genuino 101 Technical Specification ● Microcontroller Intel Curie ● Flash Memory 196 kB ● SRAM 24 kB ● Clock Speed 32MHz ● I/0 communication Bluetooth LE ● Sensors 6-axis accelerometer/gyro
  • 7. Genuino 101 ● Low-Power Consumption ● Onboard Bluetooth LE and a 6-axis accelerometer/gyro. ● Dedicated core for pattern matching capabilities. PRO CONS ● The memory is very low ● The Pattern Matching Engine has some limitations
  • 8. Arduino IDE ● Simple (sometimes too much!) ● C/C++ support ● Many libraries implementing the most used features (BLE, Curie Module, …)
  • 9. Setup function BLEPeripheral blePeripheral; BLEService fitnessService("19B10000-E8F***"); BLEUnsignedCharCharacteristic fitnessTypeChar("19B1****", BLERead | BLENotify); void setup() { CurieIMU.begin(); CuriePME.begin(); CurieIMU.setAccelerometerRate(sampleRateHZ); CurieIMU.setAccelerometerRange(1); // CuriePME.setClassifierMode(CuriePME.KNN_Mode); blePeripheral.setLocalName("Activity"); blePeripheral.setAdvertisedServiceUuid(fitnessService.uuid() ); // add service and characteristic blePeripheral.addAttribute(fitnessService); blePeripheral.addAttribute(fitnessTypeChar); // advertise the service blePeripheral.begin(); }
  • 10. Loop function BLECentral central = blePeripheral.central(); byte vector[120]; unsigned int category; if (central) { while (central.connected()) { readVectorFromIMU(vector); category = CuriePME.classify(vector, 120); switch (category) { case 1: Serial.println(F("Still")); break; case 2: Serial.println(F("Sit")); break; case 3: Serial.println(F("Walk")); break; case 4: Serial.println(F("Run")); break; default:Serial.println(F("Unknown")); break; } fitnessTypeChar.setValue((byte) category); Serial.println(fitnessTypeChar.value()); } } void readVectorFromIMU(byte vector[]){ byte accel[250]; int raw[3]; unsigned int samples = 0; unsigned int i = 0; while (samples < 250) { if (CurieIMU.dataReady()) { CurieIMU.readAccelerometer(raw[0], raw[1], raw[2]); /* Map raw values to 0-255, only z axis taken */ accel[i] = (byte) map(raw[0], IMULow, IMUHigh, 0, 255); i += 1; ++samples; } } undersample(accel, samples, vector); }
  • 11. Train Genuino 101 Run Sit Walk Stand Solved Problems ● Progmem to load training data at startup ● Training Datasets not working ● Manual training Genuino 101 position ● Pocket ● Chest (discarded)
  • 13. Bluetooth Low Energy (BLE) ● 2.4 GHz radio frequencies ● Simpler modulation system ● Data rate <1 Mbit/S ● No pairing required
  • 14. How can we store this data? Amazon Cognito Rule Amazon DynamoDB AWS IoT
  • 17. Authentication with Amazon Cognito ● Create an Identity Pool with an unauthenticated role in Amazon Cognito ● Allows the application to perform all operation on the Amazon IoT service granting AWSIoTFullAcess permission ● Allow access from your Android App to this Identity in the awsconfiguration.json file
  • 18. Configure AWS IoT ● Create a policy on AWS IoT Console to allow connecting to AWS IoT as well as allowing publishing, subscribing and receiving messages A policy ARN uniquely identifies a policy in AWS.
  • 19. AWS IoT - Console
  • 20. Store data on AWS DynamoDB Store our messages in a table We need a rule that allows us to take information from an incoming MQTT message and write it to a DynamoDB table
  • 21. Create the rule ● Create a table in DynamoDB ● Create a rule to read messages from our topic and store them in our new table
  • 22. Data visualization - Mango Display PROBLEMS WITH MANGO DISPLAY/MIRROR ● Apple device + Android device. ● The software is not Open Source ● Limited Data Sources (Apple health and Fitbit)
  • 23. Data visualization - REDASH STRENGTHS ● Flexible, Powerful and Easy to Use ● Popular Open Source Project ● +50 Data Sources (including dynamoDB)
  • 24. Add DynamoDB to Redash ● Name: DynamoDB table ● Access Key / Secret Key : AIM Panel
  • 25. How Querying the Data Sources
  • 26. Querying DynamoDB PROBLEM WITH DYNAMODB ● The QL of DynamoDB don’t support the aggregation functions like SUM(), AVG(), complex COUNT() and specific operation for the dates like FORMAT(). SOLUTION TO THE PROBLEM ● Redash allows you to query results from other queries
  • 27. Querying on Queries results ● Add the Data Source Query Results ● Each queries constitutes its own "table" to SQLite. The table name is the string query_ concatenated with the Query ID.
  • 28. Parameterizing Queries Query Parameters let you insert values at run time without editing your base query. ● Redash recognizes any string between double curly braces {{ }} as a Query Parameter. ● By clicking on the “{{}}” button, you can enter the parameters.
  • 29. HOURS FILTERING SELECT substr(activity_number,11,19), activity_type FROM query_188916 WHERE substr(activity_number,0,11) == "{{ day }}" ALL DAY SELECT substr(activity_number,0,11) FROM query_188916 GROUP BY substr(activity_number,0,11) ALL DATA (on DynamoDB) SCAN activity_type, activity_number FROM activity_recognition NUMBER OF OCCURRENCES SELECT activity_type,count(activity_type), FROM query_188916 WHERE substr(activity_number,0,11) == "{{day}}" GROUP BY activity_type Our Queries
  • 32. Plan & Subscription ● 25 Gb storage ● 200 million requests per month ● 50.000 Monthly Active User ● 10 Gb storage ● 1 million operations of synchronization ● 250.000 messages per month
  • 33. References ● GITHUB: https://github.com/riccardo97p/IoT_ActivityRecognition ● HACKSTER : https://www.hackster.io/andreanapoletani/activity-recognition-using-genuino-101-and-aws- iot-fbeea2 ● PROJECT PRESENTATION: https://www.slideshare.net/AndreaNapoletani/activity-recognition-137479240 ● REDASH GIFs: https://redash.io/ ● IMGs: https://www.vectorstock.com/ ● ALESSANDRO GIANNETTI: https://www.linkedin.com/in/alessandro-giannetti-2b1864b4/ ● ANDREA NAPOLETANI: https://www.linkedin.com/in/andrea-napoletani-aa0b87166/ ● RICCARDO PATTUGLIA: https://www.linkedin.com/in/riccardo-pattuglia-3a09ab182/
  • 34. DEMO

Editor's Notes

  1. The module contains two tiny cores, an x86 (Quark) and an ARC, both clocked at 32MHz. The Quark core runs ViperOS RTOS and helps the Arduino core to accomplish the most demanding tasks.
  2. The next step is to send messages generated by Genuino to our Android application. To do that we exploit the BLE technology. As the “normal” Bluetooth BLE uses 2.4 GHz radio frequencies but a simpler modulation system to send a very small amount of data, in fact, it has less than 1 Mbit/s data rate and, differently from Bluetooth doesn’t need any pairing. For those reasons it is widely used in IoT applications.
  3. This is the entire process for storing our data, starting from Android App we send messages coming from Genuino to AWS IoT using Amazon Cognito to authenticate this connection. From AWS IoT we need a way to store our data so we create a rule that allows us to take data from AWS IoT and store it in an AWS DynamoDB table.
  4. First of all, let me introduce what kind of messages and how we send them. We exploit the MQTT protocol, it is just a Machine to Machine connectivity protocol designed as an extremely lightweight publish/subscribe messaging transport. In our project, we create a topic called “my/iotminiproject” that will be exploited by the Android app to publish messages on it. On the other side, AWS IoT will subscribe to this topic and start receiving its messages.
  5. To be able to use the application on Android,
  6. omg stop moving the slide, you ll make me throw up