SlideShare uma empresa Scribd logo
1 de 32
INTRODUCTION TO
ARDUINO
• Introduction:
1. What is Microcontroller?
2. What is Arduino?
3. Types of Arduino
4. Arduino Uno Board
5. Arduino Shields
6. What is Arduino used for?
7. What can Arduino do?
8. Why Arduino?
9. Input/output
10. Analog/digital
11. Sensor
12. Communication
• Programming structure:
1. Data types
2. Statement and operators.
3. Control statements [if, if…else, switch case]
4. Loop statement [while, for, do …while]
5. What is function?
6. What is Arduino Libraries
 Basic Process
 Arduino IDE
 Arduino Language Reference
 Technical Section [Handling Event Using the in-build millis() function]
 Questions???
Agenda
INTRODUCTION
www.starhub.com.ng
What is Microcontroller?
A small computer on a
single chip containing a
Central Processor Unit
(CPU), flash memory,
RAM and input/output
interface.
Used for control
purposes, and for data
analysis
Microchip
Atmel Intel
www.mikroe.com/chapters/view/1
What is Arduino?
 An open-source electronics platform based on easy-to-use
hardware (electronic board) and software (IDE). www.arduino.cc
A electronic board, with on-board regulated power supply, USB
port to communicate with PC, and an Atmel microcontroller chip.
Anyone can get the details of its design and modify it or make his
own.
Types of Arduino
Arduino Uno : 16MHz
Arduino Mega2560 : 16MHz Arduino Ethernet : 16MHz
Arduino Nano : 16MHz
LilyPad Arduino : 8MHz
Arduino Pro Mini
: 8 (3.3 V)/16
(5 V) MHz
Arduino MKR1000 : 48MHz Arduino 101 : 32MHz Arduino Zero : 48MHz
Arduino Due : 84MHz Arduino Yún : 16MHz and 400MHz
Types of Arduino
Arduino Leonardo : 16MHz
Arduino Pro : 16MHz
Arduino Fio : 8MHz
Arduino Mega ADK : 16MHz
Arduino Esplora : 16MHz Arduino Micro : 16MHz
Types of Arduino
Arduino Uno Board
Arduino Shields
Boards plugged on top of the Arduino PCB to extend its capacities.
What is Arduino used for?
Physical Computing projects / research
 Interactive Design
Rapid prototyping
What can Arduino do?
Sensors ( sense things)
 Push buttons, touch pads, tilt switches.
 Variable resistors (volume knob / sliders)
 Photo-resistors (light intensity)
 Thermistors (temperature)
 Ultrasound (proximity range finder)
Actuators ( do things)
• Lights, LED’s
• Motors
• Speakers
• Displays (LCD)
Why Arduino?
 It is Open Source, both in terms of Hardware and Software.
 It can communicate with a computer via serial connection over
USB.
 It can be powered from USB or standalone DC power.
 It can run standalone from a computer (chip is programmable)
and it has memory (a small amount).
 It can work with both Digital and Analog electronic signals.
Sensors and Actuators.
 You can build robots, drone, home automation, IoT application,
