SlideShare a Scribd company logo
1 of 60
Arduino
Open Sourcing Imagination
myduino.com 1
Sypnopsis
 This workshop intends to expose participants to a much
simpler approach to microcontroller based on practical
problem-based approach.
 Enable participants to gain real-world experience to
monitor and control engineering processes and develop
competent skills.
 It has been specially designed for beginners and
educators
myduino.com 2
Microcontroller
 Microcontrollers are dedicated to
one task and run one specific
program.
 Examples of tasks could be:
i. Received from inputs via ports
(read from external hardware)
ii. Stored data in file registers &
arithmetic operations (added,
subtracted, logic gates)
iii. Sent out data (control external
hardware)
 Processor, Storage and RAM all in
one tiny package
myduino.com 3
myduino.com 4
With & Without A Microcontroller
Internal Architecture
Program
Memory Register
RAM EEPROM PORTS
Program Memory: Where all commands, written by users are stored
Register: To determine what action the uC takes in reference to the
program commands
RAM: Temporarily store data of any action
EEPROM: The data is retain even after power is switched-off
Ports: Bidirectional pins of Input and Output
myduino.com 5
myduino.com 6
Arduino Uno Specifications
 Microcontroller: ATmega328
 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
 Flash Memory: 32 KB (ATmega328) of which 0.5
KB used by bootloader
 SRAM: 2 KB (ATmega328)
 EEPROM: 1 KB (ATmega328)
 Clock Speed: 16 MHz
myduino.com 7
Arduino Terminology
 “sketch” – a program you write to run on an
Arduino board
 “pin” – an input or output connected to
something. e.g. output to an LED, input from
a knob.
 Analog signals – directly measurable
quantities in terms of some other quantity
 Digital Signals – have only two states. For
digital computers, we refer to binary states, 0
and 1. “1” can be on, “0” can be off
myduino.com 8
Workshop Summary
 Introduction to Arduino
 Setting up your Arduino Environment
 First Arduino sketch
 Making LEDs glow and blink
 How to read buttons/switches
 Analog Signals
 Serial Communication
 Digital Thermometer
myduino.com 9
Participant Manifest
 Thumb drive with notes, arduino software for
Windows and source code (“sketches”) used
in class
 Arduino Starter Kit:
Arduino Uno Tactile push button
Half size breadboard Liquid Crystal Display
Jumper wires Piezo Buzzer
LEDs USB Cable
Resistors Temperature Sensor
Potentiometer
myduino.com 10
Breadboard
 A breadboard (or protoboard)
is a construction base for
prototyping of electronics
 Wires and components are
simply pushed into the holes to
form a completed circuit and
power can be applied.
myduino.com 11
Components: LED
 LED (Light Emitting Diode)
 What it Does: Emits light
when a small current is passed
through it.
 Leads: 2 (one longer, this one
connects to positive)
 Things to watch out for: Will
only work in one direction
 Looks like a mini light bulb. -
Requires a current limiting
resistor
myduino.com 12
Resistors
 What it Does: Restricts
the amount of current
that can flow through a
circuit.
 Leads: 2
 Things to watch out
for: Easy to grab the
wrong value
 Cylinder with wires
extending from either
end. The value is
displayed using a color
myduino.com 13
Potentiometer
 What it Does: Produces a
variable resistance dependant
on the angular position of the
shaft.
 Leads: 3
 Things to watch out for:
 Identifying: - Accidentally
buying logarithmic scale.
 They can be packaged in
many different form factors,
look for a dial to identify.
myduino.com 14
Pushbutton
 What it Does: Completes a
circuit when it is pressed. 4
 Leads: 4
 A little square with leads out
the bottom and a button on the
top.
myduino.com 15
Piezo Element
 What it Does: A pulse of
current will cause it to click. A
stream of pulses will cause it
to emit a tone.
 Leads: 2
 Things to watch out for:
Difficult to misuse.
 In this kit it comes in a little
