SlideShare a Scribd company logo
1 of 41
Internet of Things
IoT Physical Devices and End points
and RaspberryPi
Internet of Things
IoT Physical Devices and Endpoints
Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
2
Course Specification
By
Dr. M.K. Jayanthi Kannan, M.E.,MS.,MBA., M.Phil., Ph.D.,
Professor and HOD ISE,
Faculty of Engineering & Technology,
JAIN Deemed To-Be University,
Bengaluru.
Staff Room: 324- 8.
Office Hours : 8.30 AM -4 PM
Department of Computer Science and
Engineering,
FET Block,
Internet of Things ( Elective 2) by Dr.M.K.Jayanthi Kannan
Module 4 : Arduino UNO, RaspberryPi with Python
IoT Physical Devices and Endpoints
Arduino UNO: Introduction to Arduino,
• Arduino UNO, Installing the Software,
• Fundamentals of Arduino Programming.
• IoT Physical Devices and Endpoints.
RaspberryPi: Introduction to RaspberryPi,
• About the RaspberryPi Board: Hardware Layout,
• Operating Systems on RaspberryPi, Configuring.
Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
Module – 4
IoT Physical Devices and End Point-Aurdino UNO
1
Arduino:
 Arduino is an open-source electronics platform based on easy-
to-use hardware and software.
 Arduino boards are able to read inputs - light on a sensor, a
finger on a button, or a Twitter message - and turn it into an
output - activating a motor, turning on an LED, publishing
something online.
Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
IoT Physical Devices and End Point-Aurdino Uno
1
Arduino:
 Arduino is an open-source electronics platform based on easy-
to-use hardware and software.
 Arduino boards are able to read inputs - light on a sensor, a
finger on a button, or a Twitter message - and turn it into an
output - activating a motor, turning on an LED, publishing
something online.
Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
Module – 4 IoT Physical Devices and End Point-
Aurdino Uno
7
Arduino UNO:
 Arduino Uno is a microcontroller board based on the ATmega328P.
 It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP
header and a reset button.
 "Uno" means one in Italian and was chosen to mark the release of Arduino Software
(IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the
reference versions of Arduino, now evolved to newer releases.
Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
Module – IoT Physical Devices and End Point-
Aurdino Uno
8
1. Reset Button – This will restart any code that is loaded tothe
Arduino board
2. AREF – Stands for “Analog Reference” and is used to set an
external reference voltage
3. Ground Pin – There are a few ground pins on the Arduinoand
they all work the same
analog output
4.Digital Input/Output – Pins 0-13 can be used for digital input or 12. 3.3V Pin – This pin supplies 3.3 volts of power to your projects
output
13. 5V Pin – This pin supplies 5 volts of power to your projects
5. PWM – The pins marked with the (~) symbol can simulate
6. USB Connection – Used for powering up your Arduino and
uploading sketches
7. TX/RX – Transmit and receive data indicationLEDs
8. ATmega Microcontroller – This is the brains and is where the
programs are stored
9. Power LED Indicator – This LED lights up anytime the board is
plugged in a power source
10. Voltage Regulator – This controls the amount of voltage going
into the Arduino board
11. DC Power Barrel Jack – This is used for poweringyour
Arduino with a power supply
14. Ground Pins – There are a few ground pins on theArduino
and they all work the same
15. Analog Pins – These pins can read the signal from an analog
sensor and convert it to digital
9
Module – 6 IoT Physical Devices and End Point-
Aurdino Uno
Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
Module –4 IoT Physical Devices and End Point-Aurdino
Uno
Fundamentals of Arduino Programming:
Two required functions / methods / routines:
void setup()
{
// runs once
}
void loop()
{
// repeats
}
10
digitalWrite()
analogWrite()
digitalRead()
if() statements/ Boolean
analogRead()
Serialcommunication
BIG
6
CONCEPTS
Comments, Comments, Comments
Comments
// this is for single line comments
// it’s good to put at the top and before anything ‘tricky’
/* this is for multi-line comments
Like this…
And this….
*/
comments
Three commands to know…
pinMode(pin, INPUT/OUTPUT);
ex: pinMode(13, OUTPUT);
digitalWrite(pin, HIGH/LOW);
ex: digitalWrite(13, HIGH);
delay(time_ms);
ex: delay(2500); // delay of 2.5 sec.
// NOTE: -> commands are CASE-sensitive
Arduino Code Basics
Arduino programs run on two basic sections:
void setup() {
//setup motors, sensors etc
}
void loop() {
// get information from sensors
// send commands to motors
}
SETUP
16 16
The setup section is used for assigning input and outputs
(Examples: motors, LED’s,sensors etc) to ports on theArduino
It also specifies whether the device is OUTPUT or INPUT
To do this we use the command “pinMode”
SETUP
void setup() {
pinMode(9, OUTPUT);
}
port #
Input or Output
void loop() {
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(1000);
}
L
OOP
Port # from setup
Turn the LED on
or off
Wait for 1 second
or 1000 milliseconds
18
int val = 5;
DECLARING A VARIABLE
Type
assignment
“becomes”
variable name
value
19
USING VARIABLES
int delayTime = 2000;
digitalWrite(greenLED, HIGH);
delay(delayTime);
}
int greenLED = 9;
void setup() {
Declare delayTime
pinMode(greenLED, OUTPUT)V;ariable
}
void loop() {
Use delayTime
digitalWrite(greenLED, LOVWa)ri;able
delay(delayTime);
20
Using Variables
int delayTime = 2000;
int greenLED = 9;
}
void setup() {
pinMode(greenLED, OUTPUT);
}
void loop() {
digitalWrite(greenLED, HIGH);
delay(delayTime);
digitalWrite(greenLED, LOW);
delayTime = delayTime - 100;
delay(delayTime);
subtract 100 from
21
delayTime to gradually
increase LED’s blinking
speed
Conditions
To make decisions in Arduino code we
use an ‘if’ statement
‘If’ statements are based on a TRUE or
FALSE question
23
VALUE COMPARISONS
GREATER THAN
a > b
LESS
a < b
EQUAL
a == b
GREATER THAN OR EQUAL
a >= b
LESS THAN OR EQUAL
a <= b
NOT EQUAL
a != b
IF Condition
if(true)
{
“perform some action”
}
25
int counter = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
if(counter < 10)
{
Serial.println(counter);
}
counter = counter + 1;
}
IF Example
Input & Output
Transferring data from the computer to an Arduino
is done using Serial Transmission
To setup Serial communication we use the following
26
void setup() {
Serial.begin(9600);
}
26
Writing to the Console
void setup() {
Serial.begin(9600);
Serial.println(“Hello World!”);
}
void loop() {}
27
IF - ELSE
Condition
if( “answer is true”)
{
“perform some action”
}
else
{
“perform some other action”
}
29
int counter = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
if(counter < 10)
{
Serial.println(“less than 10”);
}
else
{
Serial.println(“greater than or equal to 10”);
Serial.end();
}
counter = counter + 1;}
IF - ELSE Example
IF - ELSE IF
Condition
if( “answer is true”)
{
“perform some action”
}
else if( “answer is true”)
{
“perform some other action”
}
31
int counter = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
if(counter < 10)
{
Serial.println(“less than 10”);
}
else if (counter == 10)
{
Serial.println(“equal to 10”);
}
else
{
Serial.println(“greater than 10”);
Serial.end();
}
counter = counter + 1;
}
IF - ELSE Example
BOOLEAN OPERATORS - AND
32 32
If we want all of the conditions to be true we need to use ‘AND’ logic (AND gate)
We use the symbols &&
• Example
if ( val > 10 && val < 20)
BOOLEAN OPERATORS - OR
33 32
If we want either of the conditions to be true we need to use ‘OR’ logic (OR gate)
We use the symbols ||
• Example
if ( val < 10 || val > 20)
34
BOOLEAN VARIABLES
boolean done = true;
boolean done = false;
void setup() {
Serial.begin(9600);}
void loop() {
if(!done) {
Serial.println(“HELLOWORLD”);
done = true; }
}
Important functions
• Serial.println(value);
– Prints the value to the Serial Monitor on your computer
• pinMode(pin, mode);
– Configures a digital pin to read (input) or write (output) a digital value
• digitalRead(pin);
– Reads a digital value (HIGH or LOW) on a pin set for input
• digitalWrite(pin, value);
– Writes the digital value (HIGH or LOW) to a pin set for output
• Essential Programming Concepts
– Delay
– Infinite Loop
• General Input/Output
– Polling or Busy/Wait I/O
– Interrupt Processing
• Timers and Internal Inteerrupts
• High-Level Language Extensions
• Code Transformations for Embedded Computing
– Loop Unrolling
– Loop Merging
– Loop Peeling
– Loop Tiling
OUTLINE
• Delays are essential in embedded systems, unlike high-
performance systems where we want the program to
execute as fast as possible
• Delays are used to synchronize events, or read inputs
with a specific sampling freqency (more on Bus/Wait I/O)
DELAY (1/3)
• Okay, so how do we build a delay function?
• Our reference is the system clock frequency
• We use a register or a timer to measure ticks
• Each tick is 1/frequency
• Example: Assuming a 16-bit processor, an increment
and a jump instruction is 1-cycle each and a 10 MHz
system clock, build a 1-sec delay:
• T = 1/10 MHz = 100 ns
• 1 s/100 ns = 10,000,000
int i=5000000; //2 ticks per iteration
BACK: i--;
if (i!=0) goto BACK;
DELAY (3/3)
• Embedded Systems are mostly single-functioned
• Their core application never terminates
• Infinite loops are not forbidden as long as they are done
correctly
Infinite Loop (1/2)
void main()
{
light enum {RED, ORANGE, GREEN};
loop: light = RED; //no exit from loop!
delay(20000); //20-sec red
light = ORANGE;
//2-sed orange
delay(2000);
light = GREEN;
delay(20000);
goto loop;
//20-sec green
//just repeat sequence
}
Infinite Loop (2/2)
 ARUDINO UNO and RasberryPi with Python

