Bionic Arduino Class1
Bionic Arduino Class1
Class 1
At worst, you’ll be able to fashion a convincing disguise from pasting Arduinos on your body.
Class Kit I Contents
There will be a second update kit next week: “motion & motors”
A Word on Safety
• Electronics can hurt you
• Lead in some of the parts
• Wash up afterwards
• You can hurt electronics
• Static-sensitive: don’t shuffle your feet & touch
• Wires only bend so much
What is Arduino?
The word “Arduino” can mean 3 things
• Community-built
• Examples wiki (the “playground”) editable by anyone
• Forums with lots of helpful people
Arduino Hardware
• Similar to Basic Stamp (if you know of it)
• but cheaper, faster, & open
The designer of the AVR purposefully arranged its registers and instruction set so that C programs
would compile efficiently on it. This is a big deal, compared to previous microcontrollers where C
programs were almost always less efficient than a hand-coded assembly language variant.
Arduino Hardware Variety
LilyPad
DIY
(for clothing)
USB
Boarduino Kit
“Stamp”-sized
Bluetooth
many different variations to suite your needs
Openness has its advantages, many different varieties.
Anyone can build an Arduino work-alike in any form-factor they want.
Product images from Sparkfun.com and Adafruit.com
Arduino Capabilities
• 16 kBytes of Flash program memory
• 1 kByte of RAM
Don’t worry if the above doesn’t make sense, you don’t really need to know it.
Arduino Diecimila Board
test LED digital input/output “pins”
on “pin” 13
power
LED
USB interface
2”
TX/RX
LEDs ATmega168 reset
button
• View/write/edit sketches
If you’ve used Processing to write little Java programs, you’ll notice the interface looks familiar.
Arduino takes the editor GUI from Processing and some of its philosophy, but Arduino code and
Processing code are totally unrelated.
Installing Arduino
The Steps
1. Get the Arduino software & unzip it
2. Plug in Arduino board
3. Install the driver
4. Reboot
5. Run the Arduino program
6. Tell Arduino (program) about Arduino (board)
Getting and Unpacking
• On the thumbdrives
• “arduino-0010-win.zip” for Windows
• “arduino-0010-mac.zip” for Mac OS X
• Unzip the zip file. Double-click on Mac
On Windows, right-click
Use “Extract All...”
usually highest-
numbered port
pick “Diecimila”
Selecting Location & Type
starts with
tty.usbserial-
pick “Diecimila”
Arduino Software
status
area
Using Arduino
• Write your sketch
Uploading worked
And all over the Net. Search for “Arduino tutorial” or “Arduino notes” or whatever you’re interested
in and “Arduino” and likely you’ll find some neat pages.
Take a Break
+
9V resistor
– 500 ohm
(green,brown,brown) 500
LED
(flat part)
All LED circuits are essentially this: power source, current limiter, LED
Flat part of LED goes to negative, like bar in schematic
The higher the resistance, the dimmer the LED; the lower, the brighter
You don’t have to wire this up, but the following circuits are just the same
The Circuit for LED Blink
“hello world” of microcontrollers
LED
Arduino
flat part
board
resistor
pin 13
LED
gnd
resistor gnd
220 ohm
(red,red,brown)
Schematics are pretty easy to learn, not many people use wiring diagrams.
LEDs & Resistors
LED
Flat edge here for neg. side
resistor
Polarity doesn’t matter on resistors
Varying LED Brightness
Same circuit as Blink circuit but pin 9 instead of pin 13
flat part
Arduino
board
resistor
pin 9
LED
gnd
gnd resistor
220 ohm
(red,red,brown)
Very quickly, it works by making and breaking the flow several hundred times a second. So really
it’s flashing, just like blink, but doing it very fast. Our eyes make it look like brighter or dimmer.
We’ll have to build this circuit.
Let’s Wire It Up
Arduino
board
resistor
pin 9
LED
gnd
gnd
All connected,
a “bus”
not
connected
Needle-nose
pliers
Even with solderless breadboards you’ll need to cut and strip wire. Each of these costs around $5
each. If you have to get just one, get the wire stripper.
Making Jumper Wires
pliers & cutter wire stripper
~1/4”
4. jumper over
to other side
Rubber band trick around Arduino & solderless breadboard shameless stolen from Kimiko Ryokai’s
Tangible User Interface class (INFO290-13): http://courses.ischool.berkeley.edu/i290-13/f07/
LED “Fading” Sketch
Load “File/Sketchbook/Examples/Analog/Fading”
note
LOW
• Plug in power
(7-12VDC)
set to
• Power LED lights EXT
up. It works!
• Reverse steps to
reprogram
Battery Power
Center of set to
jack is EXT
• Plugging into the positive
sockets is kind of
fiddly
http://todbot.com/blog/bionicarduino/
Tod E. Kurt
[email protected]
http://ladyada.net/learn/arduino/
Great Arduino tutorials
http://todbot.com/blog/category/arduino/
Various movies, hacks, tutorials on Arduino
http://freeduino.org/
Index of Arduino knowledge
http://adafruit.com/
Arduino starter kits, Boarduino Arduino clone, lots of cool kits
http://sparkfun.com/
Sells Arduino boards and lots of neat sensors & stuff
Books:
“Physical Computing”, Dan O’Sullivan & Tom Igoe
“Making Things Talk”, Tom Igoe
“Hacking Roomba”, Tod E. Kurt
obligiatory book plug