SlideShare a Scribd company logo
1 of 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

More Related Content

Similar to 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
 

Similar to 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
 

More from 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
 

More from 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)
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
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
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 

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