More Related Content

Similar to ARUDINO UNO and RasberryPi with Python

arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfssusere5db05
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2srknec
 
SKAD Electronics Training Manual.pdf
SKAD Electronics Training Manual.pdfSKAD Electronics Training Manual.pdf
SKAD Electronics Training Manual.pdfKadiriIbrahim2
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptxaravind Guru
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorssaritasapkal
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptxshivagoud45
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 PresentationYogendra Tamang
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixelssdcharle
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
introduction of arduino and node mcu
introduction of arduino and node mcuintroduction of arduino and node mcu
introduction of arduino and node mcu6305HASANBASARI
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docxAjay578679
 
Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Ankita Tiwari
 
Ardx eg-spar-web-rev10
Ardx eg-spar-web-rev10Ardx eg-spar-web-rev10
Ardx eg-spar-web-rev10stemplar
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote controlVilayatAli5
 

Similar to ARUDINO UNO and RasberryPi with Python (20)

arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
 
Aurdino presentation
Aurdino presentationAurdino presentation
Aurdino presentation
 
SKAD Electronics Training Manual.pdf
SKAD Electronics Training Manual.pdfSKAD Electronics Training Manual.pdf
SKAD Electronics Training Manual.pdf
 
Embedded system application
Embedded system applicationEmbedded system application
Embedded system application
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptx
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensors
 
Arduino: Arduino starter kit
Arduino: Arduino starter kitArduino: Arduino starter kit
Arduino: Arduino starter kit
 
Arduino_Beginner.pptx
Arduino_Beginner.pptxArduino_Beginner.pptx
Arduino_Beginner.pptx
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
introduction of arduino and node mcu
introduction of arduino and node mcuintroduction of arduino and node mcu
introduction of arduino and node mcu
 
Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
 
Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.
 
