SlideShare a Scribd company logo
1
Arduino Based Applications
By
Jawaher A.Fadhil
B.SC in Electronics Engineering
M.Tech in Computer Engineering
University of Duhok
College of Science
CS Department
Blinking LED (Internal)
2
Blinking led
Open: File -> Examples -> Digital -> Blink
void setup()
{
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
void loop()
{
// turn the LED on by making the voltage HIGH
digitalWrite(13, HIGH);
// wait for a second
delay(1000);
// turn the LED off by making the voltage LOW
digitalWrite(13, LOW);
delay(1000);
}
3
Blinking LED (External)
4
Blinking LED
Parts Required
Breadboard
5mm LED
100 ohm Resistor
Jumper Wires
5
Connect It Up
6
Enter the code
void setup()
{
// initialize digital pin 10 as an output.
pinMode(10, OUTPUT);
}
void loop()
{
// turn the LED on by making the voltage HIGH
digitalWrite(10, HIGH);
// wait for a second
delay(1000);
// turn the LED off by making the voltage LOW
digitalWrite(10, LOW);
delay(1000);
}
7
LED with Pulse Width
Modulation(PWM)
8
PWM
Pulse Width Modulation, or PWM, is a technique for getting
analog results with digital means. Digital control is used to
create a square wave, a signal switched between on and off.
This on-off pattern can simulate voltages in between full on (5
Volts) and off (0 Volts) by changing the portion of the time the
signal spends on versus the time that the signal spends off.
The duration of "on time" is called the pulse width. To get
varying analog values, you change, or modulate, that pulse
width. If you repeat this on-off pattern fast enough with an
LED for example, the result is as if the signal is a steady voltage
between 0 and 5v controlling the brightness of the LED.
9
10
PWM
In the previous graphic, the green lines represent a regular
time period. This duration or period is the inverse of the PWM
frequency. In other words, with Arduino's PWM frequency at
about 500Hz, the green lines would measure 2 milliseconds
each. A call to analogWrite() is on a scale of 0 - 255, such that
analogWrite(255) requests a 100% duty cycle (always on), and
analogWrite(127) is a 50% duty cycle (on half the time) for
example.
11
PWM
To build such application, you need the
following components:
 Arduino Uno
 USB cable
 LED
 Resistor 1k
 Jumper wires
12
PWM
13
int pin=10;
void setup()
{
pinMode(pin, OUTPUT);
}
void loop()
{
for(int i=0;i<=255;i++)
{
analogWrite(pin, i);
delay(20);
}
for(int i=255;i>=0;i--)
{
analogWrite(pin, i);
delay(20);
}
}
RGB LED
14
What is RGB LED?
The RGB LED can emit different colors by mixing the 3 basic
colors red, green and blue. So it actually consists of 3 separate
LEDs red, green and blue packed in a single case. That’s why it
has 4 leads, one lead for each of the 3 colors and one
common cathode or anode depending of the RGB LED type.
15
RGB LED
Components needed
• RGB LED
• 3x 220 Ohms Resistors
• Arduino Board
• Breadboard and Jump Wires
16
The cathode will be connected to the ground and the 3 anodes
will be connected through 220 Ohms resistors to 3 digital pins
on the Arduino Board that can provide PWM signal. We will use
PWM for simulating analog output which will provide different
voltage levels to the LEDs so we can get the desired colors.
Connect It Up
17
RGB LED
18
RGB LED
19
int redPin= 11;
int greenPin = 10;
int bluePin = 9;
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
setColor(255, 0, 0); // Red Color
delay(1000);
setColor(0, 255, 0); // Green Color
delay(1000);
Enter The Code
Con…
20
setColor(0, 0, 255); // Blue Color
delay(1000);
setColor(255, 255, 255); // White Color
delay(1000);
setColor(170, 0, 255); // Purple Color
delay(1000);
}
void setColor(int redValue, int greenValue, int blueValue) {
analogWrite(redPin, redValue);
analogWrite(greenPin, greenValue);
analogWrite(bluePin, blueValue);
}
One Digit
Seven Segment Display
21
7 - Segment Display
• How many TV shows and movies
have you seen with some mysterious
electronic device counting down to
zero on one of those 7 segment LED
displays.
• The seven segment display is a pretty
simple device. It is actually 8 LEDs
.Seven LEDs are the main, the 8st is
the dot. So we have 7 input pins for
the main LEDs, one input pin for the
dot and the other two are for
common anode or cathode.
22
7 - Segment Display
23
There are two types of displays – with common anode or common
Cathode.
7 - Segment Display
24
A to Pin 2
B to Pin 3
C to Pin 4
D to Pin 5
E to Pin 6
F to Pin 7
G to Pin 8
Dot to Pin 9
In this example ,we will use an 7-segment display with common
cathode. Use your solder less breadboard to make the
connections between the seven segment LED and your Arduino
board:
Connect It Up
25
7 - Segment Display
void setup()
{
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
digitalWrite(9, 0); // start with the "dot" off
}
26
7 - Segment Display
void loop()
{
// Display the number '9'
digitalWrite(2, 1);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 0);
digitalWrite(6, 0);
digitalWrite(7, 1);
digitalWrite(8, 1);
delay(1000);
}
27
28
Try towriteanArduinosoftware
codethatcountsdownfrom(9to0)
usingsingle7SegmentDisplay?
Thank You 
29

