SlideShare a Scribd company logo
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 (20)

IOTC08 The Arduino Platform
IOTC08 The Arduino PlatformIOTC08 The Arduino Platform
IOTC08 The Arduino Platform
Eoin Brazil
 
Arduino talk
Arduino talkArduino talk
Arduino talk
izzetatam
 
Arduino talk
Arduino talkArduino talk
Arduino talk
kerematam
 
Arduino talk
Arduino talkArduino talk
Arduino talk
pakizeatam
 
Making things sense - Day 1 (May 2011)
Making things sense - Day 1 (May 2011)Making things sense - Day 1 (May 2011)
Making things sense - Day 1 (May 2011)
markumoto
 
Arduino learning
Arduino   learningArduino   learning
Arduino learning
Anil Yadav
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Introduction to Arduino and Circuits
Introduction to Arduino and CircuitsIntroduction to Arduino and Circuits
Introduction to Arduino and Circuits
Jason Griffey
 
Ardui no
Ardui no Ardui no
Ardui no
Amol Sakhalkar
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
AbdErrezakChahoub
 
introductiontoarduino-111120102058-phpapp02.pdf
introductiontoarduino-111120102058-phpapp02.pdfintroductiontoarduino-111120102058-phpapp02.pdf
introductiontoarduino-111120102058-phpapp02.pdf
HebaEng
 
Basics Of Embedded Systems
Basics Of Embedded SystemsBasics Of Embedded Systems
Basics Of Embedded Systems
arlabstech
 
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
codebits
 
Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)
Sudar Muthu
 
Arduino spooky projects_class3
Arduino spooky projects_class3Arduino spooky projects_class3
Arduino spooky projects_class3
Anil Yadav
 
Arduino talk by Toon Nelissen
Arduino talk by Toon Nelissen Arduino talk by Toon Nelissen
Arduino talk by Toon Nelissen
Industrial Design Center
 
Arduino talk by Toon Nelissen
Arduino talk by Toon NelissenArduino talk by Toon Nelissen
Arduino talk by Toon Nelissen
Jolien De Ville
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
Sudar Muthu
 
Making is fun!
Making is fun!Making is fun!
Making is fun!
Design Tree
 
Sensors and Actuators in Arduino, Introduction
Sensors and Actuators in Arduino, IntroductionSensors and Actuators in Arduino, Introduction
Sensors and Actuators in Arduino, Introduction
BibekPokhrel13
 
IOTC08 The Arduino Platform
IOTC08 The Arduino PlatformIOTC08 The Arduino Platform
IOTC08 The Arduino Platform
Eoin Brazil
 
Arduino talk
Arduino talkArduino talk
Arduino talk
izzetatam
 
Arduino talk
Arduino talkArduino talk
Arduino talk
kerematam
 
Making things sense - Day 1 (May 2011)
Making things sense - Day 1 (May 2011)Making things sense - Day 1 (May 2011)
Making things sense - Day 1 (May 2011)
markumoto
 
Arduino learning
Arduino   learningArduino   learning
Arduino learning
Anil Yadav
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Introduction to Arduino and Circuits
Introduction to Arduino and CircuitsIntroduction to Arduino and Circuits
Introduction to Arduino and Circuits
Jason Griffey
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
AbdErrezakChahoub
 
introductiontoarduino-111120102058-phpapp02.pdf
introductiontoarduino-111120102058-phpapp02.pdfintroductiontoarduino-111120102058-phpapp02.pdf
introductiontoarduino-111120102058-phpapp02.pdf
HebaEng
 
Basics Of Embedded Systems
Basics Of Embedded SystemsBasics Of Embedded Systems
Basics Of Embedded Systems
arlabstech
 
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to s...
codebits
 
Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)
Sudar Muthu
 
Arduino spooky projects_class3
Arduino spooky projects_class3Arduino spooky projects_class3
Arduino spooky projects_class3
Anil Yadav
 
Arduino talk by Toon Nelissen
Arduino talk by Toon NelissenArduino talk by Toon Nelissen
Arduino talk by Toon Nelissen
Jolien De Ville
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
Sudar Muthu
 
Sensors and Actuators in Arduino, Introduction
Sensors and Actuators in Arduino, IntroductionSensors and Actuators in Arduino, Introduction
Sensors and Actuators in Arduino, Introduction
BibekPokhrel13
 

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
Howard 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 Test
Howard 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 Browser
Howard 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 Bootstrap
Howard 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 Java
Howard 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 Programming
Howard Lewis Ship
 
Clojure: Towards The Essence of Programming
Clojure: Towards The Essence of ProgrammingClojure: Towards The Essence of Programming
Clojure: Towards The Essence of Programming
Howard Lewis Ship
 
Codemash-Clojure.pdf
Codemash-Clojure.pdfCodemash-Clojure.pdf
Codemash-Clojure.pdf
Howard Lewis Ship
 
Codemash-Tapestry.pdf
Codemash-Tapestry.pdfCodemash-Tapestry.pdf
Codemash-Tapestry.pdf
Howard Lewis Ship
 
Tapestry 5: Java Power, Scripting Ease
Tapestry 5: Java Power, Scripting EaseTapestry 5: Java Power, Scripting Ease
Tapestry 5: Java Power, Scripting Ease
Howard 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 Cappuccino
Howard Lewis Ship
 
Clojure Deep Dive
Clojure Deep DiveClojure Deep Dive
Clojure Deep Dive
Howard 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
 
Cascade
CascadeCascade
Cascade
Howard Lewis Ship
 
Tapestry: State of the Union
Tapestry: State of the UnionTapestry: State of the Union
Tapestry: State of the Union
Howard 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
 
Testing Web Applications with GEB
Testing Web Applications with GEBTesting Web Applications with GEB
Testing Web Applications with GEB
Howard 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 Test
Howard 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 Browser
Howard 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 Bootstrap
Howard 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 Java
Howard 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 Programming
Howard Lewis Ship
 
Clojure: Towards The Essence of Programming
Clojure: Towards The Essence of ProgrammingClojure: Towards The Essence of Programming
Clojure: Towards The Essence of Programming
Howard Lewis Ship
 
Tapestry 5: Java Power, Scripting Ease
Tapestry 5: Java Power, Scripting EaseTapestry 5: Java Power, Scripting Ease
Tapestry 5: Java Power, Scripting Ease
Howard 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 Cappuccino
Howard 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 Union
Howard 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
 

Recently uploaded (20)

Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Ben Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding WorldBen Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding World
AWS Chicago
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Ben Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding WorldBen Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding World
AWS Chicago
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 

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 [email protected] 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