Ardx eg-spar-web-rev10
Ardx eg-spar-web-rev10Ardx eg-spar-web-rev10
Ardx eg-spar-web-rev10
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote control
 

More from Jayanthi Kannan MK

1 18CS54 _Software Engineering and Testing _Introduction to CO PO _Syllabus ...
1  18CS54 _Software Engineering and Testing _Introduction to CO PO _Syllabus ...1  18CS54 _Software Engineering and Testing _Introduction to CO PO _Syllabus ...
1 18CS54 _Software Engineering and Testing _Introduction to CO PO _Syllabus ...Jayanthi Kannan MK
 
MODULE 1 Software Product and Process_ SW ENGG 22CSE141.pdf
MODULE 1 Software Product and Process_ SW ENGG  22CSE141.pdfMODULE 1 Software Product and Process_ SW ENGG  22CSE141.pdf
MODULE 1 Software Product and Process_ SW ENGG 22CSE141.pdfJayanthi Kannan MK
 
2nd MODULE Software Requirements _ SW ENGG 22CSE141.pdf
2nd MODULE  Software Requirements   _ SW ENGG  22CSE141.pdf2nd MODULE  Software Requirements   _ SW ENGG  22CSE141.pdf
2nd MODULE Software Requirements _ SW ENGG 22CSE141.pdfJayanthi Kannan MK
 
Unit 2 Smart Objects _IOT by Dr.M.K.Jayanthi.pdf
Unit 2 Smart Objects _IOT  by Dr.M.K.Jayanthi.pdfUnit 2 Smart Objects _IOT  by Dr.M.K.Jayanthi.pdf
Unit 2 Smart Objects _IOT by Dr.M.K.Jayanthi.pdfJayanthi Kannan MK
 
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
5 IOT MODULE 5 RaspberryPi Programming using Python.pdfJayanthi Kannan MK
 
3 IOT Part 3 IP as the IoT Network Layer Access Technologies.pdf
3 IOT Part 3 IP as the IoT Network Layer Access Technologies.pdf3 IOT Part 3 IP as the IoT Network Layer Access Technologies.pdf
3 IOT Part 3 IP as the IoT Network Layer Access Technologies.pdfJayanthi Kannan MK
 
1 Unit 1 Introduction _IOT by Dr.M.K.Jayanthi Kannan (1).pdf
1 Unit 1  Introduction _IOT  by Dr.M.K.Jayanthi Kannan (1).pdf1 Unit 1  Introduction _IOT  by Dr.M.K.Jayanthi Kannan (1).pdf
1 Unit 1 Introduction _IOT by Dr.M.K.Jayanthi Kannan (1).pdfJayanthi Kannan MK
 
Introduction to Internet of Things
 Introduction to Internet of Things Introduction to Internet of Things
Introduction to Internet of ThingsJayanthi Kannan MK
 
ADBMS Object and Object Relational Databases
ADBMS  Object  and Object Relational Databases ADBMS  Object  and Object Relational Databases
ADBMS Object and Object Relational Databases Jayanthi Kannan MK
 

More from Jayanthi Kannan MK (9)

1 18CS54 _Software Engineering and Testing _Introduction to CO PO _Syllabus ...
1  18CS54 _Software Engineering and Testing _Introduction to CO PO _Syllabus ...1  18CS54 _Software Engineering and Testing _Introduction to CO PO _Syllabus ...
1 18CS54 _Software Engineering and Testing _Introduction to CO PO _Syllabus ...
 
MODULE 1 Software Product and Process_ SW ENGG 22CSE141.pdf
MODULE 1 Software Product and Process_ SW ENGG  22CSE141.pdfMODULE 1 Software Product and Process_ SW ENGG  22CSE141.pdf
MODULE 1 Software Product and Process_ SW ENGG 22CSE141.pdf
 
