SlideShare uma empresa Scribd logo
1 de 41
Arduino: Open
Source Hardware
Hacking from the
Software Nerd
Perspective
Howard M. Lewis Ship
TWD Consulting
hlship@gmail.com
                       1   © 2010 Howard M. Lewis Ship
Qualifications




      2     © 2010 Howard M. Lewis Ship
Me




           Hardware




     3   © 2010 Howard M. Lewis Ship
~ 1980
• 6502 CPU
 • 8 bit accumulator
 • Two 8 bit registers
 • 1 MHz
• 8 KB Ram (Upgrade!)
• 30x30 B/W display
• 300 baud cassette


                         4   © 2010 Howard M. Lewis Ship
Hot End
          5   © 2010 Howard M. Lewis Ship
OSCON
                                 2009




                                                         6      © 2010 Howard M. Lewis Ship




http://www.makershed.com/ProductDetails.asp?ProductCode=MKCE4
7   © 2010 Howard M. Lewis Ship
8   © 2010 Howard M. Lewis Ship
Open Source …
  Hardware?
   9     © 2010 Howard M. Lewis Ship
10   © 2010 Howard M. Lewis Ship
11                 © 2010 Howard M. Lewis Ship




In addition, the IDE is free and open source, as is the bootloader that gets your code from the IDE and onto the Arduino.
Digital
                                                                                                           Analog
                                                    CPU / Clock    Flash    RAM    EEPROM    Pins /
                                                                                                            Pins
                                                                                             PWM


                                                    ATmega 328 /
                                      Duemilanove                  32 KB    2 KB    1 KB      14 / 6          6
                                                      16 MHz


                                                    ATmega1280
                                           MEGA                    128 KB   8 KB    4 KB     54 / 14         16
                                                     / 16 MHz


                                                    ATmega 168 /
                                                                   16 KB    1 KB    512 B     14 / 6          6
                                                      16 MHz


                                                                    12                      © 2010 Howard M. Lewis Ship




http://arduino.cc/

http://www.dorkbotpdx.org/wiki/dorkboard
Baby Steps: LED




                                                 Arduino



                                                                  13               © 2010 Howard M. Lewis Ship




LED is Light Emitting Diode. Diodes are one-way elements (electricity does not flow backwards).

The long pin is the anode, which connects to positive current.

The short pin is the cathode, which connects to negative current (the ground).

The glass enclosure usually has a flat side to indicate the cathode.

http://en.wikipedia.org/wiki/Led
14   © 2010 Howard M. Lewis Ship
15   © 2010 Howard M. Lewis Ship
16   © 2010 Howard M. Lewis Ship
Your Code



             Frameworks


             Application
               Server

         Virtual          Standard
         Machine           Library

                               Operating
   HAL         Drivers
                                System

                   BIOS

              Hardware
                     17                    © 2010 Howard M. Lewis Ship
Your Code




       18   © 2010 Howard M. Lewis Ship
Your Code




 Standard Library                  Add-on Libraries


Hardware: Arduino Microcontroller / Switches, Sensors, etc.


                              19                      © 2010 Howard M. Lewis Ship
20   © 2010 Howard M. Lewis Ship
Button




Arduino                      Vcc




            21     © 2010 Howard M. Lewis Ship
#define LED_PIN 11
#define BUTTON_PIN 7


void setup()
{
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT);
}


void loop()
{
  digitalWrite(LED_PIN, digitalRead(BUTTON_PIN));
}




                           22                 © 2010 Howard M. Lewis Ship
23   © 2010 Howard M. Lewis Ship
?

Arduino                      Vcc




          24       © 2010 Howard M. Lewis Ship
240 Ω
                 10000 Ω




  Arduino                            Vcc




            25             © 2010 Howard M. Lewis Ship
26   © 2010 Howard M. Lewis Ship
Analog Input



                                                               ARef

                                                                 Arduino
                                                                               Analog 5


                                                                  27                    © 2010 Howard M. Lewis Ship




The center pin is the output pin. The Arduino reads it as a value between 0 and 1023.

