SlideShare a Scribd company logo
1 of 71
Getting Started
with the
Arduino Uno
by Eric J. Richardson and Vui Nguyen
September 2017
Legal Disclaimer
Arduino is a trademark of somebody, certainly
But not us
Why this Presentation?
● Last year, we started
doing IoT when we
entered the Intel IoT
Roadshow
●“Save the Water Pipes”
was an automated
faucet dripper – handy to
prevent pipes from
freezing and breaking in
cold climates like
Colorado!
● Vui: software architect
● Eric: hardware engineer
● Crystal: web developer
Why this Presentation?
●We entered our project in
the US-China Young Maker
Competition (Sponsored by
Intel) and competed in
China!
● Vui presented our “Save
the Water Pipes” project to
Women Who Code
● Several of the Women Who Code had questions
about the Intel Edison board which powered our
project
Why this Presentation?
● There was a lot of interest in the Intel Edison
● The Edison is cool, but at $100 it’s a bit pricey
to get started with an embedded computing
project
● so Eric did a follow up presentation at WWC on
the Raspberry Pi
● Why the Raspberry Pi?
Why this Presentation?
● Raspberry Pi is a great value, single-board computer, and can
be used as the basis for many projects
● At Raspberry Pi presentation, Eric also provided a good
overview of electronics and hardware concepts
● But there is a lot of setup with Raspberry Pi just to get started
● With Arduino Uno, you could get up and running much more
quickly, for as much money, with less equipment and setup
Who is this Presentation For?
● This presentation is for software devs interested in
learning about hardware
● You should, by the end, know enough to get an Arduino
Uno up and running, and writing Arduino sketches
● And, hopefully, driving electronic circuits
● We hope that we cover at least one thing you already
know, and at least one thing you don't
● If you have a question about something, please ask! We
may wave it off as something we cover later
Personal Disclaimer
For those of you who are already familiar with all of this, Eric
apologizes if he sounds like he's “mansplaining”! He now has
Vui co-presenting to help with this.
Who Are We?
Eric J. Richardson
Lockheed Martin Systems Engineer
Colorado State University
B.S. Electrical & Computer Engineering, 2004
LIKES: DISLIKES:
● Antique Cars
● Dogs
● Shadowrun
● Cajun Food
● Old Video Games
● Hand Tools
● Cool Boots
● Cancer
● Fascism
● Lasagna
● TV Commercials
Which Assume I'm
Familiar with
Sports Stars
Who Are We?
Vui Nguyen
SimplyE iOS Developer
Colorado School of Mines
B.S. Computer Science, 1999
University of Denver
M.S. Computer Science, 2006
LIKES: DISLIKES:
● Fishing
● Eating
● Fishing
● Traveling
● Fishing
● Dogs
● Fishing
● Not Fishing
Enough
● Sexism
● Doing Dishes
● Negativity
● Being asked,
“Where are you
from?”
Who Are We Not?
● We are not graphic artists!
● We are not full-fledged Arduino experts!
● We fully expect someone here to ask us a question we
don't know the answer to
What is “Arduino”?
● 3 things:
– Arduino is an Italian company that designs low-cost
computers designed to interact with physical hardware
● These are open-source hardware designs
– “Arduino-compatible” boards have special I/O ports that
allow the boards to be expanded with plugin-in modules
called shields
– It’s also the Arduino-specific programming language
(based on C++) and IDE
● We will be working with the Arduino Uno board
Arduino Uno: What Does It Have?
Arduino Uno
● 14 Digital Input / Output pins (6 of these can be used as Analog outputs)
● 6 Analog inputs
● Atmel 8-bit microcontroller
● USB or plug-in power
● Arduino-compatible I/O; can plug in additional “shields”
● Ability to run Arduino sketches without any additional software installation
● Low-low price of ~$25
Arduino Uno: What Does It NOT Have?
The Arduino Uno does not have one of everything. Some things
you can add, and some things you have to live without:
● Networking capability
● Multi-computing
● Native graphics or sound
capability
● Case
● Huge Processing Power
● Full-blown O/S
Arduino Uno: Required Equipment
● Arduino Uno ($25)
● USB A/B (male / male) cable
● 9V or 12V, center-pin-positive,
500mA (or more) power
supply (optional)
Electronics Mini-Lesson #1: Voltage, Current,
Power, and Charge
Direct-Current electricity has 4 dimensions:
● Voltage: How Hard The Electricity is Pushing
– measured in Volts, or V (also mV)
● Current: How Much Electricity is Flowing Right Now
– measured in Amperes, or Amps, or A (also mA)
● Power: How Much Work Electricity is Doing Right Now
– measured in Watts, or W (also mW, kW, MW, etc.)
● Charge: How Much Electricity There Is
– measured in Coulombs, or more usefully, Amp-Hours
(also mAh)
Electronics Mini-Lesson #1: Voltage, Current,
Power, and Charge
● What we call a power supply is a constant-voltage
source
– That is, a power supply will deliver its rated output
voltage up to its rated current output
– So, a 19.5V power supply, rated for 6.7A of output, can
deliver up to and including 6.7A without ill effect
Electronics Mini-Lesson #1: Voltage, Current,
Power, and Charge
● Power supplies can also deliver less than their rated
current output!
– They only deliver the current that the circuit “needs”
(more on this later)
– But, they always deliver the voltage that they are rated
for (unless they are overloaded)
● So, you can use a power supply rated for more current
than you need
● BUT, DO NOT use a power supply rated for more Voltage
than you need!
Electronics Mini-Lesson #1: Voltage, Current,
Power, and Charge
Electrical Power is always calculated by this formula:
Power = Voltage x Current
Or, if you prefer:
Watts = Volts x Amps
So, if you know the voltage and the current, you know the
power being delivered. Back to our earlier example, the
6.7A @ 19.5V power supply is capable of delivering:
19.5V x 6.7A = 130W
Electronics Mini-Lesson #1: Voltage, Current,
Power, and Charge
● Batteries, as far as circuits are concerned, work the same
as power supplies
– A battery will deliver its rated voltage up to its rated
current, though battery manufacturers do not always
tell you the rated current
● The biggest difference is that you also have to worry about
the charge of a battery, which you do not have to worry
about with a power supply
– A battery with a greater charge capacity (in amp-
hours, or Ah) will “last” longer between chargings
Arduino Uno: Optional Equipment
● breadboard ($5, but get 2, or 1 big one)
● Single Pole/Single Throw
Normally Open Switch ($2)
● 1kΩ resistors ($1)
Arduino Uno: Optional Equipment
● LED Assortment ($6)
● Male-to-Male Jumpers ($8)
● 1MΩ Potentiometers ($3)
Install Arduino IDE
● Download and install Arduino IDE for your OS
– https://www.arduino.cc/en/Guide/HomePage
● Follow instructions to “Install the board drivers”:
– https://www.arduino.cc/en/Guide/ArduinoUno
– And, from the same page, “Select your board type and
port”
● Sample code to get started:
– https://www.arduino.cc/en/Tutorial/BuiltInExamples
Hardware Building Blocks
● We will going to focus the rest of this presentation on using
the Arduino Uno as the basis of a hardware project
● This will take the form of the “Four Building Blocks” of
physical computing:
– Digital Output
– Digital Input
– Analog Output
– Analog Input
Hardware 100 – Blink an LED
● Before that, let's make sure the darn thing turn on
● Making sure you can get an LED to blink should always be
the first thing you do with any new hardware project
– It's the “Hello World” of hardware
blinkOneLED
● Wire the green LED up like this:
I/O 3
1kΩ
blinkOneLED
● Physically, it will look something like this:
Demonstration: blinkOneLED
● Let's make sure everything works!
Electronics Mini-Lesson #2: Circuits, Open
Circuits, and Short Circuits
First, some terminology.
This is a circuit diagram:
+
_Vin
Voltage Source
Load
(resistor)
+
_
Current
Electronics Mini-Lesson #2: Circuits, Open
Circuits, and Short Circuits
● Current flows out of the positive (+) terminal of the Voltage
Source, through the circuit, and into the (-) terminal of the
Voltage Source
● The amount of current that flows is given by Ohm's Law:
● Where E is Voltage, I is current, and R is the Resistance of
the load, in Ohms (Ω)
● Current I can also be express as:
E = I x R
I =
E
R
Electronics Mini-Lesson #2: Circuits, Open
Circuits, and Short Circuits
● So, for example, if Vin were 3.3V, and the load was 1kΩ,
the current in this circuit would be 3.3V / 1000Ω = 3.3 mA
● What if we were to take the load out of the circuit?
+
_Vin
Electronics Mini-Lesson #2: Circuits, Open
Circuits, and Short Circuits
● In this case, current cannot flow, because there is no
electrical path from the positive terminal of the voltage
source to the negative one.
● This is called an open circuit.
● Think of it as an infinite-resistance load.
– So, 3.3V / ∞Ω = 0A
● But what happens if we replace the load resistor with a
wire?
Electronics Mini-Lesson #2: Circuits, Open
Circuits, and Short Circuits
+
_Vin
Current?
● Wires have a resistance of 0Ω
● So, the current through the system is: 3.3V / 0Ω
● That would be infinite current, if the voltage source could
supply infinite current!
Electronics Mini-Lesson #2: Circuits, Open
Circuits, and Short Circuits
● Instead, the voltage source will attempt to supply as much
current as it can – enough to trip a circuit breaker, or more
likely, burn up a wire, or the voltage source itself
● This is called a short circuit
● Do not wire up a short circuit! That's how you burn up
components, and destroy circuit boards
Electronics Mini-Lesson #3: GND and Vin
Second, some shorthand.
This takes time to draw:
+
_Vin
Electronics Mini-Lesson #3: GND and Vin
● So, we will use two convenient shorthands.
● The positive terminal of the voltage source, and anything
connected to it, we call Vin, or we just name it whatever
the input voltage is (such as 3.3V)
● We denote it with this symbol:
● The negative terminal of the voltage source, and anything
connected to it, we call GND (“ground”).
● We denote GND with this symbol:
Vin
Electronics Mini-Lesson #3: GND and Vin
So:
+
_Vin
Vin
==
Electronics Mini-Lesson #4: Breadboards
● Breadboards are useful for wiring up circuit prototypes
without soldering
● There are different types, but they mostly look something
like this:
● The magic of a breadboard is that you can plug one wire
into one hole, and have it be electrically connected to
another wire plugged into another hole
Electronics Mini-Lesson #4: Breadboards
● The electrical connections are arranged like so:
● It is helpful to plug Vin into the + rail, and GND into the – rail
● On either side of the channel are 5 pins all connected to
each other
Electronics Mini-Lesson #4: Breadboards
● Breadboards cannot carry infinite current without burning
up!
– If your circuit needs to carry more than about 500mA, I
recommend not using a breadboard and jumpers: get
some thicker-gauge, dedicated wires
● Breadboards cannot handle infinite voltage without arcing
internally!
– If your circuit needs to deliver more than about 24V, I
recommend not using a breadboard and jumpers: get
some wires with thicker insulation
● These numbers give a wide safety margin
Electronics Mini-Lesson #5: LEDs
● “LED” stands for “Light Emitting Diode”
● They do not behave like resistors! We can model them
like this:
+
_VD
RD
Electronics Mini-Lesson #5: LEDs
● VD
is around 1.8V, while RD
is not very much – on the order
of 2Ω or so
● So, if you were to attach a 3.3V voltage source directly to
the LED, you would get:
● This might not sound like much, but the output pins of the
Arduino Uno can only output about 40mA or so apiece– if
you were to “ask” them for 750mA, it could shut down or
even damage the Arduino Uno
(3.3V – 1.8V) / 2Ω = 750mA
Electronics Mini-Lesson #5: LEDs
● This is why each LED needs a 1kΩ resistor in series with
it: Vin
1kΩ
● If the LED is too dim, try a 470Ω resistor
● If the LED is too bright, try a 2kΩ resistor
Electronics Mini-Lesson #5: LEDs
● Finally, LEDs are diodes, and the magic of a diode is that
they only allow current to flow in one direction
● The flat part of the diode bulb, or the shorter of the two
legs, should be oriented towards GND
● See http://media.bemyapp.com/control-led-lights/
digitalOutputs.py
● Wire the green, yellow, and red LED up like this:
I/O 3
1kΩ
I/O 5
1kΩ
I/O 6
1kΩ
digitalOutputs
● Physically, it will look something like this:
Demonstration: digitalOutputs
● Prepare to have your mind BLOWN!
● What it does: lights up a series of LEDs, one at a time, in
round robin fashion
● The Magic:
– Set LED pin mode to OUTPUT: we’re sending signals out
to the LEDs, not receiving from them
– Set digital write to HIGH to turn LED on
– Set digital write to LOW to turn LED off
– State is whether LED is currently on or off
– Check state of current LED in loop to determine which
LEDs need to be turned off/on
digitalInput
● Leaving the LEDs in place, wire the switch like this:
I/O 12
This is a single-throw switch. It
only has one position in which
the circuit is completed. For a
“normally open” switch, the
connection to GND will be
made when you close the
switch (press the button)
digitalInput
● Physically, it will look something like this:
Electronics Mini-Lesson #6: Pull-Ups / Pull-
Downs
When the switch is closed, the circuit will look like this:
Now, the I/O pin is connected to
GND, which the Arduino Uno will
read as “LOW.”
I/O 12
Electronics Mini-Lesson #6: Pull-Ups / Pull-
Downs
What is I/O 12 connected to when the switch is open?
● It's not connected to LOW anymore, but
it's also not connected to HIGH
● A digital input only has two options, so
the Arduino Uno must read it as LOW or
HIGH, but you don't know which one it
will “pick”
● This is called a “floating input,” and it is
bad, because you never know what
you're going to get!
I/O 12
Electronics Mini-Lesson #6: Pull-Ups / Pull-
Downs
● We can avoid floating inputs with “pull-up” and “pull-down”
resistors
● A pull-up will leave the input pin to read HIGH in the
absence of any other connection, while a pull-down will
leave a floating input to read LOW
● The Arduino Uno can implement pull-ups (but NOT pull-
downs) in code, as you will see
● Double-throw switches may not actually need pull-ups or
pull-downs, but it won't hurt anything if you implement
them anyway
I/O 12
Vin
Demonstration: digitalInput
● Pretty much the same as digitalOutputs, until you press the button
● What it does: Light up a series of LEDs, one at a time, in round robin
robin. Press a button to make the LEDs light up in the opposite
direction and at a faster speed.
● The Magic:
– Same concepts as digitalOutputs, but this time uses an array of LED
pins
– For each LED pin in array, turns LED on, pauses, turns LED off
– If button is not pressed, continue moving “forward” in turning LEDs
on / off
– If button is pressed, move backwards to turn LEDs on /off
analogOutputs
● Wire the green, yellow, and red LED up like this:
(same as digitalOutputs)
I/O 3
1kΩ
I/O 5
1kΩ
I/O 6
1kΩ
Arduino Uno I/O
By the way, why did we pick pins 3, 5, and 6,
of all the pins that we could have picked?
Because those pins are 3 of the Input / Output pins that
can also act as analog outputs (PWMs)
These pins are denoted by the ~ symbol
Electronics Mini-Lesson #7: Pulse Width
Modulation
● Because of the nature of field-effect transistors, digital
outputs – either HIGH or LOW – are easy for a computer
to generate
● Analog outputs, which may have a value between HIGH
and LOW – say, 1.7V, or 2.2V, or 3.1V – are NOT easy to
generate
● However, since we mostly only need analog outputs for
physical devices, which cannot instantly turn on and off,
we can simulate an analog input by rapidly turning a digital
signal off and on, and varying the percentage of time the
signal is “on”
Electronics Mini-Lesson #7: Pulse Width
Modulation
0V
3.3V
0
m
s
1
m
s
2
m
s
3
m
s
4
m
s
5
m
s
A 1kHz waveform, “off” for 50% of the time, and “on”
for 50% of the time.
The “duty cyle” is 50%.
The output voltage is effectively half of the maximum,
or 1.65V
Electronics Mini-Lesson #7: Pulse Width
Modulation
0V
3.3V
0
m
s
1
m
s
2
m
s
3
m
s
4
m
s
5
m
s
This 1kHz waveform is “off” for 75% of the time, and
“on” for 25% of the time.
The “duty cyle” is 25%.
The output voltage is effectively one-quarter of the
maximum, or .825V
Electronics Mini-Lesson #7: Pulse Width
Modulation
0V
3.3V
0
m
s
1
m
s
2
m
s
3
m
s
4
m
s
5
m
s
This 1kHz waveform is “off” for 25% of the time, and
“on” for 75% of the time.
The “duty cyle” is 75%.
The output voltage is effectively three-quarters of the
maximum, or 2.48V
Electronics Mini-Lesson #7: Pulse Width
Modulation
● This seems stupid, but it actually works very well for a
variety of applications
– Your car's fuel injectors
– Throttling the electric motors in a quadcopter
– Anti-lock brakes
● A PWM signal has two properties: the frequency and the
duty cycle
– The frequency should be fast enough that whatever
you're driving operates smoothly, and slow enough to
avoid high-frequency impedence
Electronics Mini-Lesson #7: Pulse Width
Modulation
● The PWM pins on the Arduino Uno are either 980 Hz (pins
5 and 6), or 490 Hz (pins 3, 9, 10, and 11)
– Both of these frequencies are much too fast for the eye
to notice an LED flickering
● The duty cycle can be anywhere between 0 (0%) and 255
(100%)
– If you want a percentage duty cycle, you must multiply
by 255 and divide by 100 to set the PWM
Demonstration: analogOutputs
● Behold the wonders of Pulse Width Modulation!
● What It Does: Lights up a group of LEDs all at once, at
different intervals/steps, from dimmest to brightest and
back to dim again
● The Magic:
– Instead of just turning on the LEDs all the way on or all
the way off, analog output lets us light up the LED
within a range of dimmer settings
– The settings are in large intervals/steps
Demonstration: analogOutputPulse
● This program shows what's possible with small changes in
PWM duty cycle
● What It Does: Gradually lights up a group of LEDs all at
once, from dimmest to brightest and back to dim again
● The Magic:
● Much like analogOutputs, except with PWM, the dimmer
settings can be much smaller intervals / steps
● Changes in the dim settings can be much more gradual
analogInput
● Finally, we have analog inputs
● Many times you wish to know not merely whether
something is happening, but how much it is happening
● Many sensors – temperature sensors, light sensors,
pressure sensors, etc. – will deliver an output voltage as a
reaction to whatever they're sensing
● We will model this voltage with a potentiometer (variable
resistor)
analogInput
● Wire the green, yellow, and red LED up like this:
(same as digitalOutputs)
I/O 3
1kΩ
I/O 5
1kΩ
I/O 6
1kΩ
analogInput
● And, wire the potentiometer up like this:
+5V
10MΩ A0
The end terminals can be wired
up in any direction, but the center
terminal should point to the analog
input pin
analogInput
● Physically, it will look something like this:
Demonstration: analogInput
● This program converts an analog input into an LED
readout of sorts
Demonstration: analogInput
● This effect would require a somewhat complicated circuit
to implement if we weren't using the microcontroller
● What It Does: Gradually light up each LED, one at a time,
as we turn up the knob on the potentiometer, and then
gradually dim each LED, one at a time, as we turn down
the knob on the potentiometer.
● The Magic:
– Cycling through an array of LEDs, based on the value
of the potentiometer, turn the current LED all the way
on, all the way off, or somewhere in between
– The “in between” is the analog value
Where to go from Here?
● https://github.com/vuinguyen/ArduinoUnoBasics
● What types of projects would you like to build?
● Interest in hands-on workshop?
– For nominal fee through GDI (‘cause these workshops take a lot of
work to create!)
– We can help you build that cool thing you’ve been wanting to build
– Sign up for our email list to give us input
● Educators
– We can help you create a course for your students – just ask us!
● Please take our survey by Friday, September 22:
https://goo.gl/forms/7dn6avLltAg28StD2
The End
Thanks for Coming!
https://github.com/vuinguyen/ArduinoUnoBasics
Sunfishempire.com
@sunfishgurl
@infoGuideApps

