SlideShare a Scribd company logo
1 of 20
Ahmed Elwali
BME 7022 & ECE 4610
Arduino + 1st Lab
ECE 4610 LAB
6/22/2018 2
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Objectives
Introducing Arduino
Arduino UNO (Hardware & specs)
Arduino IDE
Variable & function declaration
Data types
Statement & operators
Control statements
Inputs and outputs
Oscilloscope software
6/22/2018 3
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Micro-Controller
A programmable device (chip)
Like a mini-computer as it has internal CPU,
RAM, ROM, and IOs interface.
Used for control purposes, and data analysis.
Famous microcontroller manufacturers are
MicroChip, Atmel, Intel, Motorola, and more.
6/22/2018 4
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Arduino
It is a Microcontroller board, contains microcontroller chip (Atmel), USB port to communicate
with PC, oscillator, regulator, wireless module, etc.
It makes our life easier with removing many sophisticated issues regarding PCB design and
implementation.
You can use it during development and testing but not for production.
It has a lot of predeveloped modules/sensors with their codes (life is much easier!)
It has a lot of versions, Uno, YUN, Mega, etc.
6/22/2018 5
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Arduino Uno (Hardware and Specs)
 Microcontroller: ATmega 328
 Operating Voltage 5V
 Input Voltage (recommended) 7-12V
 Input Voltage (limits) 6-20V
 Digital I/O Pins 14 (of which 6 provide PWM output)
 Analog Input Pins 6
 DC Current per I/O Pin 40 mA
 DC Current for 3.3V Pin 50 mA
 Clock Speed 16 MHz
 Reset pin 0 input
 Analog sampling rate 10000 s/sec
6/22/2018 6
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Getting Started
Check out: http://arduino.cc/en/Guide/HomePage
1. Download & install the Arduino environment (IDE) (not needed in lab)
2. Connect the board to your computer via the USB cable
3. If needed, install the drivers (not needed in lab)
4. Launch the Arduino IDE
5. Select your board
6. Select your serial port
7. Open the blink example
8. Upload the program
9. Observe the results
6/22/2018 7
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Arduino IDE
Button Bar
Input/Edit area
Status bar
Program notification area
6/22/2018 8
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Select Serial Port, Board, and Example
6/22/2018 9
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Analyzing the Blinking code
6/22/2018 10
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Declaring variables and functions
6/22/2018 11
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Arduino Coding (Data Types)
•boolean (8 bit) - simple logical true/false
•byte (8 bit) - unsigned number from 0-255
•char (8 bit) - signed number from -128 to 127
•unsigned char (8 bit) - same as ‘byte’
•word (16 bit) - unsigned number from 0-65535
•unsigned int (16 bit)- the same as ‘word’.
•int (16 bit) - signed number from -32768 to 32767.
•unsigned long (32 bit) - unsigned number from 0-4,294,967,295.
•long (32 bit) - signed number from -2,147,483,648 to 2,147,483,647
•float (32 bit) - signed number from -3.4028235E38 to 3.4028235E38.
6/22/2018 12
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Statement and Operators
To get most of the useful information about Arduino:
◦ Login to www.Arduino.cc then press on the tab bar Learning then Reference
; (semicolon), {} (curly braces), // (single line comment), and
/* */ (multi-line comment)
Arithmetic Operators
= (assignment operator), + (addition), - (subtraction), * (multiplication), / (division), and % (modulo)
Comparison Operators
== (equal to), != (not equal to), < (less than), > (greater than), <= (less than or equal to), and >=
Boolean Operators
&& (and), || (or), and ! (not)
6/22/2018 13
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Control statements
6/22/2018 14
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Input and outputs
pinMode(no. of the digital pin , status); // status (OUTPUT, INPUT) , setup
digitalWrite(no. of the digital pin , value); // value (HIGH, LOW)
digitalRead(no. of the digital pin);
analogRead(no. of the analog pin); // 10 bits ADC, with max sampling rate 10000 sample/sec. Read
Positive part only.
analogWrite(no. of the PWM pin , value); // (frequency ~= 500 Hz) and values from 0-255
// delay(value); // milliseconds. // delayMicroseconds(value);
// Activate the serial port:
Serial.begin(baud-Rate); // baud-Rate (bit per seconds), setup
Serial.println(value)
Serial.write(value) // serial.avilable() // serial.read()
6/22/2018 15
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Supplying (driving) outputs or inputs
Maximum current for each pin to sink or drain is 40 mA.
Motor
Pull down Pull up
High current consumption >40 mA
Out
Out
Out
6/22/2018 16
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Push button and bouncing problem
Noise due to mechanical vibrations
IN
6/22/2018 17
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Analog output (PWM)
analogWrite(no. of the PWM pin, value); // (frequency ~= 500 Hz) and values from 0-255
output voltage = (on_time / cycle_time) * 5V
PWMin
6/22/2018 18
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Reading an analog signal
Arduino can’t read negative signal so we need to shift the signal with a positive offset using
voltage divider.
Using the function generator produce a sinus signal with 4 VPP. Use a voltage divider to shift the
signal (Check with the oscilloscope).
Vref
2.5
Vin
6/22/2018 19
Ahmed Elwali
BME 7022 & ECE 4610
Ahmed Elwali
BME 7022 & ECE 4610
Reading an analog signal (oscilloscope
software)
analogRead(no. of the analog pin); // 10 bits ADC, with max sampling rate 10000 sample/sec.
For the oscilloscope software: Check serial port, baud rate, Terminal, and signals.
For more than one signal
Ahmed Elwali
BME 7022 & ECE 4610

