SlideShare a Scribd company logo
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 arduino
Sagar 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 file
imkanhaiyalal
 
Presentation S4A
Presentation S4A Presentation S4A
Presentation S4A
Pedro González Romero
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
Mujahid Hussain
 
Apostila arduino
Apostila arduinoApostila arduino
Apostila arduino
Felipe Belarmino
 
Electronics Multisensor Shield
Electronics Multisensor ShieldElectronics Multisensor Shield
Electronics Multisensor Shield
Leopoldo 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 R3
Meifani 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 R3
Meifani Sumadijaya
 
1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx
Mohamed Essam
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote control
VilayatAli5
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
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
Arisa 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 SIM800L
farid_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 boards
elprocus
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbook
Felipe Belarmino
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
Yogendra Tamang
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1
Felipe Belarmino
 
Pic40 dev board updated
Pic40 dev board updatedPic40 dev board updated
Pic40 dev board updated
Total Project Solutions
 

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 & Checking
IRJET Journal
 
Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino Microcontroller
Shyam 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 Board
Redwan Ferdous
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Luki B. Subekti
 
How to use an Arduino
How to use an ArduinoHow to use an Arduino
How to use an Arduino
AntonAndreev13
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
Rahat Sood
 
Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
Md. Asaduzzaman Jabin
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
Niket Chandrawanshi
 
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
Redwan 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
 
project 3 full report
project 3 full reportproject 3 full report
project 3 full report
Shubham Shivhare
 
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 mcu
6305HASANBASARI
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using Arduino
BalajiK109
 
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
KUNJBIHARISINGH5
 
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
IRJET Journal
 
Intel galileo gen 2
Intel galileo gen 2Intel galileo gen 2
Intel galileo gen 2
srknec
 
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
WiseNaeem
 
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
IRJET 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 processing
elwalia
 
Propaganda
PropagandaPropaganda
Propaganda
elwalia
 
Free Will
Free WillFree Will
Free Will
elwalia
 
Egypt
EgyptEgypt
Egypt
elwalia
 
Sleep and Happiness
Sleep and HappinessSleep and Happiness
Sleep and Happiness
elwalia
 
A step towards a better sleep
A step towards a better sleepA step towards a better sleep
A step towards a better sleep
elwalia
 
Rhinometry presentation
Rhinometry presentationRhinometry presentation
Rhinometry presentation
elwalia
 
Ethics
EthicsEthics
Ethics
elwalia
 
Tongue Anatomy
Tongue AnatomyTongue Anatomy
Tongue Anatomy
elwalia
 

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

basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 

Recently uploaded (20)

basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 

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