The other pins are connected to the Arduino's AREF (Analog Reference) voltage pin, and to ground.
28   © 2010 Howard M. Lewis Ship
#define LED_PIN 11
#define POT_PIN 5


void setup()
{
  pinMode(LED_PIN, OUTPUT);
}


void loop()
{
  int potValue = analogRead(POT_PIN);

    analogWrite(LED_PIN, potValue >> 2);
}



     Pulse Width Modulation
                              29           © 2010 Howard M. Lewis Ship
Scaling Up




    30       © 2010 Howard M. Lewis Ship
Shift Register
                                                        Shift Register
                                              Arduino




                                                                     31   © 2010 Howard M. Lewis Ship




http://en.wikipedia.org/wiki/Shift_register
LED Digit
  1        16



  2        32



  4        64




  8        128




      32         © 2010 Howard M. Lewis Ship
const int latchPin = 11; // ST_CP (12)
const int clockPin = 10; // SH_CP (11)
const int dataPin = 9; // DS (14)

boolean status = false;

byte ledValue = 0;

void setup()
{
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}




                     33              © 2010 Howard M. Lewis Ship
const byte digits[] = {
   B01111110, // 0
   B00001100, // 1
   B10110110, // 2
   B10011110, // 3
   B11001100, // 4
   B11011010, // 5
   B11111010, // 6
   B00001110, // 7
   B11111110, // 8
   B11001110, // 9
   B10111110, // A
   B11111000, // B
   B10110000, // C
   B10111100, // D
   B11110010, // E
   B11100010 // F
};



           34             © 2010 Howard M. Lewis Ship
void writeDigit(byte value, boolean showDP)
{
  // Ignore all but the low 4 bits when indexing
  byte digit = digits[value & 0x0f];

    // Decimal point is LSB
    if (showDP)
      digit |= 1;

    shiftOut(dataPin, clockPin, MSBFIRST, digit);
}




                         35                  © 2010 Howard M. Lewis Ship
void loop()
{
  status = !status;

    digitalWrite(latchPin, LOW);

    writeDigit(ledValue >> 4, status == true);
    writeDigit(ledValue, status == false);

    digitalWrite(latchPin, HIGH);

    ledValue++; // Increment, loop back to zero

    delay(128);
}




                       36                  © 2010 Howard M. Lewis Ship
Next Steps ...
• More interesting sensors
 • Motion sensor
 • Optical switches
 • Accelerometer
 • GPS
 • more!
• … and displays (8x8 RGB Matrix)
                    37              © 2010 Howard M. Lewis Ship
38              © 2010 Howard M. Lewis Ship




Getting Started with Arduino: http://oreilly.com/catalog/9780596155520

Practical Arduino: http://www.practicalarduino.com/

Practical Electronics for Inventors: http://www.mhprofessional.com/product.php?isbn=9780071452816

Understand Electronics: http://www.amazon.com/Understand-Electronics-Teach-Yourself-Guide/dp/0071740015
Summary

• Easy to get started!
• Don't Fear the Soldering Iron
• Be in control!
• Have fun!

                     39           © 2010 Howard M. Lewis Ship
Slides

• Will be available on SlideShare
  http://www.slideshare.net/hlship


• … and rate me at SpeakerRate:
  http://speakerrate.com/speakers/3749-
  howard-m-lewis-ship

                     40              © 2010 Howard M. Lewis Ship
© 2006 Kevin Jaako
http://www.flickr.com/photos/jaako/111131894/
                                                           © 2009 Adam Evans
                           http://www.flickr.com/photos/astroporn/3918373246/
© 2006 jopemoro
http://www.flickr.com/photos/jopemoro/81013003/
                                                         © 2008 shane doucette
                   http://www.flickr.com/photos/51512551@N00/3027058889/
© 2006 Nelson Minar
http://www.flickr.com/photos/nelsonminar/302035574/
                                                          © 2008 Thomas Hawk
                       http://www.flickr.com/photos/thomashawk/2598531205/