black barrel, but sometimes
they are just a gold disc
myduino.com 16
Temperature Sensor (LM35)
 The LM35 series are precision integrated-circuit
temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature.
 The LM35 is rated to operate over a −55° to +150°C
temperature range, and has a linear + 10.0 mV/°C scale
factor.
myduino.com 17
Liquid Crystal Display
 An LCD has the advantage of
displaying alpha-numeric
characters and even user-
defined graphics.
 It also offers the ability for
lower power consumption,
making it ideal for battery
operated systems.
 It comes in a wide variety of
shapes and sizes with line
lengths of 8, 16, 20, 24, 32 and
40 characters, in one, two and
four line versions.
myduino.com 18
What is Electricity
 A fan contains a small battery,
a couple of wires, a switch and
an electric motor.
 If you turn the switch on, the
motor will start to spin
 Battery is both a water
reservoir and a pump, the
switch is a tap, and the motor
is one of those wheels that you
see in watermills.
 When you open the tap, water
flows from the pump and
pushes the wheel into motion.
myduino.com 19
The hydraulic system
 Increasing the size of the pipes
allows a greater flow of water
to go through them, effectively
reduced the pipes' resistance
to the flow of water.
 This approach works up to a
certain point, at which the
wheel won't spin any faster,
because the pressure of the
water is not strong enough.
 When we reach this point, we
need the pump to be stronger.
myduino.com 20
Voltage, Current & Resistance
 So when you read that a battery's voltage is 9 V, think of this voltage
like the water pressure that can potentially be produced by this little
"pump".
 The flow rate of water relates to current, and is measured in
amperes.
 Finally, the resistance opposing the flow of current over any path
that it travels is called resistance, and is measured in ohms.
 Relationship: A higher voltage (pressure) lets you spin a wheel
faster; a higher flow rate (current) lets you spin a larger wheel.
 Ohms Law, V = IR
myduino.com 21
myduino.com 22
myduino.com 23
myduino.com 24
 Breadboards have small holes for jumper wires and
components to be plugged into.
Construct Circuit 1
myduino.com 25
Construct Circuit 2
myduino.com 26
myduino.com 27
Select Board & Com Port
myduino.com 28
Blinking an LED
digitalWrite
 The Arduino board comes with
an LED preinstalled. It's
marked "L". You can also add
your own LED
 Tell Arduino what to do.
 This is done through code, that
is, a list of instructions that we
give the microcontroller to
make it do what we want.
 Blink an LED is the Hello
World of physical computing
myduino.com 29
myduino.com 30
myduino.com 31
Status Bar
myduino.com 32
myduino.com 33
Built-in Examples
myduino.com 34
myduino.com 35
Push Button – digitalRead
myduino.com 36
Pulse Width Modulation (PWM)
 If you blink the LED fast
enough, you don't see it blink
any more, but you can change
its brightness by changing the
ratio between the on time and
the off time.
 This technique also works with
devices other than an LED.
For example, you can change
the speed of a motor in the
same way
 analogWrite(9,128) will set the
brightness of an LED
connected to pin 9 to 50%.
myduino.com 38
myduino.com 39
Arduino PWM
8 Bits
Data Vout
x 0.0196
0
To
255
0
To
5V
PWM Output (Vout) = Data
5V 255
PWM Output (Vout) = Data x 5 V
255
= Data x 0.0196
Ex: If Data = 128; Vout = 128 x 0.0196 = 2.5088 V
analogWrite (PWM_pin, 128); // Will give an output of 2.5088 V
myduino.com 40
Analogue Input
 This is the difference
between an on/off
sensor (which tells us
whether something is
there) and an analogue
sensor, whose value
continuously changes.
 By using the