More Related Content

What's hot

Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
INTERFACING WITH INTEL 8251A (USART)
INTERFACING WITH INTEL 8251A (USART)INTERFACING WITH INTEL 8251A (USART)
INTERFACING WITH INTEL 8251A (USART)Prof Ansari
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriGaurav Pandey
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to ArduinoOmer Kilic
 
Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer Bharti Airtel Ltd.
 
NAND and NOR implementation and Other two level implementation
NAND and NOR implementation and  Other two level implementationNAND and NOR implementation and  Other two level implementation
NAND and NOR implementation and Other two level implementationMuhammad Akhtar
 
Arduino slides
Arduino slidesArduino slides
Arduino slidessdcharle
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduinoavikdhupar
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingEmmanuel Obot
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modellingVandanaPagar1
 
Encoder and decoder
Encoder and decoderEncoder and decoder
Encoder and decoderAbid Ali
 
Introduction to Arduino.pptx
Introduction to Arduino.pptxIntroduction to Arduino.pptx
Introduction to Arduino.pptxAkshat Bijronia
 

What's hot (20)

Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
Arduino
ArduinoArduino
Arduino
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
INTERFACING WITH INTEL 8251A (USART)
INTERFACING WITH INTEL 8251A (USART)INTERFACING WITH INTEL 8251A (USART)
INTERFACING WITH INTEL 8251A (USART)
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer
 