More Related Content

What's hot

Arduino Nodebots (Hackster CascadiaJS Workshop)
Arduino Nodebots (Hackster CascadiaJS Workshop)Arduino Nodebots (Hackster CascadiaJS Workshop)
Arduino Nodebots (Hackster CascadiaJS Workshop)
Monica Houston
 
Logic gates verification
Logic gates verificationLogic gates verification
Logic gates verification
Motilal nehru national institute
 
Assignment#3a
Assignment#3aAssignment#3a
Assignment#3a
Sunita Milind Dol
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacing
COMSATS Abbottabad
 
ANALYSIS & DESIGN OF COMBINATIONAL LOGIC
ANALYSIS & DESIGN OF COMBINATIONAL LOGICANALYSIS & DESIGN OF COMBINATIONAL LOGIC
ANALYSIS & DESIGN OF COMBINATIONAL LOGIC
Supanna Shirguppe
 
Assignment#4b
Assignment#4bAssignment#4b
Assignment#4b
Sunita Milind Dol
 
Assignment#6
Assignment#6Assignment#6
Assignment#6
Sunita Milind Dol
 
Assignment#4a
Assignment#4aAssignment#4a
Assignment#4a
Sunita Milind Dol
 
Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013
Tom Paulus
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
Bharti Airtel Ltd.
 
Assignment#1a
Assignment#1aAssignment#1a
Assignment#1a
Sunita Milind Dol
 
Digital logic
Digital logicDigital logic
Digital logic
Madhu Bala
 
Assignment#3b
Assignment#3bAssignment#3b
Assignment#3b
Sunita Milind Dol
 
Assignment#1b
Assignment#1bAssignment#1b
Assignment#1b
Sunita Milind Dol
 
Assignment#7b
Assignment#7bAssignment#7b
Assignment#7b
Sunita Milind Dol
 
Fastest finger first indicator
Fastest finger first indicatorFastest finger first indicator
Fastest finger first indicator
National University of Mongolia
 
Assignment#2
Assignment#2Assignment#2
Assignment#2
Sunita Milind Dol
 
Assignment#7a
Assignment#7aAssignment#7a
Assignment#7a
Sunita Milind Dol
 
RF Encoder / Decoder Chipset
RF Encoder / Decoder ChipsetRF Encoder / Decoder Chipset
RF Encoder / Decoder Chipset
Premier Farnell
 
Encoder and decoder
Encoder and decoder Encoder and decoder
Encoder and decoder
dinesh aitha
 

What's hot (20)

Arduino Nodebots (Hackster CascadiaJS Workshop)
Arduino Nodebots (Hackster CascadiaJS Workshop)Arduino Nodebots (Hackster CascadiaJS Workshop)
Arduino Nodebots (Hackster CascadiaJS Workshop)
 
Logic gates verification
Logic gates verificationLogic gates verification
Logic gates verification
 
Assignment#3a
Assignment#3aAssignment#3a
Assignment#3a
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacing
 
ANALYSIS & DESIGN OF COMBINATIONAL LOGIC
ANALYSIS & DESIGN OF COMBINATIONAL LOGICANALYSIS & DESIGN OF COMBINATIONAL LOGIC
ANALYSIS & DESIGN OF COMBINATIONAL LOGIC
 
Assignment#4b
Assignment#4bAssignment#4b
Assignment#4b
 