2nd MODULE Software Requirements _ SW ENGG 22CSE141.pdf
2nd MODULE  Software Requirements   _ SW ENGG  22CSE141.pdf2nd MODULE  Software Requirements   _ SW ENGG  22CSE141.pdf
2nd MODULE Software Requirements _ SW ENGG 22CSE141.pdf
 
Unit 2 Smart Objects _IOT by Dr.M.K.Jayanthi.pdf
Unit 2 Smart Objects _IOT  by Dr.M.K.Jayanthi.pdfUnit 2 Smart Objects _IOT  by Dr.M.K.Jayanthi.pdf
Unit 2 Smart Objects _IOT by Dr.M.K.Jayanthi.pdf
 
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
 
3 IOT Part 3 IP as the IoT Network Layer Access Technologies.pdf
3 IOT Part 3 IP as the IoT Network Layer Access Technologies.pdf3 IOT Part 3 IP as the IoT Network Layer Access Technologies.pdf
3 IOT Part 3 IP as the IoT Network Layer Access Technologies.pdf
 
1 Unit 1 Introduction _IOT by Dr.M.K.Jayanthi Kannan (1).pdf
1 Unit 1  Introduction _IOT  by Dr.M.K.Jayanthi Kannan (1).pdf1 Unit 1  Introduction _IOT  by Dr.M.K.Jayanthi Kannan (1).pdf
1 Unit 1 Introduction _IOT by Dr.M.K.Jayanthi Kannan (1).pdf
 
Introduction to Internet of Things
 Introduction to Internet of Things Introduction to Internet of Things
Introduction to Internet of Things
 
ADBMS Object and Object Relational Databases
ADBMS  Object  and Object Relational Databases ADBMS  Object  and Object Relational Databases
ADBMS Object and Object Relational Databases
 

Recently uploaded

Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Roomdivyansh0kumar0
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
Gram Darshan PPT cyber rural in villages of india
Gram Darshan PPT cyber rural  in villages of indiaGram Darshan PPT cyber rural  in villages of india
Gram Darshan PPT cyber rural in villages of indiaimessage0108
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 

Recently uploaded (20)

Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
Gram Darshan PPT cyber rural in villages of india
Gram Darshan PPT cyber rural  in villages of indiaGram Darshan PPT cyber rural  in villages of india
Gram Darshan PPT cyber rural in villages of india
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 

ARUDINO UNO and RasberryPi with Python

  • 1. Internet of Things IoT Physical Devices and End points and RaspberryPi
  • 2. Internet of Things IoT Physical Devices and Endpoints Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
  • 3. 2 Course Specification By Dr. M.K. Jayanthi Kannan, M.E.,MS.,MBA., M.Phil., Ph.D., Professor and HOD ISE, Faculty of Engineering & Technology, JAIN Deemed To-Be University, Bengaluru. Staff Room: 324- 8. Office Hours : 8.30 AM -4 PM Department of Computer Science and Engineering, FET Block, Internet of Things ( Elective 2) by Dr.M.K.Jayanthi Kannan
  • 4. Module 4 : Arduino UNO, RaspberryPi with Python IoT Physical Devices and Endpoints Arduino UNO: Introduction to Arduino, • Arduino UNO, Installing the Software, • Fundamentals of Arduino Programming. • IoT Physical Devices and Endpoints. RaspberryPi: Introduction to RaspberryPi, • About the RaspberryPi Board: Hardware Layout, • Operating Systems on RaspberryPi, Configuring. Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
  • 5. Module – 4 IoT Physical Devices and End Point-Aurdino UNO 1 Arduino:  Arduino is an open-source electronics platform based on easy- to-use hardware and software.  Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
  • 6. IoT Physical Devices and End Point-Aurdino Uno 1 Arduino:  Arduino is an open-source electronics platform based on easy- to-use hardware and software.  Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
  • 7. Module – 4 IoT Physical Devices and End Point- Aurdino Uno 7 Arduino UNO:  Arduino Uno is a microcontroller board based on the ATmega328P.  It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button.  "Uno" means one in Italian and was chosen to mark the release of Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of Arduino, now evolved to newer releases. Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
  • 8. Module – IoT Physical Devices and End Point- Aurdino Uno 8
  • 9. 1. Reset Button – This will restart any code that is loaded tothe Arduino board 2. AREF – Stands for “Analog Reference” and is used to set an external reference voltage 3. Ground Pin – There are a few ground pins on the Arduinoand they all work the same analog output 4.Digital Input/Output – Pins 0-13 can be used for digital input or 12. 3.3V Pin – This pin supplies 3.3 volts of power to your projects output 13. 5V Pin – This pin supplies 5 volts of power to your projects 5. PWM – The pins marked with the (~) symbol can simulate 6. USB Connection – Used for powering up your Arduino and uploading sketches 7. TX/RX – Transmit and receive data indicationLEDs 8. ATmega Microcontroller – This is the brains and is where the programs are stored 9. Power LED Indicator – This LED lights up anytime the board is plugged in a power source 10. Voltage Regulator – This controls the amount of voltage going into the Arduino board 11. DC Power Barrel Jack – This is used for poweringyour Arduino with a power supply 14. Ground Pins – There are a few ground pins on theArduino and they all work the same 15. Analog Pins – These pins can read the signal from an analog sensor and convert it to digital 9 Module – 6 IoT Physical Devices and End Point- Aurdino Uno Internet of Things(Elective 2) Prepared by Dr. MK Jayanthi Kannan
  • 10. Module –4 IoT Physical Devices and End Point-Aurdino Uno Fundamentals of Arduino Programming: Two required functions / methods / routines: void setup() { // runs once } void loop() { // repeats } 10
  • 12. Comments, Comments, Comments Comments // this is for single line comments // it’s good to put at the top and before anything ‘tricky’ /* this is for multi-line comments Like this… And this…. */
  • 14. Three commands to know… pinMode(pin, INPUT/OUTPUT); ex: pinMode(13, OUTPUT); digitalWrite(pin, HIGH/LOW); ex: digitalWrite(13, HIGH); delay(time_ms); ex: delay(2500); // delay of 2.5 sec. // NOTE: -> commands are CASE-sensitive
  • 15. Arduino Code Basics Arduino programs run on two basic sections: void setup() { //setup motors, sensors etc } void loop() { // get information from sensors // send commands to motors }
  • 16. SETUP 16 16 The setup section is used for assigning input and outputs (Examples: motors, LED’s,sensors etc) to ports on theArduino It also specifies whether the device is OUTPUT or INPUT To do this we use the command “pinMode”
  • 17. SETUP void setup() { pinMode(9, OUTPUT); } port # Input or Output
  • 18. void loop() { digitalWrite(9, HIGH); delay(1000); digitalWrite(9, LOW); delay(1000); } L OOP Port # from setup Turn the LED on or off Wait for 1 second or 1000 milliseconds 18
  • 19. int val = 5; DECLARING A VARIABLE Type assignment “becomes” variable name value 19
  • 20. USING VARIABLES int delayTime = 2000; digitalWrite(greenLED, HIGH); delay(delayTime); } int greenLED = 9; void setup() { Declare delayTime pinMode(greenLED, OUTPUT)V;ariable } void loop() { Use delayTime digitalWrite(greenLED, LOVWa)ri;able delay(delayTime); 20
  • 21. Using Variables int delayTime = 2000; int greenLED = 9; } void setup() { pinMode(greenLED, OUTPUT); } void loop() { digitalWrite(greenLED, HIGH); delay(delayTime); digitalWrite(greenLED, LOW); delayTime = delayTime - 100; delay(delayTime); subtract 100 from 21 delayTime to gradually increase LED’s blinking speed
  • 22. Conditions To make decisions in Arduino code we use an ‘if’ statement ‘If’ statements are based on a TRUE or FALSE question
  • 23. 23 VALUE COMPARISONS GREATER THAN a > b LESS a < b EQUAL a == b GREATER THAN OR EQUAL a >= b LESS THAN OR EQUAL a <= b NOT EQUAL a != b
  • 25. 25 int counter = 0; void setup() { Serial.begin(9600); } void loop() { if(counter < 10) { Serial.println(counter); } counter = counter + 1; } IF Example
  • 26. Input & Output Transferring data from the computer to an Arduino is done using Serial Transmission To setup Serial communication we use the following 26 void setup() { Serial.begin(9600); } 26
  • 27. Writing to the Console void setup() { Serial.begin(9600); Serial.println(“Hello World!”); } void loop() {} 27
  • 28. IF - ELSE Condition if( “answer is true”) { “perform some action” } else { “perform some other action” }
  • 29. 29 int counter = 0; void setup() { Serial.begin(9600); } void loop() { if(counter < 10) { Serial.println(“less than 10”); } else { Serial.println(“greater than or equal to 10”); Serial.end(); } counter = counter + 1;} IF - ELSE Example
  • 30. IF - ELSE IF Condition if( “answer is true”) { “perform some action” } else if( “answer is true”) { “perform some other action” }
  • 31. 31 int counter = 0; void setup() { Serial.begin(9600); } void loop() { if(counter < 10) { Serial.println(“less than 10”); } else if (counter == 10) { Serial.println(“equal to 10”); } else { Serial.println(“greater than 10”); Serial.end(); } counter = counter + 1; } IF - ELSE Example
  • 32. BOOLEAN OPERATORS - AND 32 32 If we want all of the conditions to be true we need to use ‘AND’ logic (AND gate) We use the symbols && • Example if ( val > 10 && val < 20)
  • 33. BOOLEAN OPERATORS - OR 33 32 If we want either of the conditions to be true we need to use ‘OR’ logic (OR gate) We use the symbols || • Example if ( val < 10 || val > 20)
  • 34. 34 BOOLEAN VARIABLES boolean done = true; boolean done = false; void setup() { Serial.begin(9600);} void loop() { if(!done) { Serial.println(“HELLOWORLD”); done = true; } }
  • 35. Important functions • Serial.println(value); – Prints the value to the Serial Monitor on your computer • pinMode(pin, mode); – Configures a digital pin to read (input) or write (output) a digital value • digitalRead(pin); – Reads a digital value (HIGH or LOW) on a pin set for input • digitalWrite(pin, value); – Writes the digital value (HIGH or LOW) to a pin set for output
  • 36. • Essential Programming Concepts – Delay – Infinite Loop • General Input/Output – Polling or Busy/Wait I/O – Interrupt Processing • Timers and Internal Inteerrupts • High-Level Language Extensions • Code Transformations for Embedded Computing – Loop Unrolling – Loop Merging – Loop Peeling – Loop Tiling OUTLINE
  • 37. • Delays are essential in embedded systems, unlike high- performance systems where we want the program to execute as fast as possible • Delays are used to synchronize events, or read inputs with a specific sampling freqency (more on Bus/Wait I/O) DELAY (1/3)
  • 38. • Okay, so how do we build a delay function? • Our reference is the system clock frequency • We use a register or a timer to measure ticks • Each tick is 1/frequency • Example: Assuming a 16-bit processor, an increment and a jump instruction is 1-cycle each and a 10 MHz system clock, build a 1-sec delay: • T = 1/10 MHz = 100 ns • 1 s/100 ns = 10,000,000 int i=5000000; //2 ticks per iteration BACK: i--; if (i!=0) goto BACK; DELAY (3/3)
  • 39. • Embedded Systems are mostly single-functioned • Their core application never terminates • Infinite loops are not forbidden as long as they are done correctly Infinite Loop (1/2)
  • 40. void main() { light enum {RED, ORANGE, GREEN}; loop: light = RED; //no exit from loop! delay(20000); //20-sec red light = ORANGE; //2-sed orange delay(2000); light = GREEN; delay(20000); goto loop; //20-sec green //just repeat sequence } Infinite Loop (2/2)