NAND and NOR implementation and Other two level implementation
NAND and NOR implementation and  Other two level implementationNAND and NOR implementation and  Other two level implementation
NAND and NOR implementation and Other two level implementation
 
Arduino IDE
Arduino IDE Arduino IDE
Arduino IDE
 
Multiplexers & Demultiplexers
Multiplexers & DemultiplexersMultiplexers & Demultiplexers
Multiplexers & Demultiplexers
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
 
Logic gates
Logic gatesLogic gates
Logic gates
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
Encoder and decoder
Encoder and decoderEncoder and decoder
Encoder and decoder
 
Introduction to Arduino.pptx
Introduction to Arduino.pptxIntroduction to Arduino.pptx
Introduction to Arduino.pptx
 

Similar to Getting Started with Arduino: A Beginner's Guide to the Arduino Uno

Arduino Introduction Guide 1
Arduino Introduction Guide 1Arduino Introduction Guide 1
Arduino Introduction Guide 1elketeaches
 
Arduino obstacle avoidance robot
Arduino obstacle avoidance robotArduino obstacle avoidance robot
Arduino obstacle avoidance robotSteven Radigan
 
arduino
 arduino arduino
arduinojhcid
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1Felipe Belarmino
 
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004DO!MAKERS
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slidesmkarlin14
 
