SlideShare a Scribd company logo
INTRODUCTION TO
ARDUINO
MICROCONTROLLERS
By: Mujahid Hussain
sirmujahid@Hotmail.com
Start with the name of Allah (SWT), Who is most Merciful and
Most Beneficent
WHAT IS ARDUINO
• Arduino is an open-source project
that created microcontroller-based
kits for building digital devices and
interactive objects that can sense
and control physical devices.
• These systems provide sets of digital
and analog input/output (I/O) pins
that can interface to various
expansion boards (termed shields)
and other circuits.
WHAT IS MICRO-CONTROLLER
• A microcontroller is basically a small-scale computer with
generalized (and programmable) inputs and outputs.
• The inputs and outputs can be manipulated by and can
manipulate the physical world.
• Programmers work in the virtual world.
• Machinery works in the physical world.
• How does one connect the virtual world to the physical world?
• Simply enter the Microcontroller.
ARDUINO TYPES
• Many different versions
• Number of input/output channels
• Form factor
• Processor
• Leonardo
• Due
• Micro
• LilyPad
• Esplora
• Uno
ARDUINO UNO
• Invented / Launched in 2010
• The pins are in three groups:
• 14 digital pins
• 6 analog pins
• 6 PWM pins
• Digital pin 0 & 1 is used for RX
TX
• 16MHz Clock speed
• 32KB Flash memory
• 2KB SRAM
• 1KB EEPROM
• Analog Reference pin (orange)
• Digital Ground (light green)
• Digital Pins 2-13 (green)
• Digital Pins 0-1/Serial In/Out - TX/RX (dark green)
- These pins cannot be used for digital i/o
(digitalRead and digitalWrite)
• Reset Button - S1 (dark blue)
• In-circuit Serial Programmer (blue-green)
• Analog In Pins 0-5 (light blue)
• Power and Ground Pins (power: orange, grounds:
light orange)
• External Power Supply In (9-12VDC) - X1 (pink)
• Toggles External Power and USB Power (place
jumper on two pins closest to desired supply) -
SV1 (purple)
• USB (used for uploading sketches to the board and
for serial communication between the board andhttps://www.arduino.cc/en/Reference/Board
THE ARDUINO IDE
The main features you need to know about are:
• Code area: This is where you will type all your
code
• Info panel: This will show any errors during
compiling or uploading code to your Arduino
• Verify: This allows you to compile your code to
code the Arduino understands. Any mistakes you
have made in the syntax of your code will be
show in the info pannel
• Upload: This does the same as verify but will
then send your code to your Arduino if the code
is verified successfully
• Serial Monitor: This will open a window that
allows you to send text to and from an Arduino.
We will use this feature in later lectures.
THE ARDUINO IDE
By far one of the most valuable part of the
Arduino software is its vast library of
example programs. All features of the
Arduino are demonstrated in these.
Optional libraries usually add their own
examples on how to use them.
If these examples don’t cover what you
need…. Google it!
BEFORE WE BEGIN CODING
STRUCTURE OF AN ARDUINO “SKETCH”
void setup()
{
// put your setup code here, to run once:
}
void loop()
{
// put your main code here, to run repeatedly:
}
FIRST PROGRAM, SINGLE LED SKETCH
int onBoardLED; // Variable Defined
void setup()
{
//Arduinos have an on-board LED on pin 13
onBoardLED = 13;
pinMode(onBoardLED, OUTPUT);
}
void loop()
{
digitalWrite(onBoardLED, HIGH);
delay(500); //delay measured in milliseconds
digitalWrite(onBoardLED, LOW);
delay(500);
}
LED LIGHT
USER INTERFACE (VISUAL BASIC)
USER INTERFACE CODE (VISUAL BASIC)
ARDUINO PROGRAM (SERIAL COM)
• The baud rate is the rate at
which information is
transferred in a
communication channel. In
the serial port context, "9600
baud" means that the serial
port is capable of
transferring a maximum of
9600 bits per second.
4 LED BLINK SKETCH
void setup( ) {
pinMode(1,
OUTPUT);
pinMode(3,
OUTPUT);
pinMode(5,
OUTPUT);
pinMode(7,
OUTPUT);
}
void loop( ) {
digitalWrite(1, HIGH);
delay (200);
digitalWrite(1, LOW);
digitalWrite(3, HIGH);
delay (200);
digitalWrite(3, LOW);
digitalWrite(5, HIGH);
delay (200);
digitalWrite(5, LOW);
digitalWrite(7, HIGH);
delay (200);
digitalWrite(7, LOW);
}
BREADBOARD
BREADBOARD
STRUCTURE
setup() {
• The setup() function is called when a sketch starts. Use it to initialize
variables, pin modes, start using libraries, etc. The setup function will
only run once, after each powerup or reset of the Arduino board.
}
loop() {
• After creating a setup() function, which initializes and sets the initial
values, the loop() function does precisely what its name suggests,
and loops consecutively, allowing your program to change and
respond. Use it to actively control the Arduino board.
}
CONTROL STRUCTURES
• if
• if...else
• for
• switch case
• while
• do... while
• break
• continue
• return
• goto
IF
• IF which is used in conjunction with a comparison operator,
tests whether a certain condition has been reached, such as an
input being above a certain number. The format for an if test is:
if (someVariable > 50)
{
// do something here
}
IF / ELSE
• if/else allows greater control over the flow of code than the
basic if statement, by allowing multiple tests to be grouped
together.
if (pinFiveInput < 500)
{ // action A }
else
{ // action B }
if (pinFiveInput < 500)
{ // do Thing A }
else if (pinFiveInput >= 1000)
{ // do Thing B }
else
{ // do Thing C }
SWITCH / CASE STATEMENTS:
• Like if statements, switch...case controls the flow of programs
by allowing programmers to specify different code that should
be executed in various conditions.
switch (var) {
case 1:
//do something when var equals 1
break;
case 2:
//do something when var equals 2
break;
default:
// if nothing else matches, do the default
// default is optional
break;
}
WHILE
• while loops will loop continuously, and infinitely, until the
expression inside the parenthesis, () becomes false. Something
must change the tested variable, or the while loop will never
exit. This could be in your code, such as an incremented
variable, or an external condition, such as testing a sensor.
var = 0;
while(var < 200){
// do something repetitive 200 times
var++;
}
ARITHMETIC OPERATORS
= (assignment operator)
+ (addition)
- (subtraction)
* (multiplication)
/ (division)
% (modulo)
COMPARISON OPERATORS
• == (equal to)
• != (not equal to)
• < (less than)
• > (greater than)
• <= (less than or equal to)
• >= (greater than or equal to)
BOOLEAN OPERATORS
• && (and)
• || (or)
• ! (not)
COMPOUND OPERATORS
• ++ (increment)
• -- (decrement)
• += (compound addition)
• -= (compound subtraction)
• *= (compound multiplication)
• /= (compound division)
• %= (compound modulo)
• &= (compound bitwise and)
• |= (compound bitwise or)
VARIABLE - CONSTANTS
• HIGH | LOW (High = On) (Low = Off)
• INPUT | OUTPUT (Input = Receive) (Output = Send)
• true | false
VARIABLE- DATA TYPES
• void
• boolean
• char
• unsigned char
• byte
• int
• unsigned int
• word
• long
• unsigned long
• short
• float
• double
• string - char array
• String - object
• array
FUNCTIONS- DIGITAL I/O
•pinMode()
Configures the specified pin to behave either as an input or an
output.
Syntax: pinMode(pin, mode)
int ledPin = 13; // LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT);
// sets the digital pin as output
}
FUNCTIONS- DIGITAL I/O
•digitalWrite()
• Write a HIGH or a LOW value to a digital pin.
Syntax: digitalWrite(pin, value)
void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}
FUNCTIONS- DIGITAL I/O
•pinMode()
and
•digitalWrite()
int ledPin = 13; // LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT);
// sets the digital pin as output
}
void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}
FUNCTIONS- DIGITAL I/O
•digitalRead()
1. Reads the value from a
specified digital pin,
either HIGH or LOW.
2. pin: the number of the
digital pin you want to
read (int)
int ledPin = 13; // LED connected to digital pin 13
int inPin = 7; // pushbutton connected to digital pin 7
int val = 0; // variable to store the read value
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin 13
as output
pinMode(inPin, INPUT); // sets the digital pin 7 as
input
}
void loop()
{
val = digitalRead(inPin); // read the input pin
digitalWrite(ledPin, val); // sets the LED to the button's
value
}
MATH FUNCTIONS
• min()
• max()
• abs()
• constrain()
• map()
• pow()
• sqrt()
TRIGONOMETRY FUNCTIONS
• sin()
• cos()
• tan()
CHARACTERS FUNCTIONS
• isAlphaNumeric()
• isAlpha()
• isAscii()
• isWhitespace()
• isControl()
• isDigit()
• isGraph()
• isLowerCase()
• isPrintable()
• isPunct()
• isSpace()
• isUpperCase()
• isHexadecimalDigit()
MISCELLANEOUS
• Random Numbers
• randomSeed()
• random()
• Communication
• Serial()
• Stream()
• setTimeout()
THANKS
• Presented by:
Mujahid Hussain
MCS Student
@Preston University Main Campus

More Related Content

What's hot (20)

Distance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic SensorDistance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic Sensor
Edgefxkits & Solutions
 
Bluetooth based home automation using Arduino UNO
Bluetooth based home automation using Arduino UNOBluetooth based home automation using Arduino UNO
Bluetooth based home automation using Arduino UNO
parameshwar koneti
 
Presentation on home automation
Presentation on home automationPresentation on home automation
Presentation on home automation
Subhash Kumar Yadav
 
Embedded systems and their applications in our daily routine
Embedded systems and their applications in our daily routineEmbedded systems and their applications in our daily routine
Embedded systems and their applications in our daily routine
Asad Qayyum Babar
 
Ultrasonic based distance measurement system
Ultrasonic based distance measurement systemUltrasonic based distance measurement system
Ultrasonic based distance measurement system
Mrinal Sharma
 
Arduino
ArduinoArduino
Arduino
vipin7vj
 
IOT and Characteristics of IOT
IOT and  Characteristics of IOTIOT and  Characteristics of IOT
IOT and Characteristics of IOT
AmberSinghal1
 
Silent sound-technology ppt final
Silent sound-technology ppt finalSilent sound-technology ppt final
Silent sound-technology ppt final
Lohit Dalal
 
Project smart notice board ppt
Project smart notice board pptProject smart notice board ppt
Project smart notice board ppt
Rahul Shaw
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
Ahmed Sakr
 
Hardware Software Codesign
Hardware Software CodesignHardware Software Codesign
Hardware Software Codesign
destruck
 
Health monitoring system
Health monitoring systemHealth monitoring system
Health monitoring system
luvMahajan3
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCU
Souvik Kundu
 
Home automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASEDHome automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASED
Ashish Kumar Thakur
 
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCUCONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
VINAY KUMAR GUDELA
 
UNIT-I-RTOS and Concepts
UNIT-I-RTOS and ConceptsUNIT-I-RTOS and Concepts
UNIT-I-RTOS and Concepts
Dr.YNM
 
Project report on home automation using Arduino
Project report on home automation using Arduino Project report on home automation using Arduino
Project report on home automation using Arduino
AMIT SANPUI
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
xavierpaulino
 
Automatic irrigation system by using 8051
Automatic irrigation system by using 8051Automatic irrigation system by using 8051
Automatic irrigation system by using 8051
rohit chandel
 
Ultrasonic sensor
Ultrasonic sensorUltrasonic sensor
Ultrasonic sensor
waad Jamal Almuqbali
 
Distance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic SensorDistance Measurement by Ultrasonic Sensor
Distance Measurement by Ultrasonic Sensor
Edgefxkits & Solutions
 
Bluetooth based home automation using Arduino UNO
Bluetooth based home automation using Arduino UNOBluetooth based home automation using Arduino UNO
Bluetooth based home automation using Arduino UNO
parameshwar koneti
 
Embedded systems and their applications in our daily routine
Embedded systems and their applications in our daily routineEmbedded systems and their applications in our daily routine
Embedded systems and their applications in our daily routine
Asad Qayyum Babar
 
Ultrasonic based distance measurement system
Ultrasonic based distance measurement systemUltrasonic based distance measurement system
Ultrasonic based distance measurement system
Mrinal Sharma
 
IOT and Characteristics of IOT
IOT and  Characteristics of IOTIOT and  Characteristics of IOT
IOT and Characteristics of IOT
AmberSinghal1
 
Silent sound-technology ppt final
Silent sound-technology ppt finalSilent sound-technology ppt final
Silent sound-technology ppt final
Lohit Dalal
 
Project smart notice board ppt
Project smart notice board pptProject smart notice board ppt
Project smart notice board ppt
Rahul Shaw
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
Ahmed Sakr
 
Hardware Software Codesign
Hardware Software CodesignHardware Software Codesign
Hardware Software Codesign
destruck
 
Health monitoring system
Health monitoring systemHealth monitoring system
Health monitoring system
luvMahajan3
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCU
Souvik Kundu
 
Home automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASEDHome automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASED
Ashish Kumar Thakur
 
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCUCONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
VINAY KUMAR GUDELA
 
UNIT-I-RTOS and Concepts
UNIT-I-RTOS and ConceptsUNIT-I-RTOS and Concepts
UNIT-I-RTOS and Concepts
Dr.YNM
 
Project report on home automation using Arduino
Project report on home automation using Arduino Project report on home automation using Arduino
Project report on home automation using Arduino
AMIT SANPUI
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
xavierpaulino
 
Automatic irrigation system by using 8051
Automatic irrigation system by using 8051Automatic irrigation system by using 8051
Automatic irrigation system by using 8051
rohit chandel
 

Viewers also liked (20)

Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino Microcontroller
Shyam Mohan
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
Eoin Brazil
 
AVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerAVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontroller
Mohamed Ali
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Omer Kilic
 
Arduino technical session 1
Arduino technical session 1Arduino technical session 1
Arduino technical session 1
Audiomas Soni
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Yong Heui Cho
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Arduino Presentation
Arduino PresentationArduino Presentation
Arduino Presentation
Davide Gomba
 
Wood eze log splitters
Wood eze log splittersWood eze log splitters
Wood eze log splitters
Log Splitters World
 
IoT開發平台NodeMCU
IoT開發平台NodeMCUIoT開發平台NodeMCU
IoT開發平台NodeMCU
承翰 蔡
 
A Fast Introduction to Arduino and Addressable LED Strips
A Fast Introduction to Arduino and Addressable LED StripsA Fast Introduction to Arduino and Addressable LED Strips
A Fast Introduction to Arduino and Addressable LED Strips
atuline
 
Smart wheelchair - Emotiv-EasyCap-OPENViBE - Final Report - 6-14-16
Smart wheelchair - Emotiv-EasyCap-OPENViBE - Final Report - 6-14-16Smart wheelchair - Emotiv-EasyCap-OPENViBE - Final Report - 6-14-16
Smart wheelchair - Emotiv-EasyCap-OPENViBE - Final Report - 6-14-16
Sina Dabiri
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Green Moon Solutions
 
Buy arduino uno cheap
Buy arduino uno cheapBuy arduino uno cheap
Buy arduino uno cheap
Robomart India
 
Programming Addressable LED Strips
Programming Addressable LED StripsProgramming Addressable LED Strips
Programming Addressable LED Strips
atuline
 
Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introduction
Michal Sedlak
 
Intro arduino English
Intro arduino EnglishIntro arduino English
Intro arduino English
SOAEnsAD
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
David Mellis
 
Robochair
RobochairRobochair
Robochair
Suganya Deivendran
 
Node MCU Fun
Node MCU FunNode MCU Fun
Node MCU Fun
David Bosschaert
 
Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino Microcontroller
Shyam Mohan
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
Eoin Brazil
 
AVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerAVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontroller
Mohamed Ali
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Omer Kilic
 
Arduino technical session 1
Arduino technical session 1Arduino technical session 1
Arduino technical session 1
Audiomas Soni
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Yong Heui Cho
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
avikdhupar
 
Arduino Presentation
Arduino PresentationArduino Presentation
Arduino Presentation
Davide Gomba
 
IoT開發平台NodeMCU
IoT開發平台NodeMCUIoT開發平台NodeMCU
IoT開發平台NodeMCU
承翰 蔡
 
A Fast Introduction to Arduino and Addressable LED Strips
A Fast Introduction to Arduino and Addressable LED StripsA Fast Introduction to Arduino and Addressable LED Strips
A Fast Introduction to Arduino and Addressable LED Strips
atuline
 
Smart wheelchair - Emotiv-EasyCap-OPENViBE - Final Report - 6-14-16
Smart wheelchair - Emotiv-EasyCap-OPENViBE - Final Report - 6-14-16Smart wheelchair - Emotiv-EasyCap-OPENViBE - Final Report - 6-14-16
Smart wheelchair - Emotiv-EasyCap-OPENViBE - Final Report - 6-14-16
Sina Dabiri
 
Programming Addressable LED Strips
Programming Addressable LED StripsProgramming Addressable LED Strips
Programming Addressable LED Strips
atuline
 
Nodemcu - introduction
Nodemcu - introductionNodemcu - introduction
Nodemcu - introduction
Michal Sedlak
 
Intro arduino English
Intro arduino EnglishIntro arduino English
Intro arduino English
SOAEnsAD
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
David Mellis
 
Ad

Similar to Introduction to Arduino Microcontroller (20)

arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
rajalakshmi769433
 
Arduino
ArduinoArduino
Arduino
LetzkuLetz Castro
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
sdcharle
 
Arduino course
Arduino courseArduino course
Arduino course
Ahmed Shelbaya
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
ssusere5db05
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
Amit Kumer Podder
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
ethannguyen1618
 
Arduino.pptx
Arduino.pptxArduino.pptx
Arduino.pptx
AadilKk
 
Arduino Workshop @ MSA University
Arduino Workshop @ MSA UniversityArduino Workshop @ MSA University
Arduino Workshop @ MSA University
Ahmed Magdy Farid
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
SAURABHKUMAR892774
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
Jayanthi Kannan MK
 
arduino and its introduction deep dive ppt.pptx
arduino and its introduction deep dive ppt.pptxarduino and its introduction deep dive ppt.pptx
arduino and its introduction deep dive ppt.pptx
SruSru1
 
01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt
pindi2197
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
Md. Nahidul Islam
 
Arduino . .
Arduino             .                             .Arduino             .                             .
Arduino . .
dryazhinians
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
LITS IT Ltd,LASRC.SPACE,SAWDAGOR BD,FREELANCE BD,iREV,BD LAW ACADEMY,SMART AVI,HEA,HFSAC LTD.
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
salih mahmod
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
Syed Mustafa
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
udhayakumarc1
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
sdcharle
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
ssusere5db05
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
Amit Kumer Podder
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
ethannguyen1618
 
Arduino.pptx
Arduino.pptxArduino.pptx
Arduino.pptx
AadilKk
 
Arduino Workshop @ MSA University
Arduino Workshop @ MSA UniversityArduino Workshop @ MSA University
Arduino Workshop @ MSA University
Ahmed Magdy Farid
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
SAURABHKUMAR892774
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
Jayanthi Kannan MK
 
arduino and its introduction deep dive ppt.pptx
arduino and its introduction deep dive ppt.pptxarduino and its introduction deep dive ppt.pptx
arduino and its introduction deep dive ppt.pptx
SruSru1
 
01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt01 Intro to the Arduino and it's basics.ppt
01 Intro to the Arduino and it's basics.ppt
pindi2197
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
salih mahmod
 
Syed IoT - module 5
Syed  IoT - module 5Syed  IoT - module 5
Syed IoT - module 5
Syed Mustafa
 
Ad

Recently uploaded (20)

Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 

Introduction to Arduino Microcontroller

  • 2. Start with the name of Allah (SWT), Who is most Merciful and Most Beneficent
  • 3. WHAT IS ARDUINO • Arduino is an open-source project that created microcontroller-based kits for building digital devices and interactive objects that can sense and control physical devices. • These systems provide sets of digital and analog input/output (I/O) pins that can interface to various expansion boards (termed shields) and other circuits.
  • 4. WHAT IS MICRO-CONTROLLER • A microcontroller is basically a small-scale computer with generalized (and programmable) inputs and outputs. • The inputs and outputs can be manipulated by and can manipulate the physical world. • Programmers work in the virtual world. • Machinery works in the physical world. • How does one connect the virtual world to the physical world? • Simply enter the Microcontroller.
  • 5. ARDUINO TYPES • Many different versions • Number of input/output channels • Form factor • Processor • Leonardo • Due • Micro • LilyPad • Esplora • Uno
  • 6. ARDUINO UNO • Invented / Launched in 2010 • The pins are in three groups: • 14 digital pins • 6 analog pins • 6 PWM pins • Digital pin 0 & 1 is used for RX TX • 16MHz Clock speed • 32KB Flash memory • 2KB SRAM • 1KB EEPROM
  • 7. • Analog Reference pin (orange) • Digital Ground (light green) • Digital Pins 2-13 (green) • Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for digital i/o (digitalRead and digitalWrite) • Reset Button - S1 (dark blue) • In-circuit Serial Programmer (blue-green) • Analog In Pins 0-5 (light blue) • Power and Ground Pins (power: orange, grounds: light orange) • External Power Supply In (9-12VDC) - X1 (pink) • Toggles External Power and USB Power (place jumper on two pins closest to desired supply) - SV1 (purple) • USB (used for uploading sketches to the board and for serial communication between the board andhttps://www.arduino.cc/en/Reference/Board
  • 8. THE ARDUINO IDE The main features you need to know about are: • Code area: This is where you will type all your code • Info panel: This will show any errors during compiling or uploading code to your Arduino • Verify: This allows you to compile your code to code the Arduino understands. Any mistakes you have made in the syntax of your code will be show in the info pannel • Upload: This does the same as verify but will then send your code to your Arduino if the code is verified successfully • Serial Monitor: This will open a window that allows you to send text to and from an Arduino. We will use this feature in later lectures.
  • 9. THE ARDUINO IDE By far one of the most valuable part of the Arduino software is its vast library of example programs. All features of the Arduino are demonstrated in these. Optional libraries usually add their own examples on how to use them. If these examples don’t cover what you need…. Google it!
  • 10. BEFORE WE BEGIN CODING
  • 11. STRUCTURE OF AN ARDUINO “SKETCH” void setup() { // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: }
  • 12. FIRST PROGRAM, SINGLE LED SKETCH int onBoardLED; // Variable Defined void setup() { //Arduinos have an on-board LED on pin 13 onBoardLED = 13; pinMode(onBoardLED, OUTPUT); } void loop() { digitalWrite(onBoardLED, HIGH); delay(500); //delay measured in milliseconds digitalWrite(onBoardLED, LOW); delay(500); }
  • 15. USER INTERFACE CODE (VISUAL BASIC)
  • 16. ARDUINO PROGRAM (SERIAL COM) • The baud rate is the rate at which information is transferred in a communication channel. In the serial port context, "9600 baud" means that the serial port is capable of transferring a maximum of 9600 bits per second.
  • 17. 4 LED BLINK SKETCH void setup( ) { pinMode(1, OUTPUT); pinMode(3, OUTPUT); pinMode(5, OUTPUT); pinMode(7, OUTPUT); } void loop( ) { digitalWrite(1, HIGH); delay (200); digitalWrite(1, LOW); digitalWrite(3, HIGH); delay (200); digitalWrite(3, LOW); digitalWrite(5, HIGH); delay (200); digitalWrite(5, LOW); digitalWrite(7, HIGH); delay (200); digitalWrite(7, LOW); }
  • 20. STRUCTURE setup() { • The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup function will only run once, after each powerup or reset of the Arduino board. } loop() { • After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board. }
  • 21. CONTROL STRUCTURES • if • if...else • for • switch case • while • do... while • break • continue • return • goto
  • 22. IF • IF which is used in conjunction with a comparison operator, tests whether a certain condition has been reached, such as an input being above a certain number. The format for an if test is: if (someVariable > 50) { // do something here }
  • 23. IF / ELSE • if/else allows greater control over the flow of code than the basic if statement, by allowing multiple tests to be grouped together. if (pinFiveInput < 500) { // action A } else { // action B } if (pinFiveInput < 500) { // do Thing A } else if (pinFiveInput >= 1000) { // do Thing B } else { // do Thing C }
  • 24. SWITCH / CASE STATEMENTS: • Like if statements, switch...case controls the flow of programs by allowing programmers to specify different code that should be executed in various conditions. switch (var) { case 1: //do something when var equals 1 break; case 2: //do something when var equals 2 break; default: // if nothing else matches, do the default // default is optional break; }
  • 25. WHILE • while loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor. var = 0; while(var < 200){ // do something repetitive 200 times var++; }
  • 26. ARITHMETIC OPERATORS = (assignment operator) + (addition) - (subtraction) * (multiplication) / (division) % (modulo)
  • 27. COMPARISON OPERATORS • == (equal to) • != (not equal to) • < (less than) • > (greater than) • <= (less than or equal to) • >= (greater than or equal to)
  • 28. BOOLEAN OPERATORS • && (and) • || (or) • ! (not)
  • 29. COMPOUND OPERATORS • ++ (increment) • -- (decrement) • += (compound addition) • -= (compound subtraction) • *= (compound multiplication) • /= (compound division) • %= (compound modulo) • &= (compound bitwise and) • |= (compound bitwise or)
  • 30. VARIABLE - CONSTANTS • HIGH | LOW (High = On) (Low = Off) • INPUT | OUTPUT (Input = Receive) (Output = Send) • true | false
  • 31. VARIABLE- DATA TYPES • void • boolean • char • unsigned char • byte • int • unsigned int • word • long • unsigned long • short • float • double • string - char array • String - object • array
  • 32. FUNCTIONS- DIGITAL I/O •pinMode() Configures the specified pin to behave either as an input or an output. Syntax: pinMode(pin, mode) int ledPin = 13; // LED connected to digital pin 13 void setup() { pinMode(ledPin, OUTPUT); // sets the digital pin as output }
  • 33. FUNCTIONS- DIGITAL I/O •digitalWrite() • Write a HIGH or a LOW value to a digital pin. Syntax: digitalWrite(pin, value) void loop() { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second }
  • 34. FUNCTIONS- DIGITAL I/O •pinMode() and •digitalWrite() int ledPin = 13; // LED connected to digital pin 13 void setup() { pinMode(ledPin, OUTPUT); // sets the digital pin as output } void loop() { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second }
  • 35. FUNCTIONS- DIGITAL I/O •digitalRead() 1. Reads the value from a specified digital pin, either HIGH or LOW. 2. pin: the number of the digital pin you want to read (int) int ledPin = 13; // LED connected to digital pin 13 int inPin = 7; // pushbutton connected to digital pin 7 int val = 0; // variable to store the read value void setup() { pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output pinMode(inPin, INPUT); // sets the digital pin 7 as input } void loop() { val = digitalRead(inPin); // read the input pin digitalWrite(ledPin, val); // sets the LED to the button's value }
  • 36. MATH FUNCTIONS • min() • max() • abs() • constrain() • map() • pow() • sqrt()
  • 38. CHARACTERS FUNCTIONS • isAlphaNumeric() • isAlpha() • isAscii() • isWhitespace() • isControl() • isDigit() • isGraph() • isLowerCase() • isPrintable() • isPunct() • isSpace() • isUpperCase() • isHexadecimalDigit()
  • 39. MISCELLANEOUS • Random Numbers • randomSeed() • random() • Communication • Serial() • Stream() • setTimeout()
  • 40. THANKS • Presented by: Mujahid Hussain MCS Student @Preston University Main Campus