© 2009 dnnya17
http://www.flickr.com/photos/dnnya/3462481080/
                                                          © 2006 Iain Fergusson
                              http://en.wikipedia.org/wiki/File:Potentiometer.jpg




                                       41                             © 2010 Howard M. Lewis Ship

Mais conteúdo relacionado

Semelhante a Arduino: Open Source Hardware Hacking from the Software Nerd Perspective

An Ethernet-Based Coaxial Switching System , Final Presentation
An Ethernet-Based Coaxial Switching System , Final PresentationAn Ethernet-Based Coaxial Switching System , Final Presentation
An Ethernet-Based Coaxial Switching System , Final PresentationWatchara Amasiri
 
Arduino and Internet of Thinks: ShareIT TM: march 2010, TM
Arduino and Internet of Thinks: ShareIT TM: march 2010, TMArduino and Internet of Thinks: ShareIT TM: march 2010, TM
Arduino and Internet of Thinks: ShareIT TM: march 2010, TMAlexandru IOVANOVICI
 
Winbond Product
Winbond Product Winbond Product
Winbond Product Dorian Yeh
 
Digital Signage Advertising Media Player BKV59MSU_Datasheet
Digital Signage Advertising Media Player BKV59MSU_DatasheetDigital Signage Advertising Media Player BKV59MSU_Datasheet
Digital Signage Advertising Media Player BKV59MSU_DatasheetBITKIO Corp.
 
LDI 2012 System Integration
LDI 2012 System IntegrationLDI 2012 System Integration
LDI 2012 System IntegrationLauraFrank
 
Arduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptxArduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptxANIKDUTTA25
 
VIA EPIA-P910-A Front I/O extender card
VIA EPIA-P910-A Front I/O extender cardVIA EPIA-P910-A Front I/O extender card
VIA EPIA-P910-A Front I/O extender cardVIA Embedded
 
Microcontroller 8051 1
Microcontroller 8051  1Microcontroller 8051  1
Microcontroller 8051 1khan yaseen
 

Semelhante a Arduino: Open Source Hardware Hacking from the Software Nerd Perspective (10)

An Ethernet-Based Coaxial Switching System , Final Presentation
An Ethernet-Based Coaxial Switching System , Final PresentationAn Ethernet-Based Coaxial Switching System , Final Presentation
An Ethernet-Based Coaxial Switching System , Final Presentation
 
Arduino and Internet of Thinks: ShareIT TM: march 2010, TM
Arduino and Internet of Thinks: ShareIT TM: march 2010, TMArduino and Internet of Thinks: ShareIT TM: march 2010, TM
Arduino and Internet of Thinks: ShareIT TM: march 2010, TM
 
Winbond Product
Winbond Product Winbond Product
Winbond Product
 
Instruction set
Instruction setInstruction set
Instruction set
 
Product List
Product ListProduct List
Product List
 
Digital Signage Advertising Media Player BKV59MSU_Datasheet
Digital Signage Advertising Media Player BKV59MSU_DatasheetDigital Signage Advertising Media Player BKV59MSU_Datasheet
Digital Signage Advertising Media Player BKV59MSU_Datasheet
 
LDI 2012 System Integration
LDI 2012 System IntegrationLDI 2012 System Integration
LDI 2012 System Integration
 
Arduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptxArduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptx
 
VIA EPIA-P910-A Front I/O extender card
VIA EPIA-P910-A Front I/O extender cardVIA EPIA-P910-A Front I/O extender card
VIA EPIA-P910-A Front I/O extender card
 
Microcontroller 8051 1
Microcontroller 8051  1Microcontroller 8051  1
Microcontroller 8051 1
 

Mais de Howard Lewis Ship

Testing Web Applications with GEB
Testing Web Applications with GEBTesting Web Applications with GEB
Testing Web Applications with GEBHoward Lewis Ship
 
Spock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestSpock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestHoward Lewis Ship
 
Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserHoward Lewis Ship
 
Modern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapModern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapHoward Lewis Ship
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHoward Lewis Ship
 