295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lightsMaheshSrinivasan25
 
Robotics and Embedded Systems
Robotics and Embedded SystemsRobotics and Embedded Systems
Robotics and Embedded SystemsAnkan Naskar
 
Building Connected IoT Gadgets with Particle.io & Azure
Building Connected IoT Gadgets with Particle.io & AzureBuilding Connected IoT Gadgets with Particle.io & Azure
Building Connected IoT Gadgets with Particle.io & AzureNick Landry
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixelssdcharle
 
ArduinoSectionI-slides.ppt
ArduinoSectionI-slides.pptArduinoSectionI-slides.ppt
ArduinoSectionI-slides.pptLam Hung
 
computer system Architecture (Food detector)
computer system Architecture (Food detector)computer system Architecture (Food detector)
computer system Architecture (Food detector)Mehul Boghra
 
Arduino plus Delphi Mobile Apps - Beyond Basics
Arduino plus Delphi Mobile Apps - Beyond BasicsArduino plus Delphi Mobile Apps - Beyond Basics
Arduino plus Delphi Mobile Apps - Beyond BasicsVic Fernandes
 
The Last Great Hardware Show
The Last Great Hardware ShowThe Last Great Hardware Show
The Last Great Hardware ShowDave Appleton
 

Similar to Getting Started with Arduino: A Beginner's Guide to the Arduino Uno (20)

