SlideShare a Scribd company logo
Line follower competition.
Introduction to...
Arduino
Contents:
 Introduction [20 min]:
1. What is Micro-Controller?
2. What is Arduino?
3. Types of Arduino.
4. Arduino UNO board.
5. Sensors:
- Digital, Analog sensors.
- Light sensors [IR sensor, Photo-Resistor].
 Coding structure and examples [30 min]:
1. Data types and operators.
2. What is “Function”?
3. Control statements [if, if… else, switch case.].
4. Loop statements[while, for, do… while.].
5. Common functions.
 Workshop[20 min] DC motor control:
Introduction
Design, organize, and collaborate
Famous microcontroller
manufacturers are MicroChip,
Atmel, Intel, Analog devices, and
more.
[list]
It is a micro-computer. As any
computer it has internal CPU, RAM,
IOs interface.
It is used for control purposes, and
for data analysis.
Micro-Controller:
Arduino. What is Arduino?
A microcontroller board, contains on-board power supply, USB
port to communicate with PC, and an Atmel microcontroller
chip.
It simplify the process of creating any control system by
providing the standard board that can be programmed and
connected to the system without the need to any sophisticated
PCB design and implementation.
It is an open source hardware, any one can get the details of its
design and modify it or make his own one himself.
Arduino boards:
UNO Mega LilyPad
Arduino BT Arduino Nano Arduino Mini
Arduino UNO:
Digital output
~: PWM.
0,1: Serial port.
In circuit Serial
programming
Atmel
MicroController
Analog input.
Power Supply
USB port
Power input
Digital
and
analog. Digital or Analog?
All physical quantities are analog.
Analog means that the quantity can take any value between its
minimum value and maximum value.
Digital means that the quantity can take specific levels of values
with specific offset between each other.
Ex: 1- Digital:
English alpha consists of 26 letter, there is no letter between A
and B.
- Square waves are Digital.
Ex.: 2- Analog:
Temperature, can take any value[-1,12.8,25.002,… etc.].
- Sine waves are analog.
Sensors Sensors:
A device that transforms the physical quantity into electrical
value.
Ex.: Light sensor transduce the light into change in voltage or
resistance.
Sensors Light sensors:
- Photo-Resistor [photo-cell].
- Photo-Diode.
- Photo-Transistor.
Sensors Photo Resistor:
- The value of the resistance depends on
the incident light density.
- 1 K-Ohm at light, 10 K-Ohm at
darkness.
Photo Diode:
- The current is controlled by the incident light density.
Photo Transistor:
- Base-emitter junction is controlled
by the incident light density, has an
amplification effect.
Arduino Coding.
Stylize, edit, and animate your media
Data Types and operators
Integer: used with integer variables with value between
2147483647 and -2147483647.
Ex: int x=1200;
Character: used with single character, represent value from -
127 to 128.
Ex. char c=‘r’;
Long: Long variables are extended size variables for number
storage, and store 32 bits (4 bytes), from -2,147,483,648 to
2,147,483,647.
Ex. long u=199203;
Floating-point numbers can be as large as 3.4028235E+38
and as low as -3.4028235E+38. They are stored as 32 bits (4
bytes) of information.
Ex. float num=1.291; [The same as double type]
You may need to know about these typed: Array, Boolean, byte, etc. here.
Statement represents a command, it ends with ;
Ex:
int x;
x=13;
Operators are symbols that used to indicate a specific
function:
- Math operators: [+,-,*,/,%,^]
- Logic operators: [==, !=, &&, ||]
-Comparison operators: [==, >, <, !=, <=, >=]
Syntax:
; Semicolon, {} curly braces, //single line
comment, /*Multi-line comments*/
Statement and operators:
Compound Operators:
++ (increment)
-- (decrement)
+= (compound addition)
-= (compound subtraction)
*= (compound multiplication)
/= (compound division)
Statement and operators:
If Conditioning:
if(condition)
{
statements-1;
…
Statement-N;
}
else if(condition2)
{
Statements;
}
Else{statements;}
Control statements:
Switch case:
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
}
Control statements:
Do… while:
do
{
Statements;
}
while(condition);
While:
While(condition)
{statements;}
for
// the statements are run at least once.
for (int i=0; i <= val; i++){
statements;
}
Use break statement to stop the loop whenever needed.
Loop statements:
Void setup(){}
Used to indicate the initial values of system on starting.
Void loop(){}
Contains the statements that will run whenever the
system is powered after setup.
Code structure:
Led blinking example:
Used functions:
pinMode();
digitalRead();
digitalWrite();
delay(time_ms);
other functions:
analogRead();
analogWrite();//PWM.
Input and output:
Motor control using Arduino:
Make a motor rotate 2 sec clockwise, and 5 sec counter-
clockwise in an infinite loop;
Time: 10 min.
Workshop:
IEEE MiniaSB.
Thanks for coming 