More Related Content

What's hot

How to measure frequency and duty cycle using arduino
How to measure frequency and duty cycle using  arduinoHow to measure frequency and duty cycle using  arduino
How to measure frequency and duty cycle using arduinoSagar Srivastav
 
Touch Switch (Smart Switches) by arduino Project report file
Touch Switch (Smart Switches) by arduino  Project  report fileTouch Switch (Smart Switches) by arduino  Project  report file
Touch Switch (Smart Switches) by arduino Project report fileimkanhaiyalal
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerMujahid Hussain
 
Electronics Multisensor Shield
Electronics Multisensor ShieldElectronics Multisensor Shield
Electronics Multisensor ShieldLeopoldo Armesto
 
Porte à puce - Automatic Door based on Arduino UNO R3
Porte à puce - Automatic Door based on Arduino UNO R3Porte à puce - Automatic Door based on Arduino UNO R3
Porte à puce - Automatic Door based on Arduino UNO R3Meifani Sumadijaya
 
Porte à puce - Smart Safety Door based on Arduino UNO R3
Porte à puce - Smart Safety Door based on Arduino UNO R3Porte à puce - Smart Safety Door based on Arduino UNO R3
Porte à puce - Smart Safety Door based on Arduino UNO R3Meifani Sumadijaya
 
1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptxMohamed Essam
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote controlVilayatAli5
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 
SMART LAMP WITH A GSM MODULE SIM 800 L
SMART LAMP WITH A GSM MODULE SIM 800 LSMART LAMP WITH A GSM MODULE SIM 800 L
SMART LAMP WITH A GSM MODULE SIM 800 LArisa trirahayu
 
Smart Lamp With a GSM Module SIM800L
Smart Lamp With a GSM Module SIM800LSmart Lamp With a GSM Module SIM800L
Smart Lamp With a GSM Module SIM800Lfarid_giffari
 
What are the different types of arduino boards
What are the different types of arduino boardsWhat are the different types of arduino boards
What are the different types of arduino boardselprocus
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbookFelipe Belarmino
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 PresentationYogendra Tamang
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1Felipe Belarmino
 

What's hot (18)

How to measure frequency and duty cycle using arduino
How to measure frequency and duty cycle using  arduinoHow to measure frequency and duty cycle using  arduino
How to measure frequency and duty cycle using arduino
 
Touch Switch (Smart Switches) by arduino Project report file
Touch Switch (Smart Switches) by arduino  Project  report fileTouch Switch (Smart Switches) by arduino  Project  report file
Touch Switch (Smart Switches) by arduino Project report file
 
Presentation S4A
Presentation S4A Presentation S4A
Presentation S4A
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
Apostila arduino
Apostila arduinoApostila arduino
Apostila arduino
 
Electronics Multisensor Shield
Electronics Multisensor ShieldElectronics Multisensor Shield
Electronics Multisensor Shield
 