Arduino Introduction Guide 1
Arduino Introduction Guide 1Arduino Introduction Guide 1
Arduino Introduction Guide 1
 
Instructor background
Instructor backgroundInstructor background
Instructor background
 
Arduino obstacle avoidance robot
Arduino obstacle avoidance robotArduino obstacle avoidance robot
Arduino obstacle avoidance robot
 
Presentation S4A
Presentation S4A Presentation S4A
Presentation S4A
 
Presentation
PresentationPresentation
Presentation
 
arduino
 arduino arduino
arduino
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1
 
Fun with Circuitry and Electronics
Fun with Circuitry and ElectronicsFun with Circuitry and Electronics
Fun with Circuitry and Electronics
 
Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011Arduino Comic-Jody Culkin-2011
Arduino Comic-Jody Culkin-2011
 
Arduino comic v0004
Arduino comic v0004Arduino comic v0004
Arduino comic v0004
 
Intro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptxIntro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptx
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights295889096 music-reactive-multicolor-led-lights
295889096 music-reactive-multicolor-led-lights
 
Robotics and Embedded Systems
Robotics and Embedded SystemsRobotics and Embedded Systems
Robotics and Embedded Systems
 
Building Connected IoT Gadgets with Particle.io & Azure
Building Connected IoT Gadgets with Particle.io & AzureBuilding Connected IoT Gadgets with Particle.io & Azure
Building Connected IoT Gadgets with Particle.io & Azure
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
ArduinoSectionI-slides.ppt
ArduinoSectionI-slides.pptArduinoSectionI-slides.ppt
ArduinoSectionI-slides.ppt
 
computer system Architecture (Food detector)
computer system Architecture (Food detector)computer system Architecture (Food detector)
computer system Architecture (Food detector)
 
Arduino plus Delphi Mobile Apps - Beyond Basics
Arduino plus Delphi Mobile Apps - Beyond BasicsArduino plus Delphi Mobile Apps - Beyond Basics
Arduino plus Delphi Mobile Apps - Beyond Basics
 
The Last Great Hardware Show
The Last Great Hardware ShowThe Last Great Hardware Show
The Last Great Hardware Show
 