More Related Content

Similar to arduino (20)

PPTX
Introduction to Arduino Hardware and Programming
Emmanuel Obot
 
PPSX
Arduino by yogesh t s'
tsyogesh46
 
PPT
13223971.ppt
SuYee13
 
PPTX
Introduction to Arduino session and basically it depends how you us and where...
YakshYadav2
 
PDF
VHDL or Verilog: describe your adder and correction logic
mazenkeke2005
 
PPTX
Ardui no
Amol Sakhalkar
 
PDF
arduinoworkshop-160204051621.pdf
AbdErrezakChahoub
 
PPTX
Chapter 5 Arduino Microcontroller Systems .pptx
khgh7
 
KEY
Intro to Arduino
Qtechknow
 
PDF
Ardx experimenters-guide-web
Jhonny Wladimir Peñaloza Cabello
 
PDF
Arduino experimenters guide ARDX
Johnny Parrales
 
PPTX
Introduction to Arduino and Hands on to Iot
Sachin S
 
PPTX
Audible Objects
Leif Bloomquist
 
PDF
Arduino: Arduino starter kit
SANTIAGO PABLO ALBERTO
 
PPTX
arduino-1.pptxbxavvgAzccgzs fla sh ga aana
Shristi60834
 
PPTX
Arduino board program for Mobile robotss
VSARAVANAKUMARHICETS
 
PPT
Arduino Platform with C programming.
Govind Jha
 
PPTX
arduino and its introduction deep dive ppt.pptx
SruSru1
 
PDF
02 Sensors and Actuators Understand .pdf
engsharaf2025
 
Introduction to Arduino Hardware and Programming
Emmanuel Obot
 
Arduino by yogesh t s'
tsyogesh46
 
13223971.ppt
SuYee13
 
Introduction to Arduino session and basically it depends how you us and where...
YakshYadav2
 
VHDL or Verilog: describe your adder and correction logic
mazenkeke2005
 
Ardui no
Amol Sakhalkar
 
arduinoworkshop-160204051621.pdf
AbdErrezakChahoub
 
Chapter 5 Arduino Microcontroller Systems .pptx
khgh7
 
Intro to Arduino
Qtechknow
 
Ardx experimenters-guide-web
Jhonny Wladimir Peñaloza Cabello
 
Arduino experimenters guide ARDX
Johnny Parrales
 
Introduction to Arduino and Hands on to Iot
Sachin S
 
Audible Objects
Leif Bloomquist
 
Arduino: Arduino starter kit
SANTIAGO PABLO ALBERTO
 
arduino-1.pptxbxavvgAzccgzs fla sh ga aana
Shristi60834
 
Arduino board program for Mobile robotss
VSARAVANAKUMARHICETS
 
Arduino Platform with C programming.
Govind Jha
 
arduino and its introduction deep dive ppt.pptx
SruSru1
 
02 Sensors and Actuators Understand .pdf
engsharaf2025
 

More from RabiaAsif31 (9)

PPTX
Robot Architecture.pptx
RabiaAsif31
 
PPTX
ROBOTS THAT CHANGE SHAPE pertation.pptx
RabiaAsif31
 
PPTX
Software.pptx
RabiaAsif31
 
PPTX
Web design-1.pptx
RabiaAsif31
 
PPTX
Robot Architecture.pptx
RabiaAsif31
 
PPTX
Robots.pptx
RabiaAsif31
 
PPT
ch3a-binary-numbers.ppt
RabiaAsif31
 
PPTX
Number System.pptx
RabiaAsif31
 
DOCX
worksheet-CS-1.docx
RabiaAsif31
 
Robot Architecture.pptx
RabiaAsif31
 
ROBOTS THAT CHANGE SHAPE pertation.pptx
RabiaAsif31
 
Software.pptx
RabiaAsif31
 
Web design-1.pptx
RabiaAsif31
 
Robot Architecture.pptx
RabiaAsif31
 
Robots.pptx
RabiaAsif31
 
ch3a-binary-numbers.ppt
RabiaAsif31
 