Porte à puce - Automatic Door based on Arduino UNO R3
Porte à puce - Automatic Door based on Arduino UNO R3Porte à puce - Automatic Door based on Arduino UNO R3
Porte à puce - Automatic Door based on Arduino UNO R3
 
Porte à puce - Smart Safety Door based on Arduino UNO R3
Porte à puce - Smart Safety Door based on Arduino UNO R3Porte à puce - Smart Safety Door based on Arduino UNO R3
Porte à puce - Smart Safety Door based on Arduino UNO R3
 
1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote control
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
SMART LAMP WITH A GSM MODULE SIM 800 L
SMART LAMP WITH A GSM MODULE SIM 800 LSMART LAMP WITH A GSM MODULE SIM 800 L
SMART LAMP WITH A GSM MODULE SIM 800 L
 
Smart Lamp With a GSM Module SIM800L
Smart Lamp With a GSM Module SIM800LSmart Lamp With a GSM Module SIM800L
Smart Lamp With a GSM Module SIM800L
 
What are the different types of arduino boards
What are the different types of arduino boardsWhat are the different types of arduino boards
What are the different types of arduino boards
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbook
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1
 
Pic40 dev board updated
Pic40 dev board updatedPic40 dev board updated
Pic40 dev board updated
 

Similar to Introduction to Arduino

IRJET - Automatic Mechanism for LED Parameters Testing & Checking
IRJET -  	  Automatic Mechanism for LED Parameters Testing & CheckingIRJET -  	  Automatic Mechanism for LED Parameters Testing & Checking
IRJET - Automatic Mechanism for LED Parameters Testing & CheckingIRJET Journal
 
Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino MicrocontrollerShyam Mohan
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller IJECEIAES
 
Hands On Workshop on IoT: From Arduino to JRC Board
Hands On Workshop on IoT: From Arduino to JRC BoardHands On Workshop on IoT: From Arduino to JRC Board
Hands On Workshop on IoT: From Arduino to JRC BoardRedwan Ferdous
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
Workshop on IoT and Basic Home Automation_BAIUST.pptx
Workshop on IoT and Basic Home Automation_BAIUST.pptxWorkshop on IoT and Basic Home Automation_BAIUST.pptx
Workshop on IoT and Basic Home Automation_BAIUST.pptxRedwan Ferdous
 
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...IRJET Journal
 
Arduino-101-Workshop (Introduction to Arduino and motor driver)
Arduino-101-Workshop (Introduction to Arduino and motor driver)Arduino-101-Workshop (Introduction to Arduino and motor driver)
Arduino-101-Workshop (Introduction to Arduino and motor driver)ShirazimMunir
 
introduction of arduino and node mcu
introduction of arduino and node mcuintroduction of arduino and node mcu
introduction of arduino and node mcu6305HASANBASARI
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using ArduinoBalajiK109
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGVKUNJBIHARISINGH5
 
Automatic Inspection System for Two Wheeler Servicing
Automatic Inspection System for Two Wheeler ServicingAutomatic Inspection System for Two Wheeler Servicing
Automatic Inspection System for Two Wheeler ServicingIRJET Journal
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2srknec
 
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfAdvanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfWiseNaeem
 
Ball following Robot using ESP32-cam & Arduino UNO
Ball following Robot using ESP32-cam & Arduino UNOBall following Robot using ESP32-cam & Arduino UNO
Ball following Robot using ESP32-cam & Arduino UNOIRJET Journal
 

Similar to Introduction to Arduino (20)

IRJET - Automatic Mechanism for LED Parameters Testing & Checking
IRJET -  	  Automatic Mechanism for LED Parameters Testing & CheckingIRJET -  	  Automatic Mechanism for LED Parameters Testing & Checking
IRJET - Automatic Mechanism for LED Parameters Testing & Checking
 
Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino Microcontroller
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller
 
Hands On Workshop on IoT: From Arduino to JRC Board
Hands On Workshop on IoT: From Arduino to JRC BoardHands On Workshop on IoT: From Arduino to JRC Board
Hands On Workshop on IoT: From Arduino to JRC Board
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
How to use an Arduino
How to use an ArduinoHow to use an Arduino
How to use an Arduino
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
Workshop on IoT and Basic Home Automation_BAIUST.pptx
Workshop on IoT and Basic Home Automation_BAIUST.pptxWorkshop on IoT and Basic Home Automation_BAIUST.pptx
Workshop on IoT and Basic Home Automation_BAIUST.pptx
 
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
 