Recently uploaded

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Getting Started with Arduino: A Beginner's Guide to the Arduino Uno

  • 1. Getting Started with the Arduino Uno by Eric J. Richardson and Vui Nguyen September 2017
  • 2. Legal Disclaimer Arduino is a trademark of somebody, certainly But not us
  • 3. Why this Presentation? ● Last year, we started doing IoT when we entered the Intel IoT Roadshow ●“Save the Water Pipes” was an automated faucet dripper – handy to prevent pipes from freezing and breaking in cold climates like Colorado! ● Vui: software architect ● Eric: hardware engineer ● Crystal: web developer
  • 4. Why this Presentation? ●We entered our project in the US-China Young Maker Competition (Sponsored by Intel) and competed in China! ● Vui presented our “Save the Water Pipes” project to Women Who Code ● Several of the Women Who Code had questions about the Intel Edison board which powered our project
  • 5. Why this Presentation? ● There was a lot of interest in the Intel Edison ● The Edison is cool, but at $100 it’s a bit pricey to get started with an embedded computing project ● so Eric did a follow up presentation at WWC on the Raspberry Pi ● Why the Raspberry Pi?
  • 6. Why this Presentation? ● Raspberry Pi is a great value, single-board computer, and can be used as the basis for many projects ● At Raspberry Pi presentation, Eric also provided a good overview of electronics and hardware concepts ● But there is a lot of setup with Raspberry Pi just to get started ● With Arduino Uno, you could get up and running much more quickly, for as much money, with less equipment and setup
  • 7. Who is this Presentation For? ● This presentation is for software devs interested in learning about hardware ● You should, by the end, know enough to get an Arduino Uno up and running, and writing Arduino sketches ● And, hopefully, driving electronic circuits ● We hope that we cover at least one thing you already know, and at least one thing you don't ● If you have a question about something, please ask! We may wave it off as something we cover later
  • 8. Personal Disclaimer For those of you who are already familiar with all of this, Eric apologizes if he sounds like he's “mansplaining”! He now has Vui co-presenting to help with this.
  • 9. Who Are We? Eric J. Richardson Lockheed Martin Systems Engineer Colorado State University B.S. Electrical & Computer Engineering, 2004 LIKES: DISLIKES: ● Antique Cars ● Dogs ● Shadowrun ● Cajun Food ● Old Video Games ● Hand Tools ● Cool Boots ● Cancer ● Fascism ● Lasagna ● TV Commercials Which Assume I'm Familiar with Sports Stars
  • 10. Who Are We? Vui Nguyen SimplyE iOS Developer Colorado School of Mines B.S. Computer Science, 1999 University of Denver M.S. Computer Science, 2006 LIKES: DISLIKES: ● Fishing ● Eating ● Fishing ● Traveling ● Fishing ● Dogs ● Fishing ● Not Fishing Enough ● Sexism ● Doing Dishes ● Negativity ● Being asked, “Where are you from?”
  • 11. Who Are We Not? ● We are not graphic artists! ● We are not full-fledged Arduino experts! ● We fully expect someone here to ask us a question we don't know the answer to
  • 12. What is “Arduino”? ● 3 things: – Arduino is an Italian company that designs low-cost computers designed to interact with physical hardware ● These are open-source hardware designs – “Arduino-compatible” boards have special I/O ports that allow the boards to be expanded with plugin-in modules called shields – It’s also the Arduino-specific programming language (based on C++) and IDE ● We will be working with the Arduino Uno board
  • 13. Arduino Uno: What Does It Have? Arduino Uno ● 14 Digital Input / Output pins (6 of these can be used as Analog outputs) ● 6 Analog inputs ● Atmel 8-bit microcontroller ● USB or plug-in power ● Arduino-compatible I/O; can plug in additional “shields” ● Ability to run Arduino sketches without any additional software installation ● Low-low price of ~$25
  • 14. Arduino Uno: What Does It NOT Have? The Arduino Uno does not have one of everything. Some things you can add, and some things you have to live without: ● Networking capability ● Multi-computing ● Native graphics or sound capability ● Case ● Huge Processing Power ● Full-blown O/S
  • 15. Arduino Uno: Required Equipment ● Arduino Uno ($25) ● USB A/B (male / male) cable ● 9V or 12V, center-pin-positive, 500mA (or more) power supply (optional)
  • 16. Electronics Mini-Lesson #1: Voltage, Current, Power, and Charge Direct-Current electricity has 4 dimensions: ● Voltage: How Hard The Electricity is Pushing – measured in Volts, or V (also mV) ● Current: How Much Electricity is Flowing Right Now – measured in Amperes, or Amps, or A (also mA) ● Power: How Much Work Electricity is Doing Right Now – measured in Watts, or W (also mW, kW, MW, etc.) ● Charge: How Much Electricity There Is – measured in Coulombs, or more usefully, Amp-Hours (also mAh)
  • 17. Electronics Mini-Lesson #1: Voltage, Current, Power, and Charge ● What we call a power supply is a constant-voltage source – That is, a power supply will deliver its rated output voltage up to its rated current output – So, a 19.5V power supply, rated for 6.7A of output, can deliver up to and including 6.7A without ill effect
  • 18. Electronics Mini-Lesson #1: Voltage, Current, Power, and Charge ● Power supplies can also deliver less than their rated current output! – They only deliver the current that the circuit “needs” (more on this later) – But, they always deliver the voltage that they are rated for (unless they are overloaded) ● So, you can use a power supply rated for more current than you need ● BUT, DO NOT use a power supply rated for more Voltage than you need!
  • 19. Electronics Mini-Lesson #1: Voltage, Current, Power, and Charge Electrical Power is always calculated by this formula: Power = Voltage x Current Or, if you prefer: Watts = Volts x Amps So, if you know the voltage and the current, you know the power being delivered. Back to our earlier example, the 6.7A @ 19.5V power supply is capable of delivering: 19.5V x 6.7A = 130W
  • 20. Electronics Mini-Lesson #1: Voltage, Current, Power, and Charge ● Batteries, as far as circuits are concerned, work the same as power supplies – A battery will deliver its rated voltage up to its rated current, though battery manufacturers do not always tell you the rated current ● The biggest difference is that you also have to worry about the charge of a battery, which you do not have to worry about with a power supply – A battery with a greater charge capacity (in amp- hours, or Ah) will “last” longer between chargings
  • 21. Arduino Uno: Optional Equipment ● breadboard ($5, but get 2, or 1 big one) ● Single Pole/Single Throw Normally Open Switch ($2) ● 1kΩ resistors ($1)
  • 22. Arduino Uno: Optional Equipment ● LED Assortment ($6) ● Male-to-Male Jumpers ($8) ● 1MΩ Potentiometers ($3)
  • 23. Install Arduino IDE ● Download and install Arduino IDE for your OS – https://www.arduino.cc/en/Guide/HomePage ● Follow instructions to “Install the board drivers”: – https://www.arduino.cc/en/Guide/ArduinoUno – And, from the same page, “Select your board type and port” ● Sample code to get started: – https://www.arduino.cc/en/Tutorial/BuiltInExamples
  • 24. Hardware Building Blocks ● We will going to focus the rest of this presentation on using the Arduino Uno as the basis of a hardware project ● This will take the form of the “Four Building Blocks” of physical computing: – Digital Output – Digital Input – Analog Output – Analog Input
  • 25. Hardware 100 – Blink an LED ● Before that, let's make sure the darn thing turn on ● Making sure you can get an LED to blink should always be the first thing you do with any new hardware project – It's the “Hello World” of hardware
  • 26. blinkOneLED ● Wire the green LED up like this: I/O 3 1kΩ
  • 27. blinkOneLED ● Physically, it will look something like this:
  • 28. Demonstration: blinkOneLED ● Let's make sure everything works!
  • 29. Electronics Mini-Lesson #2: Circuits, Open Circuits, and Short Circuits First, some terminology. This is a circuit diagram: + _Vin Voltage Source Load (resistor) + _ Current
  • 30. Electronics Mini-Lesson #2: Circuits, Open Circuits, and Short Circuits ● Current flows out of the positive (+) terminal of the Voltage Source, through the circuit, and into the (-) terminal of the Voltage Source ● The amount of current that flows is given by Ohm's Law: ● Where E is Voltage, I is current, and R is the Resistance of the load, in Ohms (Ω) ● Current I can also be express as: E = I x R I = E R
  • 31. Electronics Mini-Lesson #2: Circuits, Open Circuits, and Short Circuits ● So, for example, if Vin were 3.3V, and the load was 1kΩ, the current in this circuit would be 3.3V / 1000Ω = 3.3 mA ● What if we were to take the load out of the circuit? + _Vin
  • 32. Electronics Mini-Lesson #2: Circuits, Open Circuits, and Short Circuits ● In this case, current cannot flow, because there is no electrical path from the positive terminal of the voltage source to the negative one. ● This is called an open circuit. ● Think of it as an infinite-resistance load. – So, 3.3V / ∞Ω = 0A ● But what happens if we replace the load resistor with a wire?
  • 33. Electronics Mini-Lesson #2: Circuits, Open Circuits, and Short Circuits + _Vin Current? ● Wires have a resistance of 0Ω ● So, the current through the system is: 3.3V / 0Ω ● That would be infinite current, if the voltage source could supply infinite current!
  • 34. Electronics Mini-Lesson #2: Circuits, Open Circuits, and Short Circuits ● Instead, the voltage source will attempt to supply as much current as it can – enough to trip a circuit breaker, or more likely, burn up a wire, or the voltage source itself ● This is called a short circuit ● Do not wire up a short circuit! That's how you burn up components, and destroy circuit boards
  • 35. Electronics Mini-Lesson #3: GND and Vin Second, some shorthand. This takes time to draw: + _Vin
  • 36. Electronics Mini-Lesson #3: GND and Vin ● So, we will use two convenient shorthands. ● The positive terminal of the voltage source, and anything connected to it, we call Vin, or we just name it whatever the input voltage is (such as 3.3V) ● We denote it with this symbol: ● The negative terminal of the voltage source, and anything connected to it, we call GND (“ground”). ● We denote GND with this symbol: Vin
  • 37. Electronics Mini-Lesson #3: GND and Vin So: + _Vin Vin ==
  • 38. Electronics Mini-Lesson #4: Breadboards ● Breadboards are useful for wiring up circuit prototypes without soldering ● There are different types, but they mostly look something like this: ● The magic of a breadboard is that you can plug one wire into one hole, and have it be electrically connected to another wire plugged into another hole
  • 39. Electronics Mini-Lesson #4: Breadboards ● The electrical connections are arranged like so: ● It is helpful to plug Vin into the + rail, and GND into the – rail ● On either side of the channel are 5 pins all connected to each other
  • 40. Electronics Mini-Lesson #4: Breadboards ● Breadboards cannot carry infinite current without burning up! – If your circuit needs to carry more than about 500mA, I recommend not using a breadboard and jumpers: get some thicker-gauge, dedicated wires ● Breadboards cannot handle infinite voltage without arcing internally! – If your circuit needs to deliver more than about 24V, I recommend not using a breadboard and jumpers: get some wires with thicker insulation ● These numbers give a wide safety margin
  • 41. Electronics Mini-Lesson #5: LEDs ● “LED” stands for “Light Emitting Diode” ● They do not behave like resistors! We can model them like this: + _VD RD
  • 42. Electronics Mini-Lesson #5: LEDs ● VD is around 1.8V, while RD is not very much – on the order of 2Ω or so ● So, if you were to attach a 3.3V voltage source directly to the LED, you would get: ● This might not sound like much, but the output pins of the Arduino Uno can only output about 40mA or so apiece– if you were to “ask” them for 750mA, it could shut down or even damage the Arduino Uno (3.3V – 1.8V) / 2Ω = 750mA
  • 43. Electronics Mini-Lesson #5: LEDs ● This is why each LED needs a 1kΩ resistor in series with it: Vin 1kΩ ● If the LED is too dim, try a 470Ω resistor ● If the LED is too bright, try a 2kΩ resistor
  • 44. Electronics Mini-Lesson #5: LEDs ● Finally, LEDs are diodes, and the magic of a diode is that they only allow current to flow in one direction ● The flat part of the diode bulb, or the shorter of the two legs, should be oriented towards GND ● See http://media.bemyapp.com/control-led-lights/
  • 45. digitalOutputs.py ● Wire the green, yellow, and red LED up like this: I/O 3 1kΩ I/O 5 1kΩ I/O 6 1kΩ
  • 46. digitalOutputs ● Physically, it will look something like this:
  • 47. Demonstration: digitalOutputs ● Prepare to have your mind BLOWN! ● What it does: lights up a series of LEDs, one at a time, in round robin fashion ● The Magic: – Set LED pin mode to OUTPUT: we’re sending signals out to the LEDs, not receiving from them – Set digital write to HIGH to turn LED on – Set digital write to LOW to turn LED off – State is whether LED is currently on or off – Check state of current LED in loop to determine which LEDs need to be turned off/on
  • 48. digitalInput ● Leaving the LEDs in place, wire the switch like this: I/O 12 This is a single-throw switch. It only has one position in which the circuit is completed. For a “normally open” switch, the connection to GND will be made when you close the switch (press the button)
  • 49. digitalInput ● Physically, it will look something like this:
  • 50. Electronics Mini-Lesson #6: Pull-Ups / Pull- Downs When the switch is closed, the circuit will look like this: Now, the I/O pin is connected to GND, which the Arduino Uno will read as “LOW.” I/O 12
  • 51. Electronics Mini-Lesson #6: Pull-Ups / Pull- Downs What is I/O 12 connected to when the switch is open? ● It's not connected to LOW anymore, but it's also not connected to HIGH ● A digital input only has two options, so the Arduino Uno must read it as LOW or HIGH, but you don't know which one it will “pick” ● This is called a “floating input,” and it is bad, because you never know what you're going to get! I/O 12
  • 52. Electronics Mini-Lesson #6: Pull-Ups / Pull- Downs ● We can avoid floating inputs with “pull-up” and “pull-down” resistors ● A pull-up will leave the input pin to read HIGH in the absence of any other connection, while a pull-down will leave a floating input to read LOW ● The Arduino Uno can implement pull-ups (but NOT pull- downs) in code, as you will see ● Double-throw switches may not actually need pull-ups or pull-downs, but it won't hurt anything if you implement them anyway I/O 12 Vin
  • 53. Demonstration: digitalInput ● Pretty much the same as digitalOutputs, until you press the button ● What it does: Light up a series of LEDs, one at a time, in round robin robin. Press a button to make the LEDs light up in the opposite direction and at a faster speed. ● The Magic: – Same concepts as digitalOutputs, but this time uses an array of LED pins – For each LED pin in array, turns LED on, pauses, turns LED off – If button is not pressed, continue moving “forward” in turning LEDs on / off – If button is pressed, move backwards to turn LEDs on /off
  • 54. analogOutputs ● Wire the green, yellow, and red LED up like this: (same as digitalOutputs) I/O 3 1kΩ I/O 5 1kΩ I/O 6 1kΩ
  • 55. Arduino Uno I/O By the way, why did we pick pins 3, 5, and 6, of all the pins that we could have picked? Because those pins are 3 of the Input / Output pins that can also act as analog outputs (PWMs) These pins are denoted by the ~ symbol
  • 56. Electronics Mini-Lesson #7: Pulse Width Modulation ● Because of the nature of field-effect transistors, digital outputs – either HIGH or LOW – are easy for a computer to generate ● Analog outputs, which may have a value between HIGH and LOW – say, 1.7V, or 2.2V, or 3.1V – are NOT easy to generate ● However, since we mostly only need analog outputs for physical devices, which cannot instantly turn on and off, we can simulate an analog input by rapidly turning a digital signal off and on, and varying the percentage of time the signal is “on”
  • 57. Electronics Mini-Lesson #7: Pulse Width Modulation 0V 3.3V 0 m s 1 m s 2 m s 3 m s 4 m s 5 m s A 1kHz waveform, “off” for 50% of the time, and “on” for 50% of the time. The “duty cyle” is 50%. The output voltage is effectively half of the maximum, or 1.65V
  • 58. Electronics Mini-Lesson #7: Pulse Width Modulation 0V 3.3V 0 m s 1 m s 2 m s 3 m s 4 m s 5 m s This 1kHz waveform is “off” for 75% of the time, and “on” for 25% of the time. The “duty cyle” is 25%. The output voltage is effectively one-quarter of the maximum, or .825V
  • 59. Electronics Mini-Lesson #7: Pulse Width Modulation 0V 3.3V 0 m s 1 m s 2 m s 3 m s 4 m s 5 m s This 1kHz waveform is “off” for 25% of the time, and “on” for 75% of the time. The “duty cyle” is 75%. The output voltage is effectively three-quarters of the maximum, or 2.48V
  • 60. Electronics Mini-Lesson #7: Pulse Width Modulation ● This seems stupid, but it actually works very well for a variety of applications – Your car's fuel injectors – Throttling the electric motors in a quadcopter – Anti-lock brakes ● A PWM signal has two properties: the frequency and the duty cycle – The frequency should be fast enough that whatever you're driving operates smoothly, and slow enough to avoid high-frequency impedence
  • 61. Electronics Mini-Lesson #7: Pulse Width Modulation ● The PWM pins on the Arduino Uno are either 980 Hz (pins 5 and 6), or 490 Hz (pins 3, 9, 10, and 11) – Both of these frequencies are much too fast for the eye to notice an LED flickering ● The duty cycle can be anywhere between 0 (0%) and 255 (100%) – If you want a percentage duty cycle, you must multiply by 255 and divide by 100 to set the PWM
  • 62. Demonstration: analogOutputs ● Behold the wonders of Pulse Width Modulation! ● What It Does: Lights up a group of LEDs all at once, at different intervals/steps, from dimmest to brightest and back to dim again ● The Magic: – Instead of just turning on the LEDs all the way on or all the way off, analog output lets us light up the LED within a range of dimmer settings – The settings are in large intervals/steps
  • 63. Demonstration: analogOutputPulse ● This program shows what's possible with small changes in PWM duty cycle ● What It Does: Gradually lights up a group of LEDs all at once, from dimmest to brightest and back to dim again ● The Magic: ● Much like analogOutputs, except with PWM, the dimmer settings can be much smaller intervals / steps ● Changes in the dim settings can be much more gradual
  • 64. analogInput ● Finally, we have analog inputs ● Many times you wish to know not merely whether something is happening, but how much it is happening ● Many sensors – temperature sensors, light sensors, pressure sensors, etc. – will deliver an output voltage as a reaction to whatever they're sensing ● We will model this voltage with a potentiometer (variable resistor)
  • 65. analogInput ● Wire the green, yellow, and red LED up like this: (same as digitalOutputs) I/O 3 1kΩ I/O 5 1kΩ I/O 6 1kΩ
  • 66. analogInput ● And, wire the potentiometer up like this: +5V 10MΩ A0 The end terminals can be wired up in any direction, but the center terminal should point to the analog input pin
  • 67. analogInput ● Physically, it will look something like this:
  • 68. Demonstration: analogInput ● This program converts an analog input into an LED readout of sorts
  • 69. Demonstration: analogInput ● This effect would require a somewhat complicated circuit to implement if we weren't using the microcontroller ● What It Does: Gradually light up each LED, one at a time, as we turn up the knob on the potentiometer, and then gradually dim each LED, one at a time, as we turn down the knob on the potentiometer. ● The Magic: – Cycling through an array of LEDs, based on the value of the potentiometer, turn the current LED all the way on, all the way off, or somewhere in between – The “in between” is the analog value
  • 70. Where to go from Here? ● https://github.com/vuinguyen/ArduinoUnoBasics ● What types of projects would you like to build? ● Interest in hands-on workshop? – For nominal fee through GDI (‘cause these workshops take a lot of work to create!) – We can help you build that cool thing you’ve been wanting to build – Sign up for our email list to give us input ● Educators – We can help you create a course for your students – just ask us! ● Please take our survey by Friday, September 22: https://goo.gl/forms/7dn6avLltAg28StD2
  • 71. The End Thanks for Coming! https://github.com/vuinguyen/ArduinoUnoBasics Sunfishempire.com @sunfishgurl @infoGuideApps