analogRead() function,
we can read the voltage
applied to one of the
pins. This function
returns a number
between 0 and 1023,
which represents
voltages between 0 and
5 volts
myduino.com 41
myduino.com 42
Number of iterations (steps) for an ADC is
calculated as follows:
2N
= Number of steps.
Where N corresponds to the number of bits
Ex: 2 bits, 22
= 4
Resolution = Voltage Range = 5V = 1.25
No of steps 4
Vin Dout
0 – 1.25 0
1.25 – 2.5 1
2.5 – 3.75 2
3.75 - 5 3
Arduino ADC Calculations
 10 bit ADC, 210
= 1024 steps
 The resolution of an ADC is calculated as follows:
Resolution = Voltage Range = 5V = 0.00488 V
No of steps 1024
 The output of the ADC is calculated as follows:
ADC Output (dout) = Vin = 3.3 = 676
Resolution 0.00488
myduino.com 43
ADC Output (dout) = Vin = 3.3 = 676
Resolution 0.00488
myduino.com 44
ADC Arduino
10 bits
vin dout
÷ 0.00488
x 0.00488
Vin = dout x Resolution = 676 x 0.00488 = 3.3
myduino.com 45
Producing Variable Voltage
Temperature Sensor (LM35)
 The LM35 series are precision integrated-circuit
temperature sensors, whose output voltage is linearly
proportional to the Celsius (Centigrade) temperature.
 The LM35 is rated to operate over a −55° to +150°C
temperature range, and has a linear + 10.0 mV/°C scale
factor.
myduino.com 46
myduino.com 47
Liquid Crystal Display
 An LCD has the advantage of
displaying alpha-numeric
characters and even user-
defined graphics.
 It also offers the ability for
lower power consumption,
making it ideal for battery
operated systems.
 It comes in a wide variety of
shapes and sizes with line
lengths of 8, 16, 20, 24, 32 and
40 characters, in one, two and
four line versions.
myduino.com 48
myduino.com 49
myduino.com 50
Connecting your LCD (Backlight)
myduino.com 51
Connecting your Power & Contrast
myduino.com 52
Connecting your Bus Wiring
myduino.com 53
LCD 14 13 12 11 10 9 8 7 6 5 4 3 2 1
7 6 5 4 3 GND 2 POT 5V GND
myduino.com 54
Reconnecting your LM35
Arduino Library
 A library is a big collection of related procedures.
 If you, say, want to control a motor, you may want
to find a Motor Control Library: a collection of
procedures that have already been written for you
that you can use without having to do the dirty
work of learning the nuances of motors.
 One of the best features of the Arduino project is
the ability to add on pre-crafted libraries that add
hardware support. There's tons of them, and you
can pick and choose which to install.
Arduino Library
 A library is a folder with some files in it, the files will end