farm management system with Arduino.
Input/output
Examples: Buttons Switches, Light
Sensors, Flex Sensors, Humidity
Sensors, Temperature Sensors,
Photo-transistor, etc.
Examples: LEDs, DC motor, Servo
motor, Relay, Stepper motor, Piezo,
Buzzer, RGB LED, etc.
Input is a signal / information
going into the board.
Output is any signal exiting the
board.
Analog/digital
Digital signal are anything that can take specific levels of values with specific
offset between each other.
Ex: Square waves
Analog signal are anything that take value between its minimum value and
maximum value.
Ex: Temperature, Sine waves, etc.
Sensors
Devices that transforms the physical quantity in electrical value.
The physical quantity could be
Light
Heat
Motion
Moisture
Pressure
Temperature
Blood pressure
Humidity
Speed
And others environmental phenomena
Communication
Universal Asynchronous Receiver/Transmitter (UART): is a form of serial
communication because data is transmitted as sequential bits
Serial Peripheral Interface (SPI): is a master-slave model, where there is one
master device and multiple slave devices.
Inter-integrated circuit (I2C): it connect multiple masters to multiple slaves.
Hardware connection for
UART SPI multiple-slaves
connected to a single master
I2C hardware connection
ARDUINO
PROGRAMMING
STRUCTURE
www.starhub.com.ng
Data Types
Example:
Int i = 140; char c = ‘A’; long u = 234455; float f = 1.56;
unsigned int num = 454;
Statement and Operators
Statement represents a command, it ends with ‘;’
Example: int i;
i=49;
Operators are symbols that used to indicate a specific
function:
• Math operators: [+,-,*,/,%,^]
• Logic operators: [==, !=, &&, ||]
• Comparison operators: [==, >, <, !=, <=, >=]
Syntax:
• ‘;’ Semicolon (end statement)
• ‘{ }’ curly braces (block of statement)
• ‘//’ single line comment,
• /*Multi-line comments*/
Statement and Operators
Compound Operators:
• ++ (increment)
• -- (decrement)
• += (compound addition)
• -= (compound subtraction)
• *= (compound multiplication)
• /= (compound division)
Control Statements
If statement:
if(condition)
{
statements;
}
else if(condition2)
{
Statements;
}
Else{
statements;
}
Control Statements
Switch statement:
switch (x) {
case 1:
//do something when x equals 1
break;
case 2:
//do something when x equals 2
break;
default:
// if nothing else matches, do the default
// default is optional
}
Loop Statement
Do… while:
do
{
Statements;
}while(condition); // the statements are run at least once.
While:
While(condition)
{
statements;
}
for
for (int i=0; i <= var; i++){
statements;
}
What is functions?
A body of code designed to solve a particular
task.
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
What is Arduino Library?
Arduino environment can be extended through the use
of libraries.
Libraries provide extra functionality for use in sketches.
 Working with hardware
 Manipulating data.
A number of libraries come installed with the IDE.
 Download
 Create your own.
Basic Process
 Design the circuit:
o What are electrical requirements of the sensors or actuators?
o Identify inputs (analog inputs)
o Identify digital outputs
 Write the code
o Build incrementally
• Get the simplest piece to work first
• Add complexity and test at each stage
• Save and Backup frequently
o Use variables, not constants
o Comment explicitly
Arduino IDE
Download the Arduino IDE
(The program used to write code and
uploading it to arduino boards) from:
http://arduino.cc/en/Main/Software
Arduino Language Reference
http://arduino.cc/en/Reference/HomePage
Technical Session
Handling Multiple Event Using the Arduino in-build millis()
function:
Make a 4 LEDs to blink at different rate of 1 sec, 0.5 sec, 0.25 sec and 0.1sec in an
infinite loop.
Download the demo code from
https://github.com/emotexplanet/Arduino_Multiple_Event_with_millis_function
Questions???
?
Thank
You

Mais conteúdo relacionado

Mais procurados

Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino MicrocontrollerShyam Mohan
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYVishnu
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduinoavikdhupar
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusainstudent
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoEoin Brazil
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoRichard Rixham
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino ProgrammingJames Lewis
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduinoSantosh Verma
 
Arduino slides
Arduino slidesArduino slides
Arduino slidessdcharle
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt maineddy royappa
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoYong Heui Cho
 

Mais procurados (20)

Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino Microcontroller
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Arduino
ArduinoArduino
Arduino
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
PPT ON Arduino
PPT ON Arduino PPT ON Arduino
PPT ON Arduino
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
Arduino
ArduinoArduino
Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
 
Arduino presentation
Arduino presentationArduino presentation
Arduino presentation
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to Arduino Programming
Introduction to Arduino ProgrammingIntroduction to Arduino Programming
Introduction to Arduino Programming
 
Embedded system design using arduino
Embedded system design using arduinoEmbedded system design using arduino
Embedded system design using arduino
 
Tinker cad intro
Tinker cad introTinker cad intro
Tinker cad intro
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
 
Different Arduino Boards
Different Arduino BoardsDifferent Arduino Boards
Different Arduino Boards
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 

Semelhante a Introduction to Arduino Hardware and Programming

Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixelssdcharle
 
The IoT Academy IoT training Arduino Part 1 basics
The IoT Academy IoT training Arduino Part 1 basicsThe IoT Academy IoT training Arduino Part 1 basics
The IoT Academy IoT training Arduino Part 1 basicsThe IOT Academy
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'tsyogesh46
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfssusere5db05
 
arduino introduction for vocational students
arduino introduction for vocational studentsarduino introduction for vocational students
arduino introduction for vocational studentsanggalima5
 
introduction of arduino and node mcu
introduction of arduino and node mcuintroduction of arduino and node mcu
introduction of arduino and node mcu6305HASANBASARI
 
1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptxMohamed Essam
 
Oop 2014 embedded systems with open source hardware v2
Oop 2014 embedded systems with open source hardware v2Oop 2014 embedded systems with open source hardware v2
Oop 2014 embedded systems with open source hardware v2Michael Stal
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorssaritasapkal
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slidesmkarlin14
 

Semelhante a Introduction to Arduino Hardware and Programming (20)

Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
The IoT Academy IoT training Arduino Part 1 basics
The IoT Academy IoT training Arduino Part 1 basicsThe IoT Academy IoT training Arduino Part 1 basics
The IoT Academy IoT training Arduino Part 1 basics
 
ARDUINO Presentation1.pptx
ARDUINO Presentation1.pptxARDUINO Presentation1.pptx
ARDUINO Presentation1.pptx
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
 
arduino introduction for vocational students
arduino introduction for vocational studentsarduino introduction for vocational students
arduino introduction for vocational students
 
Arduino course
Arduino courseArduino course
Arduino course
 
B1_25Jan21.pptx
B1_25Jan21.pptxB1_25Jan21.pptx
B1_25Jan21.pptx
 
introduction of arduino and node mcu
introduction of arduino and node mcuintroduction of arduino and node mcu
introduction of arduino and node mcu
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
 
1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx
 
What is arduino
What is arduinoWhat is arduino
What is arduino
 
Indroduction arduino
Indroduction arduinoIndroduction arduino
Indroduction arduino
 
Indroduction the arduino
Indroduction the arduinoIndroduction the arduino
Indroduction the arduino
 
Oop 2014 embedded systems with open source hardware v2
Oop 2014 embedded systems with open source hardware v2Oop 2014 embedded systems with open source hardware v2
Oop 2014 embedded systems with open source hardware v2
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensors
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 