Editor's Notes

  1. Vui
  2. Eric
  3. Vui
  4. Vui
  5. Eric
  6. Eric
  7. Eric
  8. Eric
  9. Vui
  10. Eric
  11. Eric
  12. Eric
  13. Eric
  14. Eric
  15. Eric
  16. Eric
  17. Eric
  18. Eric
  19. Eric
  20. Eric
  21. Eric
  22. Eric
  23. Vui
  24. Eric
  25. Eric
  26. Eric
  27. Eric
  28. Vui
  29. Eric
  30. Eric
  31. Eric
  32. Eric
  33. Eric
  34. Eric
  35. Eric
  36. Eric
  37. Eric
  38. Eric
  39. Eric
  40. Eric
  41. Eric
  42. Eric
  43. Eric
  44. Eric
  45. Eric
  46. Eric
  47. Vui Ask: would anyone like to provide a real-world example of a digital output?
  48. Eric
  49. Eric
  50. Eric
  51. Eric
  52. Eric
  53. Vui Ask: What’s a real-world example of a digital input?
  54. Eric
  55. Eric
  56. Eric
  57. Eric
  58. Eric
  59. Eric
  60. Eric
  61. Eric
  62. Vui
  63. Vui Ask: Any more real-world examples of analog outputs?
  64. Eric
  65. Eric
  66. Eric
  67. Eric
  68. Vui
  69. Vui Ask: Finally, any more real-world examples of analog inputs?
  70. Vui
  71. Vui & Eric!