Assignment#6
Assignment#6Assignment#6
Assignment#6
 
Assignment#4a
Assignment#4aAssignment#4a
Assignment#4a
 
Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
 
Assignment#1a
Assignment#1aAssignment#1a
Assignment#1a
 
Digital logic
Digital logicDigital logic
Digital logic
 
Assignment#3b
Assignment#3bAssignment#3b
Assignment#3b
 
Assignment#1b
Assignment#1bAssignment#1b
Assignment#1b
 
Assignment#7b
Assignment#7bAssignment#7b
Assignment#7b
 
Fastest finger first indicator
Fastest finger first indicatorFastest finger first indicator
Fastest finger first indicator
 
Assignment#2
Assignment#2Assignment#2
Assignment#2
 
Assignment#7a
Assignment#7aAssignment#7a
Assignment#7a
 
RF Encoder / Decoder Chipset
RF Encoder / Decoder ChipsetRF Encoder / Decoder Chipset
RF Encoder / Decoder Chipset
 
Encoder and decoder
Encoder and decoder Encoder and decoder
Encoder and decoder
 

Similar to Arduino based applications part 1

Arduino: Analog I/O
Arduino: Analog I/OArduino: Analog I/O
Arduino: Analog I/O
June-Hao Hou
 
Introduction to arduino Programming with
Introduction to arduino Programming withIntroduction to arduino Programming with
Introduction to arduino Programming with
likhithkumpala159
 
Powerful Electronics with Arduino
Powerful Electronics with ArduinoPowerful Electronics with Arduino
Powerful Electronics with Arduino
Abdallah Hodieb
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics lab
Annamaria Lisotti
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Amarjeetsingh Thakur
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Amarjeetsingh Thakur
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote control
VilayatAli5
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
Tony Olsson.
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
Tony Olsson.
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
MdAshrafulAlam47
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RAD
lostcaggy
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
atuline
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Luki B. Subekti
 
Mims effect
Mims effectMims effect
Mims effect
arnaullb
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
Jeni Shah
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
The IOT Academy
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
Electric&elctronics&engineeering
 
Led fade
Led  fadeLed  fade
Led fade
Makers of India
 
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
 

Similar to Arduino based applications part 1 (20)

Arduino: Analog I/O
Arduino: Analog I/OArduino: Analog I/O
Arduino: Analog I/O
 
Introduction to arduino Programming with
Introduction to arduino Programming withIntroduction to arduino Programming with
Introduction to arduino Programming with
 
Powerful Electronics with Arduino
Powerful Electronics with ArduinoPowerful Electronics with Arduino
Powerful Electronics with Arduino
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics lab
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote control
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RADScottish Ruby Conference 2010 Arduino, Ruby RAD
Scottish Ruby Conference 2010 Arduino, Ruby RAD
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Mims effect
Mims effectMims effect
Mims effect
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
Led fade
Led  fadeLed  fade
Led fade
 
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
 

More from Jawaher Abdulwahab Fadhil

Binary adder
Binary adderBinary adder
Number system
Number systemNumber system
Add instruction-part1
Add instruction-part1Add instruction-part1
Add instruction-part1
Jawaher Abdulwahab Fadhil
 
Dealing with 8086 memory
Dealing with 8086 memoryDealing with 8086 memory
Dealing with 8086 memory
Jawaher Abdulwahab Fadhil
 
MOV instruction part1
MOV  instruction part1MOV  instruction part1
MOV instruction part1
Jawaher Abdulwahab Fadhil
 
Cisco webex installation guide
Cisco webex installation guideCisco webex installation guide
Cisco webex installation guide
Jawaher Abdulwahab Fadhil
 
A survey on the applications of smart home
A survey on the applications of smart homeA survey on the applications of smart home
A survey on the applications of smart home
Jawaher Abdulwahab Fadhil
 
Flag register and add instruction
Flag register and  add instructionFlag register and  add instruction
Flag register and add instruction
Jawaher Abdulwahab Fadhil
 
Computer Organization -part 1
Computer Organization -part 1Computer Organization -part 1
Computer Organization -part 1
Jawaher Abdulwahab Fadhil
 
iOS Operating System
iOS Operating SystemiOS Operating System
iOS Operating System
Jawaher Abdulwahab Fadhil
 
