SlideShare uma empresa Scribd logo
1 de 52
Baixar para ler offline
‫إعداد‬:‫شماسنة‬ ‫مجدي‬‫لعام‬ ‫والبرمجة‬ ‫األردوينو‬ ‫لدورة‬ ‫خصيصا‬ ‫األوراق‬ ‫هذه‬ ‫عدت‬ُ‫أ‬2017‫لنادي‬Imech E‫بيرزيت‬ ‫جامعة‬ ‫فرع‬
The contents of this Course :
This course is a workshop ( no much of Theories ) , so will involve in :
1. Identify the ARDUINO board parts and their works / power suppling methods / output and input pins .
2. Identify the Basic programming functions ( reading inputs and returning Outputs )
3. Identify the signals types that the ARDUINO treat with
4. Using sensors : a. measuring the room temp
b. measuring the light intensity
c. detection the movement .
d. Making a distance measuring tool ( using ultrasonic sensor )
e . --- working on a new sensor individuality ---
6. Using motors : a . DC motor
b. servo motor
c. stepper motor
5. Identify the H-BRIDGE and its usage
7. Using the KeyPad
8. Identify Serial interface
9. Using LCD display.
10 . -- Task : making a personal messenger --
11. Using a inferred IR sensor with remote Control
12 . use a seven segment screen
*** if there enough time , we will Do a PID
Control by ARDUINO ☺
Arduino : is a MICROCONTROLLER , able to be programmed by the users via ( Arduino c programming) .
( in fact , it is a Tiny computer )
MICROCONTROLLER : integrated circuit (fig 1.1) , contain CPU , memory ( RAM, ROM, Flash) ,
inputs & outputs ports
Fig 1.1 : Integrated circuits
Arduino Uno
Arduino Leonardo
Arduino Mega
Arduino LilyPad
Arduino Nano
Arduino mini
Cortino (ARM)
LeafLabs Maple
3
1
1. USB cable
2. External power supply
3. ATMEGA328 microcontroller
4. USB to Serial controller
5. 5V regulator
6. 16 MHz crystal
7. Rest push Potton
8. Ground (GND)
9. ( 5 ) volt output power
10. ( 3.3 ) output power
11. Input power pin
12. Analog input pins
13. Analog output pins ( ~3,~5,~6,~9,~10,~11)
14. Digital output / input pins ( All pins)
15. TX,RX led
16. Led connected with pin 13
17. Power indicator
2
3
4
5
6
7
8910 11
12
131415
16
17
Rated Power ( 7-12 ) volt
This done By :
1. Power Jet ( Battery )
1. Another circuit
1. USB cable
1
2
3
1
2
3
Vin
Digital Signal : Is a signal consists from tow values ( 0 or 1 )
To read a digital signal use the function : digitalRead();
To write a digital signal use the function : digitalWrite ();
In Arduino :
(logic 0) = ( volts 0) = LOW = OFF
( logic 1) = (volts 5) = HIGH = ON
Digital signals received and send by using the 14 pins
1 give a name for the pin “Optional”
1
2 Open the pin mode as ( INPUT / OUTPUT)
2
3 The pin is ready to Use by its name or
By its number
Analog Signal : Is a sinusoidal signal
To read an Analog signal use the function : analoglRead();
To write a digital signal use the function : analogWrite ();
Analog signals received by using the (A0 …. A5) pins
Analog signals sent by using the (~3 , ~5, ~6, ~9 ,~10, ~11) pins
Arduino treat with this type of signals as a ( 8 bit digital data )
(0 – 5 volt)  (0 – 255)
1 give a name for the pin “Optional”
2 Open the pin mode as
( INPUT / OUTPUT)
3 The pin is ready to Use by
its name or By its number
1
2
3
1 Lab View Interfacing
2 Mathlab Interfacing
3 Arduino IDE
IDE : Integrated Development Environment
Free program , you can get it from :
https://www.arduino.cc/download_handler.php
1 Verify : to check the code and catch the syntax Errors
5 Upload : to Save your Work on Your Computer
3 New : to Open New Sketch
4 Upload : to Open a Existence Sketch (Saved on
Computer Before )
2 Upload : to upload the code on the Arduino chip
6 Serial Monitor : to Open The Serial Monitor (
an Interfacing Monitor )
7 Sketch Name : Shows the Name of Current
Sketch
8 Coad Area : Coding Area
9 Massage Area : Show the Errors after Compile
10 Text Console : Show a full Error Massage
11 Board and Serial Port : Arduino COM number
1 Choose Your Arduino Type ::
Tools  Board  “ Select yours Board “
Most common boards :
1. Arduino /Genuino Uno  Arduino Uno
2. Arduino Leonardo
3. Arduino Nano
4. Arduino/Genuino Micro  Arduino Micro
2 Choose the COM number ::
Tools  Port  “ Select your Port “
Ready cods to use in your projects
It is used widely to know how the devices work.
likes : Servo motor , Stepper motor , LCD crystal
Serial communication , SD cards , wifi ……. etc
For Statement if Statement Switch Case Statement
for (initialization; condition; increment)
{ //statement(s); }
3
3
Parts :
1. Led ( Digital Out device )
2. Push Bottom (Digital in device )
3. Wires
4. Arduino
5. Bread Board
6. Carbon Resistance
3
3
Task :
Make a Traffic light with three led (Yellow , Green , Red )
Green HIGH  delay 1000 ms  Green LOW
delay 200 ms
Yellow HIGH  delay 1000ms Yellow LOW
delay 200 ms
Red HIGH  delay 1000ms  Red LOW
delay 200 ms
3
Parts :
1. Arduino
2. Wires
3. Push Bottom
4. Carbon Resistance
3
3 4
Parts :
1. Arduino
2. Wires
3. Variable resistance
4. Colored Led
5. Sensors.
Task is : to control the led light density by variable Resistance.
3 4
While the code is running , try to open :
Tools  Serial Plotter
3
Map  is a function defined in Arduino C language .
we use it to Re-maps a number from one range to another .
General form:
New_range = map (val , from min , from max , to min , to max);
In pervious example:
New_val = map(val, 0 , 1023 , 0 , 255) ;
// its convert val from (0-1023) range to (0-512)
3
Tow Thing you have start with:
1. Get the data sheet
2. find the range of measuring.
3. Use the map() function.
Example:
I have to measure the temperature in my room.
The sensor needed is TMP36 sensor. How can I start with ?!
1. Search in google for [TMP36 sensor].
2. Find the voltage range.
3. Find the measuring range.
4. Try to know how dose the sensor work.
3
In the pervious (ATMP36 )sensor .
if I need to eliminate the measured temperature values.
Measure from (0C to 100C for example )
Google it and teach yourself ☺
3
Parts : 3-Colored Led
Potentiometer
Bread Board
Jumper Wires
Task : Read analog Signal from Potentiometer,
and Light on Led as Indicator
0
100
200
300
4
4
Stepper
Dc
Servo
4
DC Motors
* Arduino Run Dc motors and controlling its speed by PWM , By code
analogWrite(pin,255);
* Arduino can Supply 5volt up to 400mA ,
to run 12volt Dc motors we need H-bridge
Dc Motor for Arduino Car Kite
“ 5 volt “
General Purpose Motor
“ 5 volt ”
High Power Dc motor
“ 12 volt ”
Servo Motors
* Motor rotates with certain angles in [Degrees], i.e: 60 , 90 , 180 …
* <Servo.h> Library used to drive the Servo Motor
Micro ServoBig Black Servo
4
#include <Servo.h>
Servo myservo; // create myservo
object to control a servo
myservo.attach(9); // attaches
the servo on pin 9 to the servo
object
myservo.write(pos); // tell servo to go
to position in variable 'pos'
4.2
The data Transmitted and Reserved Serially
Serial Data Flow
Baud Rate : how fast data Transmitted
Expressed in [Bit Per Second]
Serial Communication Between Arduino
and Serial-Monitor
Serial Communication Between two Arduinos
Bluetooth HC-06
Serial Communication Between two Arduino
And Smart-phone via Bluetooth
Example: Messenger Between Tow Arduinos
First Method Using Default Serial Communication Pins (0 & 1 )
What To Do in points !!
Read what The Other
Send to me !
This Happen by reading From
Serial Monitor
Replay To massages
By Writing on The
Serial Monitor
Example: Messenger Between Tow Arduinos
Messenger Between
Tow Arduinos
Arduino Code
4.3
There are many types of LCD screen the most common is :
16x2 LCD Crystal Screen
Consist from 2 lines and 16 column
20x4 LCD Crystal Screen
Consist from 4 lines and 20 column
Nokia 5110 LCD
Consist from 84x48 pixel
4 3
4.3
#include <LiquidCrystal.h>
lcd.begin() // to initiate the LCD
setCursor() //to set the pose of
printing on LCD
lcd.print() // to print on LCD
lcd.clear() // to clear LCD from Texts

Mais conteúdo relacionado

Mais procurados

Distance measurement using Ultrasonic sensor on Arduino Uno
Distance measurement using Ultrasonic sensor on Arduino UnoDistance measurement using Ultrasonic sensor on Arduino Uno
Distance measurement using Ultrasonic sensor on Arduino UnoAswin KP
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to ArduinoQtechknow
 
Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Tom Paulus
 
Arduino experimenters guide hq
Arduino experimenters guide hqArduino experimenters guide hq
Arduino experimenters guide hqAndreis Santos
 
Handling Asynchronous Events in MCUs
Handling Asynchronous Events in MCUsHandling Asynchronous Events in MCUs
Handling Asynchronous Events in MCUsCorrado Santoro
 
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009Eoin Brazil
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoVishnu
 
Introduction to Arduino and Circuits
Introduction to Arduino and CircuitsIntroduction to Arduino and Circuits
Introduction to Arduino and CircuitsJason Griffey
 
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IOT Academy
 
Arduino programming
Arduino programmingArduino programming
Arduino programmingSiji Sunny
 
Itsp documentation quadcopter flight controller based on kalman filters
Itsp documentation   quadcopter flight controller based on kalman filtersItsp documentation   quadcopter flight controller based on kalman filters
Itsp documentation quadcopter flight controller based on kalman filtersJyotirmaya Mahanta
 
44CON 2013 - Controlling a PC using Arduino
44CON 2013 - Controlling a PC using Arduino44CON 2013 - Controlling a PC using Arduino
44CON 2013 - Controlling a PC using ArduinoMichael Boman
 
Advanced view of atmega microcontroller projects list 1649 at mega32 avr
Advanced view of atmega microcontroller projects list 1649  at mega32 avrAdvanced view of atmega microcontroller projects list 1649  at mega32 avr
Advanced view of atmega microcontroller projects list 1649 at mega32 avrWiseNaeem
 
Advanced view arduino projects list use arduino for projects (5)
Advanced view arduino projects list   use arduino for projects (5)Advanced view arduino projects list   use arduino for projects (5)
Advanced view arduino projects list use arduino for projects (5)WiseNaeem
 

Mais procurados (19)

Distance measurement using Ultrasonic sensor on Arduino Uno
Distance measurement using Ultrasonic sensor on Arduino UnoDistance measurement using Ultrasonic sensor on Arduino Uno
Distance measurement using Ultrasonic sensor on Arduino Uno
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013Getting Started with Raspberry Pi - USC 2013
Getting Started with Raspberry Pi - USC 2013
 
Arduino experimenters guide hq
Arduino experimenters guide hqArduino experimenters guide hq
Arduino experimenters guide hq
 
Handling Asynchronous Events in MCUs
Handling Asynchronous Events in MCUsHandling Asynchronous Events in MCUs
Handling Asynchronous Events in MCUs
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
 
UART MCU
UART MCUUART MCU
UART MCU
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
What is arduino
What is arduinoWhat is arduino
What is arduino
 
Introduction to Arduino and Circuits
Introduction to Arduino and CircuitsIntroduction to Arduino and Circuits
Introduction to Arduino and Circuits
 
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripheralsThe IoT Academy IoT training Arduino Part 5 Arduino peripherals
The IoT Academy IoT training Arduino Part 5 Arduino peripherals
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Arduino
ArduinoArduino
Arduino
 
Arduino
ArduinoArduino
Arduino
 
Itsp documentation quadcopter flight controller based on kalman filters
Itsp documentation   quadcopter flight controller based on kalman filtersItsp documentation   quadcopter flight controller based on kalman filters
Itsp documentation quadcopter flight controller based on kalman filters
 
44CON 2013 - Controlling a PC using Arduino
44CON 2013 - Controlling a PC using Arduino44CON 2013 - Controlling a PC using Arduino
44CON 2013 - Controlling a PC using Arduino
 
Advanced view of atmega microcontroller projects list 1649 at mega32 avr
Advanced view of atmega microcontroller projects list 1649  at mega32 avrAdvanced view of atmega microcontroller projects list 1649  at mega32 avr
Advanced view of atmega microcontroller projects list 1649 at mega32 avr
 
Advanced view arduino projects list use arduino for projects (5)
Advanced view arduino projects list   use arduino for projects (5)Advanced view arduino projects list   use arduino for projects (5)
Advanced view arduino projects list use arduino for projects (5)
 

Semelhante a Starting with Arduino

Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming FamiliarizationAmit Kumer Podder
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixelssdcharle
 
Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Satoru Tokuhisa
 
Internet of things laboratory
Internet of things laboratoryInternet of things laboratory
Internet of things laboratorySoumee Maschatak
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalTony Olsson.
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptxyosikit826
 
INT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfINT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfMSingh88
 
Arduino frequency counter
Arduino frequency counterArduino frequency counter
Arduino frequency counternasyith_hananur
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseElaf A.Saeed
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
Arduino projects &amp; tutorials
Arduino projects &amp; tutorialsArduino projects &amp; tutorials
Arduino projects &amp; tutorialsAnshu Pandey
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slidesmkarlin14
 
Arduino slides
Arduino slidesArduino slides
Arduino slidessdcharle
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docxAjay578679
 
Project_report_on_Attendance_system
 Project_report_on_Attendance_system Project_report_on_Attendance_system
Project_report_on_Attendance_systemAmi Goswami
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 

Semelhante a Starting with Arduino (20)

Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Multi Sensory Communication 2/2
Multi Sensory Communication 2/2
 
Internet of things laboratory
Internet of things laboratoryInternet of things laboratory
Internet of things laboratory
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
 
INT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdfINT4073 L07(Sensors and AcutTORS).pdf
INT4073 L07(Sensors and AcutTORS).pdf
 
Arduino frequency counter
Arduino frequency counterArduino frequency counter
Arduino frequency counter
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Arduino projects &amp; tutorials
Arduino projects &amp; tutorialsArduino projects &amp; tutorials
Arduino projects &amp; tutorials
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
 
Project_report_on_Attendance_system
 Project_report_on_Attendance_system Project_report_on_Attendance_system
Project_report_on_Attendance_system
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Arduino: Arduino starter kit
Arduino: Arduino starter kitArduino: Arduino starter kit
Arduino: Arduino starter kit
 

Último

Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 

Último (20)

Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

Starting with Arduino

  • 1. ‫إعداد‬:‫شماسنة‬ ‫مجدي‬‫لعام‬ ‫والبرمجة‬ ‫األردوينو‬ ‫لدورة‬ ‫خصيصا‬ ‫األوراق‬ ‫هذه‬ ‫عدت‬ُ‫أ‬2017‫لنادي‬Imech E‫بيرزيت‬ ‫جامعة‬ ‫فرع‬
  • 2. The contents of this Course : This course is a workshop ( no much of Theories ) , so will involve in : 1. Identify the ARDUINO board parts and their works / power suppling methods / output and input pins . 2. Identify the Basic programming functions ( reading inputs and returning Outputs ) 3. Identify the signals types that the ARDUINO treat with 4. Using sensors : a. measuring the room temp b. measuring the light intensity c. detection the movement . d. Making a distance measuring tool ( using ultrasonic sensor ) e . --- working on a new sensor individuality ---
  • 3. 6. Using motors : a . DC motor b. servo motor c. stepper motor 5. Identify the H-BRIDGE and its usage 7. Using the KeyPad 8. Identify Serial interface 9. Using LCD display. 10 . -- Task : making a personal messenger -- 11. Using a inferred IR sensor with remote Control 12 . use a seven segment screen *** if there enough time , we will Do a PID Control by ARDUINO ☺
  • 4. Arduino : is a MICROCONTROLLER , able to be programmed by the users via ( Arduino c programming) . ( in fact , it is a Tiny computer ) MICROCONTROLLER : integrated circuit (fig 1.1) , contain CPU , memory ( RAM, ROM, Flash) , inputs & outputs ports Fig 1.1 : Integrated circuits
  • 5. Arduino Uno Arduino Leonardo Arduino Mega Arduino LilyPad Arduino Nano Arduino mini Cortino (ARM) LeafLabs Maple
  • 6. 3 1 1. USB cable 2. External power supply 3. ATMEGA328 microcontroller 4. USB to Serial controller 5. 5V regulator 6. 16 MHz crystal 7. Rest push Potton 8. Ground (GND) 9. ( 5 ) volt output power 10. ( 3.3 ) output power 11. Input power pin 12. Analog input pins 13. Analog output pins ( ~3,~5,~6,~9,~10,~11) 14. Digital output / input pins ( All pins) 15. TX,RX led 16. Led connected with pin 13 17. Power indicator 2 3 4 5 6 7 8910 11 12 131415 16 17
  • 7. Rated Power ( 7-12 ) volt This done By : 1. Power Jet ( Battery ) 1. Another circuit 1. USB cable 1 2 3 1 2 3 Vin
  • 8. Digital Signal : Is a signal consists from tow values ( 0 or 1 ) To read a digital signal use the function : digitalRead(); To write a digital signal use the function : digitalWrite (); In Arduino : (logic 0) = ( volts 0) = LOW = OFF ( logic 1) = (volts 5) = HIGH = ON Digital signals received and send by using the 14 pins
  • 9. 1 give a name for the pin “Optional” 1 2 Open the pin mode as ( INPUT / OUTPUT) 2 3 The pin is ready to Use by its name or By its number
  • 10. Analog Signal : Is a sinusoidal signal To read an Analog signal use the function : analoglRead(); To write a digital signal use the function : analogWrite (); Analog signals received by using the (A0 …. A5) pins Analog signals sent by using the (~3 , ~5, ~6, ~9 ,~10, ~11) pins Arduino treat with this type of signals as a ( 8 bit digital data ) (0 – 5 volt)  (0 – 255)
  • 11. 1 give a name for the pin “Optional” 2 Open the pin mode as ( INPUT / OUTPUT) 3 The pin is ready to Use by its name or By its number 1 2 3
  • 12. 1 Lab View Interfacing 2 Mathlab Interfacing
  • 13. 3 Arduino IDE IDE : Integrated Development Environment Free program , you can get it from : https://www.arduino.cc/download_handler.php
  • 14. 1 Verify : to check the code and catch the syntax Errors 5 Upload : to Save your Work on Your Computer 3 New : to Open New Sketch 4 Upload : to Open a Existence Sketch (Saved on Computer Before ) 2 Upload : to upload the code on the Arduino chip 6 Serial Monitor : to Open The Serial Monitor ( an Interfacing Monitor ) 7 Sketch Name : Shows the Name of Current Sketch 8 Coad Area : Coding Area 9 Massage Area : Show the Errors after Compile 10 Text Console : Show a full Error Massage 11 Board and Serial Port : Arduino COM number
  • 15. 1 Choose Your Arduino Type :: Tools  Board  “ Select yours Board “ Most common boards : 1. Arduino /Genuino Uno  Arduino Uno 2. Arduino Leonardo 3. Arduino Nano 4. Arduino/Genuino Micro  Arduino Micro
  • 16. 2 Choose the COM number :: Tools  Port  “ Select your Port “
  • 17. Ready cods to use in your projects It is used widely to know how the devices work. likes : Servo motor , Stepper motor , LCD crystal Serial communication , SD cards , wifi ……. etc
  • 18. For Statement if Statement Switch Case Statement
  • 19.
  • 20. for (initialization; condition; increment) { //statement(s); }
  • 21.
  • 22. 3
  • 23. 3 Parts : 1. Led ( Digital Out device ) 2. Push Bottom (Digital in device ) 3. Wires 4. Arduino 5. Bread Board 6. Carbon Resistance
  • 24. 3
  • 25. 3 Task : Make a Traffic light with three led (Yellow , Green , Red ) Green HIGH  delay 1000 ms  Green LOW delay 200 ms Yellow HIGH  delay 1000ms Yellow LOW delay 200 ms Red HIGH  delay 1000ms  Red LOW delay 200 ms
  • 26. 3 Parts : 1. Arduino 2. Wires 3. Push Bottom 4. Carbon Resistance
  • 27.
  • 28. 3
  • 29. 3 4 Parts : 1. Arduino 2. Wires 3. Variable resistance 4. Colored Led 5. Sensors. Task is : to control the led light density by variable Resistance.
  • 30. 3 4 While the code is running , try to open : Tools  Serial Plotter
  • 31. 3 Map  is a function defined in Arduino C language . we use it to Re-maps a number from one range to another . General form: New_range = map (val , from min , from max , to min , to max); In pervious example: New_val = map(val, 0 , 1023 , 0 , 255) ; // its convert val from (0-1023) range to (0-512)
  • 32. 3 Tow Thing you have start with: 1. Get the data sheet 2. find the range of measuring. 3. Use the map() function. Example: I have to measure the temperature in my room. The sensor needed is TMP36 sensor. How can I start with ?! 1. Search in google for [TMP36 sensor]. 2. Find the voltage range. 3. Find the measuring range. 4. Try to know how dose the sensor work.
  • 33. 3 In the pervious (ATMP36 )sensor . if I need to eliminate the measured temperature values. Measure from (0C to 100C for example ) Google it and teach yourself ☺
  • 34. 3 Parts : 3-Colored Led Potentiometer Bread Board Jumper Wires Task : Read analog Signal from Potentiometer, and Light on Led as Indicator 0 100 200 300
  • 35.
  • 36. 4
  • 38. 4 DC Motors * Arduino Run Dc motors and controlling its speed by PWM , By code analogWrite(pin,255); * Arduino can Supply 5volt up to 400mA , to run 12volt Dc motors we need H-bridge Dc Motor for Arduino Car Kite “ 5 volt “ General Purpose Motor “ 5 volt ” High Power Dc motor “ 12 volt ”
  • 39.
  • 40.
  • 41. Servo Motors * Motor rotates with certain angles in [Degrees], i.e: 60 , 90 , 180 … * <Servo.h> Library used to drive the Servo Motor Micro ServoBig Black Servo 4
  • 42. #include <Servo.h> Servo myservo; // create myservo object to control a servo myservo.attach(9); // attaches the servo on pin 9 to the servo object myservo.write(pos); // tell servo to go to position in variable 'pos'
  • 43. 4.2 The data Transmitted and Reserved Serially Serial Data Flow Baud Rate : how fast data Transmitted Expressed in [Bit Per Second]
  • 44. Serial Communication Between Arduino and Serial-Monitor
  • 46. Bluetooth HC-06 Serial Communication Between two Arduino And Smart-phone via Bluetooth
  • 47. Example: Messenger Between Tow Arduinos First Method Using Default Serial Communication Pins (0 & 1 )
  • 48. What To Do in points !! Read what The Other Send to me ! This Happen by reading From Serial Monitor Replay To massages By Writing on The Serial Monitor Example: Messenger Between Tow Arduinos
  • 50. 4.3 There are many types of LCD screen the most common is : 16x2 LCD Crystal Screen Consist from 2 lines and 16 column 20x4 LCD Crystal Screen Consist from 4 lines and 20 column Nokia 5110 LCD Consist from 84x48 pixel
  • 51. 4 3
  • 52. 4.3 #include <LiquidCrystal.h> lcd.begin() // to initiate the LCD setCursor() //to set the pose of printing on LCD lcd.print() // to print on LCD lcd.clear() // to clear LCD from Texts