Clojure: Towards The Essence Of Programming (What's Next? Conference, May 2011)
Clojure: Towards The Essence Of Programming (What's Next? Conference, May 2011)Clojure: Towards The Essence Of Programming (What's Next? Conference, May 2011)
Clojure: Towards The Essence Of Programming (What's Next? Conference, May 2011)Howard Lewis Ship
 
Practical Clojure Programming
Practical Clojure ProgrammingPractical Clojure Programming
Practical Clojure ProgrammingHoward Lewis Ship
 
Clojure: Towards The Essence of Programming
Clojure: Towards The Essence of ProgrammingClojure: Towards The Essence of Programming
Clojure: Towards The Essence of ProgrammingHoward Lewis Ship
 
Tapestry 5: Java Power, Scripting Ease
Tapestry 5: Java Power, Scripting EaseTapestry 5: Java Power, Scripting Ease
Tapestry 5: Java Power, Scripting EaseHoward Lewis Ship
 
Brew up a Rich Web Application with Cappuccino
Brew up a Rich Web Application with CappuccinoBrew up a Rich Web Application with Cappuccino
Brew up a Rich Web Application with CappuccinoHoward Lewis Ship
 
Clojure: Functional Concurrency for the JVM (presented at OSCON)
Clojure: Functional Concurrency for the JVM (presented at OSCON)Clojure: Functional Concurrency for the JVM (presented at OSCON)
Clojure: Functional Concurrency for the JVM (presented at OSCON)Howard Lewis Ship
 
Tapestry: State of the Union
Tapestry: State of the UnionTapestry: State of the Union
Tapestry: State of the UnionHoward Lewis Ship
 
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)Howard Lewis Ship
 

Mais de Howard Lewis Ship (17)

Testing Web Applications with GEB
Testing Web Applications with GEBTesting Web Applications with GEB
Testing Web Applications with GEB
 
Spock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestSpock: A Highly Logical Way To Test
Spock: A Highly Logical Way To Test
 
Backbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The BrowserBackbone.js: Run your Application Inside The Browser
Backbone.js: Run your Application Inside The Browser
 
Modern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapModern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter Bootstrap
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
 
Clojure: Towards The Essence Of Programming (What's Next? Conference, May 2011)
Clojure: Towards The Essence Of Programming (What's Next? Conference, May 2011)Clojure: Towards The Essence Of Programming (What's Next? Conference, May 2011)
Clojure: Towards The Essence Of Programming (What's Next? Conference, May 2011)
 
Practical Clojure Programming
Practical Clojure ProgrammingPractical Clojure Programming
Practical Clojure Programming
 
Clojure: Towards The Essence of Programming
Clojure: Towards The Essence of ProgrammingClojure: Towards The Essence of Programming
Clojure: Towards The Essence of Programming
 
Codemash-Clojure.pdf
Codemash-Clojure.pdfCodemash-Clojure.pdf
Codemash-Clojure.pdf
 
Codemash-Tapestry.pdf
Codemash-Tapestry.pdfCodemash-Tapestry.pdf
Codemash-Tapestry.pdf
 
Tapestry 5: Java Power, Scripting Ease
Tapestry 5: Java Power, Scripting EaseTapestry 5: Java Power, Scripting Ease
Tapestry 5: Java Power, Scripting Ease
 
Brew up a Rich Web Application with Cappuccino
Brew up a Rich Web Application with CappuccinoBrew up a Rich Web Application with Cappuccino
Brew up a Rich Web Application with Cappuccino
 
Clojure Deep Dive
Clojure Deep DiveClojure Deep Dive
Clojure Deep Dive
 
Clojure: Functional Concurrency for the JVM (presented at OSCON)
Clojure: Functional Concurrency for the JVM (presented at OSCON)Clojure: Functional Concurrency for the JVM (presented at OSCON)
Clojure: Functional Concurrency for the JVM (presented at OSCON)
 
Cascade
CascadeCascade
Cascade
 
Tapestry: State of the Union
Tapestry: State of the UnionTapestry: State of the Union
Tapestry: State of the Union
 
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
 

Último

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Arduino: Open Source Hardware Hacking from the Software Nerd Perspective

  • 1. Arduino: Open Source Hardware Hacking from the Software Nerd Perspective Howard M. Lewis Ship TWD Consulting hlship@gmail.com 1 © 2010 Howard M. Lewis Ship
  • 2. Qualifications 2 © 2010 Howard M. Lewis Ship
  • 3. Me Hardware 3 © 2010 Howard M. Lewis Ship
  • 4. ~ 1980 • 6502 CPU • 8 bit accumulator • Two 8 bit registers • 1 MHz • 8 KB Ram (Upgrade!) • 30x30 B/W display • 300 baud cassette 4 © 2010 Howard M. Lewis Ship
  • 5. Hot End 5 © 2010 Howard M. Lewis Ship
  • 6. OSCON 2009 6 © 2010 Howard M. Lewis Ship http://www.makershed.com/ProductDetails.asp?ProductCode=MKCE4
  • 7. 7 © 2010 Howard M. Lewis Ship
  • 8. 8 © 2010 Howard M. Lewis Ship
  • 9. Open Source … Hardware? 9 © 2010 Howard M. Lewis Ship
  • 10. 10 © 2010 Howard M. Lewis Ship
  • 11. 11 © 2010 Howard M. Lewis Ship In addition, the IDE is free and open source, as is the bootloader that gets your code from the IDE and onto the Arduino.
  • 12. Digital Analog CPU / Clock Flash RAM EEPROM Pins / Pins PWM ATmega 328 / Duemilanove 32 KB 2 KB 1 KB 14 / 6 6 16 MHz ATmega1280 MEGA 128 KB 8 KB 4 KB 54 / 14 16 / 16 MHz ATmega 168 / 16 KB 1 KB 512 B 14 / 6 6 16 MHz 12 © 2010 Howard M. Lewis Ship http://arduino.cc/ http://www.dorkbotpdx.org/wiki/dorkboard
  • 13. Baby Steps: LED Arduino 13 © 2010 Howard M. Lewis Ship LED is Light Emitting Diode. Diodes are one-way elements (electricity does not flow backwards). The long pin is the anode, which connects to positive current. The short pin is the cathode, which connects to negative current (the ground). The glass enclosure usually has a flat side to indicate the cathode. http://en.wikipedia.org/wiki/Led
  • 14. 14 © 2010 Howard M. Lewis Ship
  • 15. 15 © 2010 Howard M. Lewis Ship
  • 16. 16 © 2010 Howard M. Lewis Ship
  • 17. Your Code Frameworks Application Server Virtual Standard Machine Library Operating HAL Drivers System BIOS Hardware 17 © 2010 Howard M. Lewis Ship
  • 18. Your Code 18 © 2010 Howard M. Lewis Ship
  • 19. Your Code Standard Library Add-on Libraries Hardware: Arduino Microcontroller / Switches, Sensors, etc. 19 © 2010 Howard M. Lewis Ship
  • 20. 20 © 2010 Howard M. Lewis Ship
  • 21. Button Arduino Vcc 21 © 2010 Howard M. Lewis Ship
  • 22. #define LED_PIN 11 #define BUTTON_PIN 7 void setup() { pinMode(LED_PIN, OUTPUT); pinMode(BUTTON_PIN, INPUT); } void loop() { digitalWrite(LED_PIN, digitalRead(BUTTON_PIN)); } 22 © 2010 Howard M. Lewis Ship
  • 23. 23 © 2010 Howard M. Lewis Ship
  • 24. ? Arduino Vcc 24 © 2010 Howard M. Lewis Ship
  • 25. 240 Ω 10000 Ω Arduino Vcc 25 © 2010 Howard M. Lewis Ship
  • 26. 26 © 2010 Howard M. Lewis Ship
  • 27. Analog Input ARef Arduino Analog 5 27 © 2010 Howard M. Lewis Ship The center pin is the output pin. The Arduino reads it as a value between 0 and 1023. The other pins are connected to the Arduino's AREF (Analog Reference) voltage pin, and to ground.
  • 28. 28 © 2010 Howard M. Lewis Ship
  • 29. #define LED_PIN 11 #define POT_PIN 5 void setup() { pinMode(LED_PIN, OUTPUT); } void loop() { int potValue = analogRead(POT_PIN); analogWrite(LED_PIN, potValue >> 2); } Pulse Width Modulation 29 © 2010 Howard M. Lewis Ship
  • 30. Scaling Up 30 © 2010 Howard M. Lewis Ship
  • 31. Shift Register Shift Register Arduino 31 © 2010 Howard M. Lewis Ship http://en.wikipedia.org/wiki/Shift_register
  • 32. LED Digit 1 16 2 32 4 64 8 128 32 © 2010 Howard M. Lewis Ship
  • 33. const int latchPin = 11; // ST_CP (12) const int clockPin = 10; // SH_CP (11) const int dataPin = 9; // DS (14) boolean status = false; byte ledValue = 0; void setup() { pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); pinMode(dataPin, OUTPUT); } 33 © 2010 Howard M. Lewis Ship
  • 34. const byte digits[] = { B01111110, // 0 B00001100, // 1 B10110110, // 2 B10011110, // 3 B11001100, // 4 B11011010, // 5 B11111010, // 6 B00001110, // 7 B11111110, // 8 B11001110, // 9 B10111110, // A B11111000, // B B10110000, // C B10111100, // D B11110010, // E B11100010 // F }; 34 © 2010 Howard M. Lewis Ship
  • 35. void writeDigit(byte value, boolean showDP) { // Ignore all but the low 4 bits when indexing byte digit = digits[value & 0x0f]; // Decimal point is LSB if (showDP) digit |= 1; shiftOut(dataPin, clockPin, MSBFIRST, digit); } 35 © 2010 Howard M. Lewis Ship
  • 36. void loop() { status = !status; digitalWrite(latchPin, LOW); writeDigit(ledValue >> 4, status == true); writeDigit(ledValue, status == false); digitalWrite(latchPin, HIGH); ledValue++; // Increment, loop back to zero delay(128); } 36 © 2010 Howard M. Lewis Ship
  • 37. Next Steps ... • More interesting sensors • Motion sensor • Optical switches • Accelerometer • GPS • more! • … and displays (8x8 RGB Matrix) 37 © 2010 Howard M. Lewis Ship
  • 38. 38 © 2010 Howard M. Lewis Ship Getting Started with Arduino: http://oreilly.com/catalog/9780596155520 Practical Arduino: http://www.practicalarduino.com/ Practical Electronics for Inventors: http://www.mhprofessional.com/product.php?isbn=9780071452816 Understand Electronics: http://www.amazon.com/Understand-Electronics-Teach-Yourself-Guide/dp/0071740015
  • 39. Summary • Easy to get started! • Don't Fear the Soldering Iron • Be in control! • Have fun! 39 © 2010 Howard M. Lewis Ship
  • 40. Slides • Will be available on SlideShare http://www.slideshare.net/hlship • … and rate me at SpeakerRate: http://speakerrate.com/speakers/3749- howard-m-lewis-ship 40 © 2010 Howard M. Lewis Ship
  • 41. © 2006 Kevin Jaako http://www.flickr.com/photos/jaako/111131894/ © 2009 Adam Evans http://www.flickr.com/photos/astroporn/3918373246/ © 2006 jopemoro http://www.flickr.com/photos/jopemoro/81013003/ © 2008 shane doucette http://www.flickr.com/photos/51512551@N00/3027058889/ © 2006 Nelson Minar http://www.flickr.com/photos/nelsonminar/302035574/ © 2008 Thomas Hawk http://www.flickr.com/photos/thomashawk/2598531205/ © 2009 dnnya17 http://www.flickr.com/photos/dnnya/3462481080/ © 2006 Iain Fergusson http://en.wikipedia.org/wiki/File:Potentiometer.jpg 41 © 2010 Howard M. Lewis Ship