Number System.pptx
RabiaAsif31
 
worksheet-CS-1.docx
RabiaAsif31
 
Ad

Recently uploaded (20)

PPT
CCTV SYSTEM Installation and Setup method
radioindorezonecctv
 
PPTX
Flannel graphFlannel graphFlannel graphFlannel graphFlannel graph
shareesh25
 
PPT
it_14.ppt using atharva college of engineering
shkzishan810
 
PPT
Confined Space.ppth. Bbbb. Bbbbbbbbbbbbbbbbbbbbbbbnnnjjj
eshaiqbal7
 
PPTX
哪里购买澳洲学历认证查询伊迪斯科文大学成绩单水印ECU录取通知书
Taqyea
 
PPTX
UWE文凭办理|办理西英格兰大学毕业证成绩单GPA修改仿制
Taqyea
 
PPTX
Dock Line Organization Made Easy – Discover AMARREX, the Mooring Line Holder ...
Seawatt
 
PDF
Utility Software hshdgsvcjdgvbdvcfkcdgdc
imeetrinidadfuertesa
 
PPTX
diagnosisinfpdpart1-200628063900 (1).pptx
JayeshTaneja4
 
PPTX
英国学位证(PSU毕业证书)普利茅斯大学毕业证书如何办理
Taqyea
 
PPTX
一比一原版(UoB毕业证)布莱德福德大学毕业证如何办理
Taqyea
 
DOCX
DK DT50W-17 battery tester Operating instruction of upper computer software 2...
ye Evan
 
PPT
COMBINATIONAL LOGIC DESIGN SADSADASDASDASDASDASDASDA
phmthai2300
 
PPTX
ualities-of-Quantitative-Research-1.pptx
jamjamkyong
 
PPTX
Pranjal Accountancy hhw ppt.pptxbnhxududjylitzitzyoxtosoysitztd
nishantrathore042
 
PPT
Computer Hardware and Software Hw and SW .ppt
MuzaFar28
 
PDF
Development of Portable Spectometer For MIlk Qulaity analysis
ppr9495
 
PDF
Elevator Maintenance Checklist with eAuditor Audits & Inspections
eAuditor Audits & Inspections
 
PPTX
原版澳洲莫道克大学毕业证(MU毕业证书)如何办理
Taqyea
 
PPTX
西班牙维尔瓦大学电子版毕业证{UHU毕业完成信UHU水印成绩单}原版制作
Taqyea
 
CCTV SYSTEM Installation and Setup method
radioindorezonecctv
 
Flannel graphFlannel graphFlannel graphFlannel graphFlannel graph
shareesh25
 
it_14.ppt using atharva college of engineering
shkzishan810
 
Confined Space.ppth. Bbbb. Bbbbbbbbbbbbbbbbbbbbbbbnnnjjj
eshaiqbal7
 
哪里购买澳洲学历认证查询伊迪斯科文大学成绩单水印ECU录取通知书
Taqyea
 
UWE文凭办理|办理西英格兰大学毕业证成绩单GPA修改仿制
Taqyea
 
Dock Line Organization Made Easy – Discover AMARREX, the Mooring Line Holder ...
Seawatt
 
Utility Software hshdgsvcjdgvbdvcfkcdgdc
imeetrinidadfuertesa
 
diagnosisinfpdpart1-200628063900 (1).pptx
JayeshTaneja4
 
英国学位证(PSU毕业证书)普利茅斯大学毕业证书如何办理
Taqyea
 
一比一原版(UoB毕业证)布莱德福德大学毕业证如何办理
Taqyea
 
DK DT50W-17 battery tester Operating instruction of upper computer software 2...
ye Evan
 
COMBINATIONAL LOGIC DESIGN SADSADASDASDASDASDASDASDA
phmthai2300
 
ualities-of-Quantitative-Research-1.pptx
jamjamkyong
 
Pranjal Accountancy hhw ppt.pptxbnhxududjylitzitzyoxtosoysitztd
nishantrathore042
 
Computer Hardware and Software Hw and SW .ppt
MuzaFar28
 
Development of Portable Spectometer For MIlk Qulaity analysis
ppr9495
 
Elevator Maintenance Checklist with eAuditor Audits & Inspections
eAuditor Audits & Inspections
 
原版澳洲莫道克大学毕业证(MU毕业证书)如何办理
Taqyea
 
西班牙维尔瓦大学电子版毕业证{UHU毕业完成信UHU水印成绩单}原版制作
Taqyea
 
Ad