project 3 full report
project 3 full reportproject 3 full report
project 3 full report
 
Arduino-101-Workshop (Introduction to Arduino and motor driver)
Arduino-101-Workshop (Introduction to Arduino and motor driver)Arduino-101-Workshop (Introduction to Arduino and motor driver)
Arduino-101-Workshop (Introduction to Arduino and motor driver)
 
introduction of arduino and node mcu
introduction of arduino and node mcuintroduction of arduino and node mcu
introduction of arduino and node mcu
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using Arduino
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGV
 
Automatic Inspection System for Two Wheeler Servicing
Automatic Inspection System for Two Wheeler ServicingAutomatic Inspection System for Two Wheeler Servicing
Automatic Inspection System for Two Wheeler Servicing
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
 
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfAdvanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
 
Ball following Robot using ESP32-cam & Arduino UNO
Ball following Robot using ESP32-cam & Arduino UNOBall following Robot using ESP32-cam & Arduino UNO
Ball following Robot using ESP32-cam & Arduino UNO
 

More from elwalia

Biomedical Instrumentation and signal processing
Biomedical Instrumentation and signal processingBiomedical Instrumentation and signal processing
Biomedical Instrumentation and signal processingelwalia
 
Propaganda
PropagandaPropaganda
Propagandaelwalia
 
Free Will
Free WillFree Will
Free Willelwalia
 
Sleep and Happiness
Sleep and HappinessSleep and Happiness
Sleep and Happinesselwalia
 
A step towards a better sleep
A step towards a better sleepA step towards a better sleep
A step towards a better sleepelwalia
 
Rhinometry presentation
Rhinometry presentationRhinometry presentation
Rhinometry presentationelwalia
 
Tongue Anatomy
Tongue AnatomyTongue Anatomy
Tongue Anatomyelwalia
 

More from elwalia (9)

Biomedical Instrumentation and signal processing
Biomedical Instrumentation and signal processingBiomedical Instrumentation and signal processing
Biomedical Instrumentation and signal processing
 
Propaganda
PropagandaPropaganda
Propaganda
 
Free Will
Free WillFree Will
Free Will
 
Egypt
EgyptEgypt
Egypt
 
Sleep and Happiness
Sleep and HappinessSleep and Happiness
Sleep and Happiness
 
A step towards a better sleep
A step towards a better sleepA step towards a better sleep
A step towards a better sleep
 
Rhinometry presentation
Rhinometry presentationRhinometry presentation
Rhinometry presentation
 
Ethics
EthicsEthics
Ethics
 
Tongue Anatomy
Tongue AnatomyTongue Anatomy
Tongue Anatomy
 

Recently uploaded

ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 

Recently uploaded (20)

ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 