Último

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Introduction to Arduino Hardware and Programming

  • 2. • Introduction: 1. What is Microcontroller? 2. What is Arduino? 3. Types of Arduino 4. Arduino Uno Board 5. Arduino Shields 6. What is Arduino used for? 7. What can Arduino do? 8. Why Arduino? 9. Input/output 10. Analog/digital 11. Sensor 12. Communication • Programming structure: 1. Data types 2. Statement and operators. 3. Control statements [if, if…else, switch case] 4. Loop statement [while, for, do …while] 5. What is function? 6. What is Arduino Libraries  Basic Process  Arduino IDE  Arduino Language Reference  Technical Section [Handling Event Using the in-build millis() function]  Questions??? Agenda
  • 4. What is Microcontroller? A small computer on a single chip containing a Central Processor Unit (CPU), flash memory, RAM and input/output interface. Used for control purposes, and for data analysis Microchip Atmel Intel www.mikroe.com/chapters/view/1
  • 5. What is Arduino?  An open-source electronics platform based on easy-to-use hardware (electronic board) and software (IDE). www.arduino.cc A electronic board, with on-board regulated power supply, USB port to communicate with PC, and an Atmel microcontroller chip. Anyone can get the details of its design and modify it or make his own.
  • 6. Types of Arduino Arduino Uno : 16MHz Arduino Mega2560 : 16MHz Arduino Ethernet : 16MHz Arduino Nano : 16MHz LilyPad Arduino : 8MHz Arduino Pro Mini : 8 (3.3 V)/16 (5 V) MHz
  • 7. Arduino MKR1000 : 48MHz Arduino 101 : 32MHz Arduino Zero : 48MHz Arduino Due : 84MHz Arduino Yún : 16MHz and 400MHz Types of Arduino Arduino Leonardo : 16MHz
  • 8. Arduino Pro : 16MHz Arduino Fio : 8MHz Arduino Mega ADK : 16MHz Arduino Esplora : 16MHz Arduino Micro : 16MHz Types of Arduino
  • 10. Arduino Shields Boards plugged on top of the Arduino PCB to extend its capacities.
  • 11. What is Arduino used for? Physical Computing projects / research  Interactive Design Rapid prototyping
  • 12. What can Arduino do? Sensors ( sense things)  Push buttons, touch pads, tilt switches.  Variable resistors (volume knob / sliders)  Photo-resistors (light intensity)  Thermistors (temperature)  Ultrasound (proximity range finder) Actuators ( do things) • Lights, LED’s • Motors • Speakers • Displays (LCD)
  • 13. Why Arduino?  It is Open Source, both in terms of Hardware and Software.  It can communicate with a computer via serial connection over USB.  It can be powered from USB or standalone DC power.  It can run standalone from a computer (chip is programmable) and it has memory (a small amount).  It can work with both Digital and Analog electronic signals. Sensors and Actuators.  You can build robots, drone, home automation, IoT application, farm management system with Arduino.
  • 14. Input/output Examples: Buttons Switches, Light Sensors, Flex Sensors, Humidity Sensors, Temperature Sensors, Photo-transistor, etc. Examples: LEDs, DC motor, Servo motor, Relay, Stepper motor, Piezo, Buzzer, RGB LED, etc. Input is a signal / information going into the board. Output is any signal exiting the board.
  • 15. Analog/digital Digital signal are anything that can take specific levels of values with specific offset between each other. Ex: Square waves Analog signal are anything that take value between its minimum value and maximum value. Ex: Temperature, Sine waves, etc.
  • 16. Sensors Devices that transforms the physical quantity in electrical value. The physical quantity could be Light Heat Motion Moisture Pressure Temperature Blood pressure Humidity Speed And others environmental phenomena
  • 17. Communication Universal Asynchronous Receiver/Transmitter (UART): is a form of serial communication because data is transmitted as sequential bits Serial Peripheral Interface (SPI): is a master-slave model, where there is one master device and multiple slave devices. Inter-integrated circuit (I2C): it connect multiple masters to multiple slaves. Hardware connection for UART SPI multiple-slaves connected to a single master I2C hardware connection
  • 19. Data Types Example: Int i = 140; char c = ‘A’; long u = 234455; float f = 1.56; unsigned int num = 454;
  • 20. Statement and Operators Statement represents a command, it ends with ‘;’ Example: int i; i=49; Operators are symbols that used to indicate a specific function: • Math operators: [+,-,*,/,%,^] • Logic operators: [==, !=, &&, ||] • Comparison operators: [==, >, <, !=, <=, >=] Syntax: • ‘;’ Semicolon (end statement) • ‘{ }’ curly braces (block of statement) • ‘//’ single line comment, • /*Multi-line comments*/
  • 21. Statement and Operators Compound Operators: • ++ (increment) • -- (decrement) • += (compound addition) • -= (compound subtraction) • *= (compound multiplication) • /= (compound division)
  • 22. Control Statements If statement: if(condition) { statements; } else if(condition2) { Statements; } Else{ statements; }
  • 23. Control Statements Switch statement: switch (x) { case 1: //do something when x equals 1 break; case 2: //do something when x equals 2 break; default: // if nothing else matches, do the default // default is optional }
  • 24. Loop Statement Do… while: do { Statements; }while(condition); // the statements are run at least once. While: While(condition) { statements; } for for (int i=0; i <= var; i++){ statements; }
  • 25. What is functions? A body of code designed to solve a particular task. void setup() { // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: }
  • 26. What is Arduino Library? Arduino environment can be extended through the use of libraries. Libraries provide extra functionality for use in sketches.  Working with hardware  Manipulating data. A number of libraries come installed with the IDE.  Download  Create your own.
  • 27. Basic Process  Design the circuit: o What are electrical requirements of the sensors or actuators? o Identify inputs (analog inputs) o Identify digital outputs  Write the code o Build incrementally • Get the simplest piece to work first • Add complexity and test at each stage • Save and Backup frequently o Use variables, not constants o Comment explicitly
  • 28. Arduino IDE Download the Arduino IDE (The program used to write code and uploading it to arduino boards) from: http://arduino.cc/en/Main/Software
  • 30. Technical Session Handling Multiple Event Using the Arduino in-build millis() function: Make a 4 LEDs to blink at different rate of 1 sec, 0.5 sec, 0.25 sec and 0.1sec in an infinite loop. Download the demo code from https://github.com/emotexplanet/Arduino_Multiple_Event_with_millis_function