Android Operating system
Android Operating systemAndroid Operating system
Android Operating system
Jawaher Abdulwahab Fadhil
 
Types of Mobile Applications
Types of Mobile ApplicationsTypes of Mobile Applications
Types of Mobile Applications
Jawaher Abdulwahab Fadhil
 
Ultrasonic with buzzer
Ultrasonic with buzzerUltrasonic with buzzer
Ultrasonic with buzzer
Jawaher Abdulwahab Fadhil
 
Lecture6 modulation
Lecture6 modulationLecture6 modulation
Lecture6 modulation
Jawaher Abdulwahab Fadhil
 
Lecture 5: The Convolution Sum
Lecture 5: The Convolution SumLecture 5: The Convolution Sum
Lecture 5: The Convolution Sum
Jawaher Abdulwahab Fadhil
 
Lecture 4: Classification of system
Lecture 4: Classification of system Lecture 4: Classification of system
Lecture 4: Classification of system
Jawaher Abdulwahab Fadhil
 
Lecture3: Operations of Ct signals
Lecture3: Operations of Ct signalsLecture3: Operations of Ct signals
Lecture3: Operations of Ct signals
Jawaher Abdulwahab Fadhil
 
Lecture2 : Common continuous time signals
Lecture2 : Common continuous time signalsLecture2 : Common continuous time signals
Lecture2 : Common continuous time signals
Jawaher Abdulwahab Fadhil
 
Lecture1: Introduction to signals
Lecture1: Introduction to signalsLecture1: Introduction to signals
Lecture1: Introduction to signals
Jawaher Abdulwahab Fadhil
 
Arduino- Serial communication
Arduino-  Serial communicationArduino-  Serial communication
Arduino- Serial communication
Jawaher Abdulwahab Fadhil
 

More from Jawaher Abdulwahab Fadhil (20)

Binary adder
Binary adderBinary adder
Binary adder
 
Number system
Number systemNumber system
Number system
 
Add instruction-part1
Add instruction-part1Add instruction-part1
Add instruction-part1
 
Dealing with 8086 memory
Dealing with 8086 memoryDealing with 8086 memory
Dealing with 8086 memory
 
MOV instruction part1
MOV  instruction part1MOV  instruction part1
MOV instruction part1
 
Cisco webex installation guide
Cisco webex installation guideCisco webex installation guide
Cisco webex installation guide
 
A survey on the applications of smart home
A survey on the applications of smart homeA survey on the applications of smart home
A survey on the applications of smart home
 
Flag register and add instruction
Flag register and  add instructionFlag register and  add instruction
Flag register and add instruction
 
Computer Organization -part 1
Computer Organization -part 1Computer Organization -part 1
Computer Organization -part 1
 
iOS Operating System
iOS Operating SystemiOS Operating System
iOS Operating System
 
Android Operating system
Android Operating systemAndroid Operating system
Android Operating system
 
Types of Mobile Applications
Types of Mobile ApplicationsTypes of Mobile Applications
Types of Mobile Applications
 
Ultrasonic with buzzer
Ultrasonic with buzzerUltrasonic with buzzer
Ultrasonic with buzzer
 
Lecture6 modulation
Lecture6 modulationLecture6 modulation
Lecture6 modulation
 
Lecture 5: The Convolution Sum
Lecture 5: The Convolution SumLecture 5: The Convolution Sum
Lecture 5: The Convolution Sum
 
Lecture 4: Classification of system
Lecture 4: Classification of system Lecture 4: Classification of system
Lecture 4: Classification of system
 
Lecture3: Operations of Ct signals
Lecture3: Operations of Ct signalsLecture3: Operations of Ct signals
Lecture3: Operations of Ct signals
 
Lecture2 : Common continuous time signals
Lecture2 : Common continuous time signalsLecture2 : Common continuous time signals
Lecture2 : Common continuous time signals
 
Lecture1: Introduction to signals
Lecture1: Introduction to signalsLecture1: Introduction to signals
Lecture1: Introduction to signals
 
Arduino- Serial communication
Arduino-  Serial communicationArduino-  Serial communication
Arduino- Serial communication
 

Recently uploaded

Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Leena Ghag-Sakpal
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 

Recently uploaded (20)

Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 

Arduino based applications part 1

  • 1. 1 Arduino Based Applications By Jawaher A.Fadhil B.SC in Electronics Engineering M.Tech in Computer Engineering University of Duhok College of Science CS Department
  • 3. Blinking led Open: File -> Examples -> Digital -> Blink void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); } void loop() { // turn the LED on by making the voltage HIGH digitalWrite(13, HIGH); // wait for a second delay(1000); // turn the LED off by making the voltage LOW digitalWrite(13, LOW); delay(1000); } 3
  • 5. Blinking LED Parts Required Breadboard 5mm LED 100 ohm Resistor Jumper Wires 5
  • 7. Enter the code void setup() { // initialize digital pin 10 as an output. pinMode(10, OUTPUT); } void loop() { // turn the LED on by making the voltage HIGH digitalWrite(10, HIGH); // wait for a second delay(1000); // turn the LED off by making the voltage LOW digitalWrite(10, LOW); delay(1000); } 7
  • 8. LED with Pulse Width Modulation(PWM) 8
  • 9. PWM Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of "on time" is called the pulse width. To get varying analog values, you change, or modulate, that pulse width. If you repeat this on-off pattern fast enough with an LED for example, the result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED. 9
  • 10. 10
  • 11. PWM In the previous graphic, the green lines represent a regular time period. This duration or period is the inverse of the PWM frequency. In other words, with Arduino's PWM frequency at about 500Hz, the green lines would measure 2 milliseconds each. A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a 100% duty cycle (always on), and analogWrite(127) is a 50% duty cycle (on half the time) for example. 11
  • 12. PWM To build such application, you need the following components:  Arduino Uno  USB cable  LED  Resistor 1k  Jumper wires 12
  • 13. PWM 13 int pin=10; void setup() { pinMode(pin, OUTPUT); } void loop() { for(int i=0;i<=255;i++) { analogWrite(pin, i); delay(20); } for(int i=255;i>=0;i--) { analogWrite(pin, i); delay(20); } }
  • 15. What is RGB LED? The RGB LED can emit different colors by mixing the 3 basic colors red, green and blue. So it actually consists of 3 separate LEDs red, green and blue packed in a single case. That’s why it has 4 leads, one lead for each of the 3 colors and one common cathode or anode depending of the RGB LED type. 15
  • 16. RGB LED Components needed • RGB LED • 3x 220 Ohms Resistors • Arduino Board • Breadboard and Jump Wires 16 The cathode will be connected to the ground and the 3 anodes will be connected through 220 Ohms resistors to 3 digital pins on the Arduino Board that can provide PWM signal. We will use PWM for simulating analog output which will provide different voltage levels to the LEDs so we can get the desired colors.
  • 19. RGB LED 19 int redPin= 11; int greenPin = 10; int bluePin = 9; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { setColor(255, 0, 0); // Red Color delay(1000); setColor(0, 255, 0); // Green Color delay(1000); Enter The Code
  • 20. Con… 20 setColor(0, 0, 255); // Blue Color delay(1000); setColor(255, 255, 255); // White Color delay(1000); setColor(170, 0, 255); // Purple Color delay(1000); } void setColor(int redValue, int greenValue, int blueValue) { analogWrite(redPin, redValue); analogWrite(greenPin, greenValue); analogWrite(bluePin, blueValue); }
  • 22. 7 - Segment Display • How many TV shows and movies have you seen with some mysterious electronic device counting down to zero on one of those 7 segment LED displays. • The seven segment display is a pretty simple device. It is actually 8 LEDs .Seven LEDs are the main, the 8st is the dot. So we have 7 input pins for the main LEDs, one input pin for the dot and the other two are for common anode or cathode. 22
  • 23. 7 - Segment Display 23 There are two types of displays – with common anode or common Cathode.
  • 24. 7 - Segment Display 24 A to Pin 2 B to Pin 3 C to Pin 4 D to Pin 5 E to Pin 6 F to Pin 7 G to Pin 8 Dot to Pin 9 In this example ,we will use an 7-segment display with common cathode. Use your solder less breadboard to make the connections between the seven segment LED and your Arduino board:
  • 26. 7 - Segment Display void setup() { pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); digitalWrite(9, 0); // start with the "dot" off } 26
  • 27. 7 - Segment Display void loop() { // Display the number '9' digitalWrite(2, 1); digitalWrite(3, 1); digitalWrite(4, 1); digitalWrite(5, 0); digitalWrite(6, 0); digitalWrite(7, 1); digitalWrite(8, 1); delay(1000); } 27