Вы находитесь на странице: 1из 39

Arduino Introduction

My Introduction Audio-only podcast (there is video but I only listen) "Know How" on the TWIT network TWIT.tv/kh/21 episode 21 Realized the technology had greatly advanced and was easy There is a HAM show too!

Arduino Introduction Micro-conroller board with USB Can be easily wired to external electronics Connected to computer -or Programmed, disconnected/run solo Open Source hardware

Specifications (UNO)

Atmel ATmega328P Processor 16 MHz 5V 32 kB Flash Memory 1 kB EEPROM 2 kB SRAM 14 Digital I/O (6 with PWM) 6 Analog Inputs 2.7 inches x 2.1 inches

14 Digital Input / Output ~ PWM(6) Reset LED pin 13 USB Power LED

Serial LEDs External Power 7-12V 6 Analog Inputs Power / Ground

Ordered Mine from Lady Ada

Experimentation Kit with Arduino Adafruit ARDX v1.3 UNO R3 $92 Delivered ($7 is for shipping) Arduino UNO R3, Holder, Breadboard Patch wires, LEDs, diodes, resistors, transistors, Servo, DC Motor, Piezo, Temp & Shift Register IC, buttons, potentiometer, photo resistor adafruit.com All the stuff for 13+ projects Excellent kit of materials to start

Full instructions to build these 13 circuits


Getting Started 8 LED Fun A Single Servo 8 More LEDs Music

- Blinking LED - Multiple LEDs - Servos - 74HC595 Shift Register - Piezo Elements

Spin Motor Spin - Transistor and Motor

Full instructions to build these 13 circuits


Button Pressing - Pushbuttons Twisting Light Temperature Larger Loads Colorful Light Squeezing - Potentiometers - Photo Resistors - TMP36 Temp Sensor - Relays - RGB LED - Force Sensitive Resistor

Getting Started: Blinking LED Breadboard layout sheet

Schematic & Orthographic View

Integrated Development Environment (IDE)

Variable(s) Setup

int ledPin = 13;

void setup() { pinMode(ledPin, OUTPUT

Infinite Loop

} void loop() { digitalWrite(ledPin, HIGH) delay(1000);

That will keep you pretty busy...


Making mashups of the projects Connecting up other simple devices Puzzle through interesting ideas

Traffic Lights Pulse Generator Morse Code generation

Traffic Lights

Thought about the complexities of controlling an intersection with Red/Yellow/Green Lights Originally prompted by a friend's desire to create a Drag Race starting light cascade Once I made a single light, I decided to try controlling an intersection (without turn lanes)

Two Traffic Lights

Got it working... Later built in power outage reset Recover to Red 4-way flash Traffic clearing all way Red Recover to normal cycling

Then... Extend the idea

Each Red/Yellow/Green light required 4 wires


One Ground 3 Digital Output pins One resistor for each LED

Wanted to create a module, that would light Red/Yellow/Green that could be added to other projects, in essence a 'hardware subroutine' that could be used as an indicator on other projects but... Minimize hardware footprint, max of 3 wires and as few components as possible

Create working Breadboard


3 LEDs 2 Resistors 3 wires Learned an optimization that would allow up to 6 LEDs to be controlled by 3 wires

Now, Actually MAKE the thing...

Now the software... and beyond

Optimize the simple Sketch used in breadboard development Easy to drop into existing code to make use of the three 'condition' LEDs Work on new 4 LED version Red/Orange/Yellow/Green Arrange to allow Red&Orange as well as Orange&Yellow to be lit simultaneously Make footprint smaller, doesn't block other I/O or add a ribbon cable.

7 Segment & Shift Register Free layout software from Fritzing.org

Piezo

Local Resources
Markelectronics.com, Beltsville MicroCenter, Rockville Radio Shack (they carry some Arduinio stuff!) Hardware Stores

Online Resources
Adafruit.com Oomlout.com/a/products/ardx Fritzing.org BaltimoreHackerspace.com LOTS of projects, just search for arduino & <whatever> shieldlist.org

Tips

Buy multi-compartment storage box (for parts) Take-Home dinner boxes protect in progress Put some extra rubber feet on Arduino itself Extra Breadboards (~ $3 each) Take photos of your layouts, store with code Hand draw, scan and also store with code Make Fritzing layout of some good/fun ones Keep notebook/log with what you did when Don't be afraid to solder some up on perfboard

Take it Farther...

Explore Shields (consider F/M header pins) Danger Shield soldering and coding project Etherned interface, put your project online! Realtime Clock & SD card Logger Touch/Keypad LCD displays & Tons of other ideas

Sparkfun Danger Shield (you build)

Network Shield

Network Shield atop Arduino

Logger Shield

Temp/Light Circuit (no logger)

Blank Logger Shield Installed

Earlier Logger with Light/Temp

2 Months Temp/Light Data 4 Million Data Points!

GnuPlot .PLT file to graph


set set set set set set set set set set set set set set terminal windows datafile separator "," key autotitle columnhead key textcolor variable key top left timefmt "%s" # use the column unix epoch sec xdata time format x "%a\n%m/%d" title "Arduino Light & Temperature Logger" ylabel "Temperature F" ytics nomirror y2tics y2label "Light" grid

plot "LOGGER_to_2013-03-20.CSV" u 2:5 w li , \ "" u 2:4 axes x1y2 w lines linetype 11

Resource Books

Programming Arduino: Getting Started with Sketches by Simon Monk 30 Arduino Projects: for the Evil Genius also by Simon Monk Arduino Cookbook (O'Reilly) by Michael Margolis

Arduino Try it Out

Вам также может понравиться