arduino

  • 2. Contents:  Introduction [20 min]: 1. What is Micro-Controller? 2. What is Arduino? 3. Types of Arduino. 4. Arduino UNO board. 5. Sensors: - Digital, Analog sensors. - Light sensors [IR sensor, Photo-Resistor].  Coding structure and examples [30 min]: 1. Data types and operators. 2. What is “Function”? 3. Control statements [if, if… else, switch case.]. 4. Loop statements[while, for, do… while.]. 5. Common functions.  Workshop[20 min] DC motor control:
  • 4. Famous microcontroller manufacturers are MicroChip, Atmel, Intel, Analog devices, and more. [list] It is a micro-computer. As any computer it has internal CPU, RAM, IOs interface. It is used for control purposes, and for data analysis. Micro-Controller:
  • 5. Arduino. What is Arduino? A microcontroller board, contains on-board power supply, USB port to communicate with PC, and an Atmel microcontroller chip. It simplify the process of creating any control system by providing the standard board that can be programmed and connected to the system without the need to any sophisticated PCB design and implementation. It is an open source hardware, any one can get the details of its design and modify it or make his own one himself.
  • 6. Arduino boards: UNO Mega LilyPad Arduino BT Arduino Nano Arduino Mini
  • 7. Arduino UNO: Digital output ~: PWM. 0,1: Serial port. In circuit Serial programming Atmel MicroController Analog input. Power Supply USB port Power input
  • 8. Digital and analog. Digital or Analog? All physical quantities are analog. Analog means that the quantity can take any value between its minimum value and maximum value. Digital means that the quantity can take specific levels of values with specific offset between each other. Ex: 1- Digital: English alpha consists of 26 letter, there is no letter between A and B. - Square waves are Digital. Ex.: 2- Analog: Temperature, can take any value[-1,12.8,25.002,… etc.]. - Sine waves are analog.
  • 9. Sensors Sensors: A device that transforms the physical quantity into electrical value. Ex.: Light sensor transduce the light into change in voltage or resistance.
  • 10. Sensors Light sensors: - Photo-Resistor [photo-cell]. - Photo-Diode. - Photo-Transistor.
  • 11. Sensors Photo Resistor: - The value of the resistance depends on the incident light density. - 1 K-Ohm at light, 10 K-Ohm at darkness. Photo Diode: - The current is controlled by the incident light density. Photo Transistor: - Base-emitter junction is controlled by the incident light density, has an amplification effect.
  • 12. Arduino Coding. Stylize, edit, and animate your media
  • 13. Data Types and operators Integer: used with integer variables with value between 2147483647 and -2147483647. Ex: int x=1200; Character: used with single character, represent value from - 127 to 128. Ex. char c=‘r’; Long: Long variables are extended size variables for number storage, and store 32 bits (4 bytes), from -2,147,483,648 to 2,147,483,647. Ex. long u=199203; Floating-point numbers can be as large as 3.4028235E+38 and as low as -3.4028235E+38. They are stored as 32 bits (4 bytes) of information. Ex. float num=1.291; [The same as double type] You may need to know about these typed: Array, Boolean, byte, etc. here.
  • 14. Statement represents a command, it ends with ; Ex: int x; x=13; Operators are symbols that used to indicate a specific function: - Math operators: [+,-,*,/,%,^] - Logic operators: [==, !=, &&, ||] -Comparison operators: [==, >, <, !=, <=, >=] Syntax: ; Semicolon, {} curly braces, //single line comment, /*Multi-line comments*/ Statement and operators:
  • 15. Compound Operators: ++ (increment) -- (decrement) += (compound addition) -= (compound subtraction) *= (compound multiplication) /= (compound division) Statement and operators:
  • 17. Switch case: 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 } Control statements:
  • 18. Do… while: do { Statements; } while(condition); While: While(condition) {statements;} for // the statements are run at least once. for (int i=0; i <= val; i++){ statements; } Use break statement to stop the loop whenever needed. Loop statements:
  • 19. Void setup(){} Used to indicate the initial values of system on starting. Void loop(){} Contains the statements that will run whenever the system is powered after setup. Code structure:
  • 20. Led blinking example: Used functions: pinMode(); digitalRead(); digitalWrite(); delay(time_ms); other functions: analogRead(); analogWrite();//PWM. Input and output:
  • 21. Motor control using Arduino: Make a motor rotate 2 sec clockwise, and 5 sec counter- clockwise in an infinite loop; Time: 10 min. Workshop: