[go: up one dir, main page]

0% found this document useful (0 votes)
18 views30 pages

Arduino (Autosaved)

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

Arduino (Autosaved)

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

APPLICATIONS OF

IOT IN INDUSTRY

Working with the Arduino microcontroller

By
Chetan Naik J
SKYRIM INNOVATIONS
PROJECT IDEA:
AUTOMATED MINI CITY

2 2
MINI CITY
• Light sensitive street lights
• Timed Traffic Lights
• Automated Gates using proximity sensor
• Cars that drive the City streets

3 3
Cambridge Institute of Technology
Cambridge Institute of Technology
Cambridge Institute of Technology
Cambridge Institute of Technology
Cambridge Institute of Technology
Cambridge Institute of Technology
Definition
Internet of things means a network of physical things (objects) sending,
receiving, or communicating
information using the Internet or other communication technologies and network
just as the computers, Tablets and mobiles do, and thus enabling the monitoring,
coordinating or controlling process across the Internet or another data network.

Internet of things is the network of physical objects or things embedded with


electronics, software, sensors and connectivity to enable it to achieve greater
value and service by exchanging data with the manufacturer, operator and /or
other connected devices. Each thing is uniquely identifiable through its
embedded computing system but is able to interoperate within the existing
Internet infrastructure.

IOT Vision
Internet of things is a vision where things ( wearable watches, alarm clock,
home devices, surrounding objects) become smart and function like living
entities by sensing, computing and communicating through embedded devices
which interact with remote objects (servers, clouds, applications, services and
SIMPLE CONCEPTUAL
11

FRAMEWORK
• A framework for a single device communicating with a central server for
acquiring data

• This equation describes the IoT consists of single device, a controller,


sensor, and actuators, and the Internet for connectivity to a web service & a
mobile service provider

• Source: Adrian McEwen & Hakim Cassimally equation

12/08/2024 Dept. of ECE, Cambridge Institute of Technology


SMART HOME 12

12/08/2024 Dept. of ECE, Cambridge Institute of Technology


ARDUINO
PROGRAMMING
Digital I/O (2 – 13) Serial Transfer (0 -1)

USB (Data & Power)

Power Source Reset


Jumper

Alternate Power (9V)

5V / 9V / GND (x2) Analog Input (0 – 5)


Compile Upload to controller Serial Monitor

Arduino
IDE
Window

Code Editor

Text Output (Serial Data)


ARDUINO CODE
BASICS
• Commands and other information are sent to LED’s, motors
and from sensors through digital and analog input & output
pins
SETUP - ADDING AN LED

16
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
• The setup section is used for assigning input and outputs (Examples:
motors, LED’s, sensors etc) to ports on the Arduino
• It also specifies whether the device is OUTPUT or INPUT
• To do this we use the command “pinMode”

18 18
SETUP

void setup() {
port #

pinMode(9, OUTPUT);
Input or Output
}

http://www.arduino.cc/en/Reference/HomePage
VARIABLES
• A variable is like “bucket”
• It holds numbers or other values temporarily

value

20 20
DECLARING A
VARIABLE
int val = 5;

assignment
Type “becomes”
value
variable name
21
USING VARIABLES
int delayTime = 2000;
int greenLED = 9;
void setup() {
Declare delayTime
pinMode(greenLED, OUTPUT);Variable

void loop() {

digitalWrite(greenLED,
HIGH); Use delayTime
delay(delayTime); Variable
digitalWrite(greenLED, LOW);
delay(delayTime);

} 22
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;
subtract 100 from
delay(delayTime);
delayTime to gradually
} increase LED’s blinking
speed
23
CONDITIONS

• To make decisions in Arduino code


we use an ‘if’ statement

• ‘If’ statements are based on a TRUE


or FALSE question
VALUE COMPARISONS
GREATER THAN GREATER THAN OR EQUAL

a>b a >= b

LESS LESS THAN OR EQUAL

a<b a <= b

EQUAL NOT EQUAL

a == b a != b

25
IF CONDITION

if(true)
{
asdfadsf
“perform some action”
}
IF EXAMPLE
int counter = 0;

void setup() {
Serial.begin(9600);
}
void loop() {

if(counter < 10)


{
Serial.println(counter);
}
counter = counter + 1;

27
TASK
• Create a program that resets the delayTime to 2000 once it has reached 0

28 28
INPUT & OUTPUT

• Transferring data from the computer to an Arduino is


done using Serial Transmission
• To setup Serial communication we use the following

void setup() {

Serial.begin(9600);

}
29 29
WRITING TO THE
CONSOLE
void setup() {

Serial.begin(9600);
Serial.println(“Hello World!”);

void loop() {}

30

You might also like