in .cpp (C++ code file) and .h (C++ header file).
 Two optional files are keywords.txt (this is a hints file to
tell the Arduino IDE how to colorize your sketch and
examples folder, which may have some handy test-
sketches.
How to Install Library
 Download your desired library
(normally in a compressed zip file)
 Find the zip file on your local computer
(wherever downloaded files end up).
Under Windows, you should be able to
double click on the file to open it up.
Older windows, winrar or winzip will
pop-up.
 Copy the file and paste in inside the
libraries folder in your Arduino
directory.
Arduino Shield
myduino.com 58
Arduino Tracker
59
GOOD SITES:
1. myduino.com
2. http://www.facebook.com/groups/arduinomalaysia/?
ref=ts&fref=ts
3. http://tronixstuff.wordpress.com/
4. http://bildr.org/
5. http://www.instructables.com
6. http://www.jeremyblum.com/category/arduino-tutorials/
7. http://letsmakerobots.com/start
8. http://hackaday.com
9. http://playground.arduino.cc/

More Related Content

What's hot

Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!Makers of India
 
DHT11 Digital Temperature and Humidity Sensor
DHT11 Digital Temperature and Humidity SensorDHT11 Digital Temperature and Humidity Sensor
DHT11 Digital Temperature and Humidity SensorRaghav Shetty
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYVishnu
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoVishnu
 
03 analogue anrduino fundamentals
03   analogue anrduino fundamentals03   analogue anrduino fundamentals
03 analogue anrduino fundamentalsWingston
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'tsyogesh46
 
Advanced view arduino projects list use arduino for projects (3)
Advanced view arduino projects list  use arduino for projects (3)Advanced view arduino projects list  use arduino for projects (3)
Advanced view arduino projects list use arduino for projects (3)WiseNaeem
 
02 General Purpose Input - Output on the Arduino
02   General Purpose Input -  Output on the Arduino02   General Purpose Input -  Output on the Arduino
02 General Purpose Input - Output on the ArduinoWingston
 
Fading leds via pwm
Fading leds via pwmFading leds via pwm
Fading leds via pwmHIET
 
Arduino slides
Arduino slidesArduino slides
Arduino slidessdcharle
 
Getting Started With Arduino How To Build A Twitter Monitoring Alertuino
Getting Started With Arduino   How To Build A Twitter Monitoring AlertuinoGetting Started With Arduino   How To Build A Twitter Monitoring Alertuino
Getting Started With Arduino How To Build A Twitter Monitoring AlertuinoAdrian McEwen
 
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
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingYuda Wardiana
 
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
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATIONsoma saikiran
 

What's hot (20)

Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
 
DHT11 Digital Temperature and Humidity Sensor
DHT11 Digital Temperature and Humidity SensorDHT11 Digital Temperature and Humidity Sensor
DHT11 Digital Temperature and Humidity Sensor
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
03 analogue anrduino fundamentals
03   analogue anrduino fundamentals03   analogue anrduino fundamentals
03 analogue anrduino fundamentals
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Advanced view arduino projects list use arduino for projects (3)
Advanced view arduino projects list  use arduino for projects (3)Advanced view arduino projects list  use arduino for projects (3)
Advanced view arduino projects list use arduino for projects (3)
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
Introduction to Arduino & Robotics
Introduction to Arduino & Robotics Introduction to Arduino & Robotics
Introduction to Arduino & Robotics
 
02 General Purpose Input - Output on the Arduino
02   General Purpose Input -  Output on the Arduino02   General Purpose Input -  Output on the Arduino
02 General Purpose Input - Output on the Arduino
 
Fading leds via pwm
Fading leds via pwmFading leds via pwm
Fading leds via pwm
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Lecture6
Lecture6Lecture6
Lecture6
 
Getting Started With Arduino How To Build A Twitter Monitoring Alertuino
Getting Started With Arduino   How To Build A Twitter Monitoring AlertuinoGetting Started With Arduino   How To Build A Twitter Monitoring Alertuino
Getting Started With Arduino How To Build A Twitter Monitoring Alertuino
 
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
 
Monitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recordingMonitoring temperature rumah dengan display lcd dan recording
Monitoring temperature rumah dengan display lcd dan recording
 
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
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
 
Basic Sensors
Basic Sensors Basic Sensors
Basic Sensors
 

Similar to Notes arduino workshop_15

Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 
Advanced view of atmega microcontroller projects list at mega32 avr
Advanced view of atmega microcontroller projects list   at mega32 avrAdvanced view of atmega microcontroller projects list   at mega32 avr
Advanced view of atmega microcontroller projects list at mega32 avrWiseNaeem
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slidesmkarlin14
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfAbdErrezakChahoub
 
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdfAVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdfIsmailkhan77481
 
electronic voting machine by rfid
electronic voting machine by rfidelectronic voting machine by rfid
electronic voting machine by rfidSaurabh Uniyal
 
A Report on Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
A Report on Bidirectional Visitor Counter using IR sensors and Arduino Uno R3A Report on Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
A Report on Bidirectional Visitor Counter using IR sensors and Arduino Uno R3Abhishekvb
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1Afzal Ahmad
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalTony Olsson.
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalTony Olsson.
 
summer training report (2)
summer training report (2)summer training report (2)
summer training report (2)Kavya Gupta
 
Tinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptxTinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptxJayashreeSelvam5
 

Similar to Notes arduino workshop_15 (20)

Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Advanced view of atmega microcontroller projects list at mega32 avr
Advanced view of atmega microcontroller projects list   at mega32 avrAdvanced view of atmega microcontroller projects list   at mega32 avr
Advanced view of atmega microcontroller projects list at mega32 avr
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
 
Ardui no
Ardui no Ardui no
Ardui no
 
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdfAVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
 
electronic voting machine by rfid
electronic voting machine by rfidelectronic voting machine by rfid
electronic voting machine by rfid
 
A Report on Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
A Report on Bidirectional Visitor Counter using IR sensors and Arduino Uno R3A Report on Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
A Report on Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
 
Arduino Thermometer
Arduino ThermometerArduino Thermometer
Arduino Thermometer
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
Embedded systems presentation
Embedded systems presentationEmbedded systems presentation
Embedded systems presentation
 
Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
 
summer training report (2)
summer training report (2)summer training report (2)
summer training report (2)
 
Minor_project.ppt.pdf
Minor_project.ppt.pdfMinor_project.ppt.pdf
Minor_project.ppt.pdf
 
Tinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptxTinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptx
 
Control system
Control systemControl system
Control system
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

Notes arduino workshop_15

  • 2. Sypnopsis  This workshop intends to expose participants to a much simpler approach to microcontroller based on practical problem-based approach.  Enable participants to gain real-world experience to monitor and control engineering processes and develop competent skills.  It has been specially designed for beginners and educators myduino.com 2
  • 3. Microcontroller  Microcontrollers are dedicated to one task and run one specific program.  Examples of tasks could be: i. Received from inputs via ports (read from external hardware) ii. Stored data in file registers & arithmetic operations (added, subtracted, logic gates) iii. Sent out data (control external hardware)  Processor, Storage and RAM all in one tiny package myduino.com 3
  • 4. myduino.com 4 With & Without A Microcontroller
  • 5. Internal Architecture Program Memory Register RAM EEPROM PORTS Program Memory: Where all commands, written by users are stored Register: To determine what action the uC takes in reference to the program commands RAM: Temporarily store data of any action EEPROM: The data is retain even after power is switched-off Ports: Bidirectional pins of Input and Output myduino.com 5
  • 7. Arduino Uno Specifications  Microcontroller: ATmega328  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  Flash Memory: 32 KB (ATmega328) of which 0.5 KB used by bootloader  SRAM: 2 KB (ATmega328)  EEPROM: 1 KB (ATmega328)  Clock Speed: 16 MHz myduino.com 7
  • 8. Arduino Terminology  “sketch” – a program you write to run on an Arduino board  “pin” – an input or output connected to something. e.g. output to an LED, input from a knob.  Analog signals – directly measurable quantities in terms of some other quantity  Digital Signals – have only two states. For digital computers, we refer to binary states, 0 and 1. “1” can be on, “0” can be off myduino.com 8
  • 9. Workshop Summary  Introduction to Arduino  Setting up your Arduino Environment  First Arduino sketch  Making LEDs glow and blink  How to read buttons/switches  Analog Signals  Serial Communication  Digital Thermometer myduino.com 9
  • 10. Participant Manifest  Thumb drive with notes, arduino software for Windows and source code (“sketches”) used in class  Arduino Starter Kit: Arduino Uno Tactile push button Half size breadboard Liquid Crystal Display Jumper wires Piezo Buzzer LEDs USB Cable Resistors Temperature Sensor Potentiometer myduino.com 10
  • 11. Breadboard  A breadboard (or protoboard) is a construction base for prototyping of electronics  Wires and components are simply pushed into the holes to form a completed circuit and power can be applied. myduino.com 11
  • 12. Components: LED  LED (Light Emitting Diode)  What it Does: Emits light when a small current is passed through it.  Leads: 2 (one longer, this one connects to positive)  Things to watch out for: Will only work in one direction  Looks like a mini light bulb. - Requires a current limiting resistor myduino.com 12
  • 13. Resistors  What it Does: Restricts the amount of current that can flow through a circuit.  Leads: 2  Things to watch out for: Easy to grab the wrong value  Cylinder with wires extending from either end. The value is displayed using a color myduino.com 13
  • 14. Potentiometer  What it Does: Produces a variable resistance dependant on the angular position of the shaft.  Leads: 3  Things to watch out for:  Identifying: - Accidentally buying logarithmic scale.  They can be packaged in many different form factors, look for a dial to identify. myduino.com 14
  • 15. Pushbutton  What it Does: Completes a circuit when it is pressed. 4  Leads: 4  A little square with leads out the bottom and a button on the top. myduino.com 15
  • 16. Piezo Element  What it Does: A pulse of current will cause it to click. A stream of pulses will cause it to emit a tone.  Leads: 2  Things to watch out for: Difficult to misuse.  In this kit it comes in a little black barrel, but sometimes they are just a gold disc myduino.com 16
  • 17. Temperature Sensor (LM35)  The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature.  The LM35 is rated to operate over a −55° to +150°C temperature range, and has a linear + 10.0 mV/°C scale factor. myduino.com 17
  • 18. Liquid Crystal Display  An LCD has the advantage of displaying alpha-numeric characters and even user- defined graphics.  It also offers the ability for lower power consumption, making it ideal for battery operated systems.  It comes in a wide variety of shapes and sizes with line lengths of 8, 16, 20, 24, 32 and 40 characters, in one, two and four line versions. myduino.com 18
  • 19. What is Electricity  A fan contains a small battery, a couple of wires, a switch and an electric motor.  If you turn the switch on, the motor will start to spin  Battery is both a water reservoir and a pump, the switch is a tap, and the motor is one of those wheels that you see in watermills.  When you open the tap, water flows from the pump and pushes the wheel into motion. myduino.com 19
  • 20. The hydraulic system  Increasing the size of the pipes allows a greater flow of water to go through them, effectively reduced the pipes' resistance to the flow of water.  This approach works up to a certain point, at which the wheel won't spin any faster, because the pressure of the water is not strong enough.  When we reach this point, we need the pump to be stronger. myduino.com 20
  • 21. Voltage, Current & Resistance  So when you read that a battery's voltage is 9 V, think of this voltage like the water pressure that can potentially be produced by this little "pump".  The flow rate of water relates to current, and is measured in amperes.  Finally, the resistance opposing the flow of current over any path that it travels is called resistance, and is measured in ohms.  Relationship: A higher voltage (pressure) lets you spin a wheel faster; a higher flow rate (current) lets you spin a larger wheel.  Ohms Law, V = IR myduino.com 21
  • 24. myduino.com 24  Breadboards have small holes for jumper wires and components to be plugged into.
  • 28. Select Board & Com Port myduino.com 28
  • 29. Blinking an LED digitalWrite  The Arduino board comes with an LED preinstalled. It's marked "L". You can also add your own LED  Tell Arduino what to do.  This is done through code, that is, a list of instructions that we give the microcontroller to make it do what we want.  Blink an LED is the Hello World of physical computing myduino.com 29
  • 35. myduino.com 35 Push Button – digitalRead
  • 37. Pulse Width Modulation (PWM)  If you blink the LED fast enough, you don't see it blink any more, but you can change its brightness by changing the ratio between the on time and the off time.  This technique also works with devices other than an LED. For example, you can change the speed of a motor in the same way  analogWrite(9,128) will set the brightness of an LED connected to pin 9 to 50%.
  • 39. myduino.com 39 Arduino PWM 8 Bits Data Vout x 0.0196 0 To 255 0 To 5V PWM Output (Vout) = Data 5V 255 PWM Output (Vout) = Data x 5 V 255 = Data x 0.0196 Ex: If Data = 128; Vout = 128 x 0.0196 = 2.5088 V analogWrite (PWM_pin, 128); // Will give an output of 2.5088 V
  • 41. Analogue Input  This is the difference between an on/off sensor (which tells us whether something is there) and an analogue sensor, whose value continuously changes.  By using the analogRead() function, we can read the voltage applied to one of the pins. This function returns a number between 0 and 1023, which represents voltages between 0 and 5 volts myduino.com 41
  • 42. myduino.com 42 Number of iterations (steps) for an ADC is calculated as follows: 2N = Number of steps. Where N corresponds to the number of bits Ex: 2 bits, 22 = 4 Resolution = Voltage Range = 5V = 1.25 No of steps 4 Vin Dout 0 – 1.25 0 1.25 – 2.5 1 2.5 – 3.75 2 3.75 - 5 3
  • 43. Arduino ADC Calculations  10 bit ADC, 210 = 1024 steps  The resolution of an ADC is calculated as follows: Resolution = Voltage Range = 5V = 0.00488 V No of steps 1024  The output of the ADC is calculated as follows: ADC Output (dout) = Vin = 3.3 = 676 Resolution 0.00488 myduino.com 43
  • 44. ADC Output (dout) = Vin = 3.3 = 676 Resolution 0.00488 myduino.com 44 ADC Arduino 10 bits vin dout ÷ 0.00488 x 0.00488 Vin = dout x Resolution = 676 x 0.00488 = 3.3
  • 46. Temperature Sensor (LM35)  The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature.  The LM35 is rated to operate over a −55° to +150°C temperature range, and has a linear + 10.0 mV/°C scale factor. myduino.com 46
  • 48. Liquid Crystal Display  An LCD has the advantage of displaying alpha-numeric characters and even user- defined graphics.  It also offers the ability for lower power consumption, making it ideal for battery operated systems.  It comes in a wide variety of shapes and sizes with line lengths of 8, 16, 20, 24, 32 and 40 characters, in one, two and four line versions. myduino.com 48
  • 51. Connecting your LCD (Backlight) myduino.com 51
  • 52. Connecting your Power & Contrast myduino.com 52
  • 53. Connecting your Bus Wiring myduino.com 53 LCD 14 13 12 11 10 9 8 7 6 5 4 3 2 1 7 6 5 4 3 GND 2 POT 5V GND
  • 55. Arduino Library  A library is a big collection of related procedures.  If you, say, want to control a motor, you may want to find a Motor Control Library: a collection of procedures that have already been written for you that you can use without having to do the dirty work of learning the nuances of motors.  One of the best features of the Arduino project is the ability to add on pre-crafted libraries that add hardware support. There's tons of them, and you can pick and choose which to install.
  • 56. Arduino Library  A library is a folder with some files in it, the files will end in .cpp (C++ code file) and .h (C++ header file).  Two optional files are keywords.txt (this is a hints file to tell the Arduino IDE how to colorize your sketch and examples folder, which may have some handy test- sketches.
  • 57. How to Install Library  Download your desired library (normally in a compressed zip file)  Find the zip file on your local computer (wherever downloaded files end up). Under Windows, you should be able to double click on the file to open it up. Older windows, winrar or winzip will pop-up.  Copy the file and paste in inside the libraries folder in your Arduino directory.
  • 60. GOOD SITES: 1. myduino.com 2. http://www.facebook.com/groups/arduinomalaysia/? ref=ts&fref=ts 3. http://tronixstuff.wordpress.com/ 4. http://bildr.org/ 5. http://www.instructables.com 6. http://www.jeremyblum.com/category/arduino-tutorials/ 7. http://letsmakerobots.com/start 8. http://hackaday.com 9. http://playground.arduino.cc/