Introduction to Arduino

  • 1. Ahmed Elwali BME 7022 & ECE 4610 Arduino + 1st Lab ECE 4610 LAB
  • 2. 6/22/2018 2 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Objectives Introducing Arduino Arduino UNO (Hardware & specs) Arduino IDE Variable & function declaration Data types Statement & operators Control statements Inputs and outputs Oscilloscope software
  • 3. 6/22/2018 3 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Micro-Controller A programmable device (chip) Like a mini-computer as it has internal CPU, RAM, ROM, and IOs interface. Used for control purposes, and data analysis. Famous microcontroller manufacturers are MicroChip, Atmel, Intel, Motorola, and more.
  • 4. 6/22/2018 4 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Arduino It is a Microcontroller board, contains microcontroller chip (Atmel), USB port to communicate with PC, oscillator, regulator, wireless module, etc. It makes our life easier with removing many sophisticated issues regarding PCB design and implementation. You can use it during development and testing but not for production. It has a lot of predeveloped modules/sensors with their codes (life is much easier!) It has a lot of versions, Uno, YUN, Mega, etc.
  • 5. 6/22/2018 5 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Arduino Uno (Hardware and Specs)  Microcontroller: ATmega 328  Operating Voltage 5V  Input Voltage (recommended) 7-12V  Input Voltage (limits) 6-20V  Digital I/O Pins 14 (of which 6 provide PWM output)  Analog Input Pins 6  DC Current per I/O Pin 40 mA  DC Current for 3.3V Pin 50 mA  Clock Speed 16 MHz  Reset pin 0 input  Analog sampling rate 10000 s/sec
  • 6. 6/22/2018 6 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Getting Started Check out: http://arduino.cc/en/Guide/HomePage 1. Download & install the Arduino environment (IDE) (not needed in lab) 2. Connect the board to your computer via the USB cable 3. If needed, install the drivers (not needed in lab) 4. Launch the Arduino IDE 5. Select your board 6. Select your serial port 7. Open the blink example 8. Upload the program 9. Observe the results
  • 7. 6/22/2018 7 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Arduino IDE Button Bar Input/Edit area Status bar Program notification area
  • 8. 6/22/2018 8 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Select Serial Port, Board, and Example
  • 9. 6/22/2018 9 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Analyzing the Blinking code
  • 10. 6/22/2018 10 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Declaring variables and functions
  • 11. 6/22/2018 11 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Arduino Coding (Data Types) •boolean (8 bit) - simple logical true/false •byte (8 bit) - unsigned number from 0-255 •char (8 bit) - signed number from -128 to 127 •unsigned char (8 bit) - same as ‘byte’ •word (16 bit) - unsigned number from 0-65535 •unsigned int (16 bit)- the same as ‘word’. •int (16 bit) - signed number from -32768 to 32767. •unsigned long (32 bit) - unsigned number from 0-4,294,967,295. •long (32 bit) - signed number from -2,147,483,648 to 2,147,483,647 •float (32 bit) - signed number from -3.4028235E38 to 3.4028235E38.
  • 12. 6/22/2018 12 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Statement and Operators To get most of the useful information about Arduino: ◦ Login to www.Arduino.cc then press on the tab bar Learning then Reference ; (semicolon), {} (curly braces), // (single line comment), and /* */ (multi-line comment) Arithmetic Operators = (assignment operator), + (addition), - (subtraction), * (multiplication), / (division), and % (modulo) Comparison Operators == (equal to), != (not equal to), < (less than), > (greater than), <= (less than or equal to), and >= Boolean Operators && (and), || (or), and ! (not)
  • 13. 6/22/2018 13 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Control statements
  • 14. 6/22/2018 14 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Input and outputs pinMode(no. of the digital pin , status); // status (OUTPUT, INPUT) , setup digitalWrite(no. of the digital pin , value); // value (HIGH, LOW) digitalRead(no. of the digital pin); analogRead(no. of the analog pin); // 10 bits ADC, with max sampling rate 10000 sample/sec. Read Positive part only. analogWrite(no. of the PWM pin , value); // (frequency ~= 500 Hz) and values from 0-255 // delay(value); // milliseconds. // delayMicroseconds(value); // Activate the serial port: Serial.begin(baud-Rate); // baud-Rate (bit per seconds), setup Serial.println(value) Serial.write(value) // serial.avilable() // serial.read()
  • 15. 6/22/2018 15 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Supplying (driving) outputs or inputs Maximum current for each pin to sink or drain is 40 mA. Motor Pull down Pull up High current consumption >40 mA Out Out Out
  • 16. 6/22/2018 16 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Push button and bouncing problem Noise due to mechanical vibrations IN
  • 17. 6/22/2018 17 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Analog output (PWM) analogWrite(no. of the PWM pin, value); // (frequency ~= 500 Hz) and values from 0-255 output voltage = (on_time / cycle_time) * 5V PWMin
  • 18. 6/22/2018 18 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Reading an analog signal Arduino can’t read negative signal so we need to shift the signal with a positive offset using voltage divider. Using the function generator produce a sinus signal with 4 VPP. Use a voltage divider to shift the signal (Check with the oscilloscope). Vref 2.5 Vin
  • 19. 6/22/2018 19 Ahmed Elwali BME 7022 & ECE 4610 Ahmed Elwali BME 7022 & ECE 4610 Reading an analog signal (oscilloscope software) analogRead(no. of the analog pin); // 10 bits ADC, with max sampling rate 10000 sample/sec. For the oscilloscope software: Check serial port, baud rate, Terminal, and signals. For more than one signal
  • 20. Ahmed Elwali BME 7022 & ECE 4610

Editor's Notes

  1. integrated development environment