SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Meeting Arduino
              by Miguel Sánchez
    Polytechnic University of Valencia, Spain
                 February 2008




                         
Outline

    (1)Introduction
    (2)What is Arduino?
    (3)Arduino main features
    (4)Programming Arduino
    (5)Q & A



                            
Design of embedded systems

    
        Love it or hate it
    
        Many details (software, hardware, I/O, pcb ...)
    
        Not easy to practice with:
        
            expensive
        
            errors maybe be destructive (more expensive)
        
            many tools are proprietary (compilers, pcb CAD...)
    
        Development kits are cool but ... expensive
                                    
What is Arduino?

    
        From http://www.arduino.cc
        
            Arduino is an open­source electronics 
            prototyping platform based on flexible, easy­to­
            use hardware and software. It's intended for artists, 
            designers, hobbyists, and anyone interested in 
            creating interactive objects or environments.




                                     
Open­source hardware?

    
        It seems an odd concept
    
        Like Open­source software, designers are 
        making  all the many details of the design 
        public, including:
        
            schematics & pcb
        
            development environment (multi platform)
        
            boot loader code

                                   
Schematic




         
Arduino main features
                          13 digital outputs (6 PWM)


    USB
                                                           RESET


                                                           in­circuit
       power
                                                           system 
       selection      a
                                                           programming




    9­18 VDC



                           power outputs 6 analog inputs
Hardware details

    Built around ATMEL ATmega168 micro 
    controller
    
        16KByte flash / 1KByte RAM / 0.5KByte EEPROM
        Clock 0 – 20Mhz
        10 bit ADC, PWM, 
        capture counters, 
        USART, I2C, SPI, 
        programmable watchdog, etc
    
        USB to serial converter
        Can be USB­powered
                                  
There are other formats

    
        Older versions use ATmega8
    
        There are small versions without comms
    
        Older versions used RS­232 instead of USB
    
        Program upload required user to press RESET
        
            not anymore!



                              
Who did this and why?


    Arduino is an open 
    hardware and 
    open/free software for 
    Physical Computing.

    Physical ... what?  




                               
Artists platform

    
        Maybe the intended use is for making artistic 
        interactive installations
    
        It can be used by students and hobbyists too!
    
        You can buy a board on eBay or from a local 
        supplier for less than 20 EUR
        
            add a USB cable and you can start playing


                                   
What about the software?

    
        Arduino platform is completed by a software 
        development environment
    
        It's a C­like language (that it is actually parsed 
        to generate standard C­code)
    
        It is great thing that there is a GNU C compiler 
        for ATMEL microcontollers
    
        They made it easy: compile, upload, run
                                 
Arduino IDE

    
        Written in Java
    
        It works on Windows, 
        Linux, OSX, ...
    
        It includes a mini 
        terminal for debugging
    
        Freely available


                                  
Arduino Language

    
        It is based on Wiring language
        
            developed by Hernando Barragán (Universidad de 
            los Andes, Colombia)
    
        The Arduino IDE is based on Processing IDE
        
            Ben Fry and Casey Rias (MIT Media Lab)
    
        Both projects are also open­source ones
    
        Several libraries are part of the language (serial 
        I/O, stepper motors, basic I/O, delays, etc)
                                 
Program structure

    
        Instead of a main function you have two 
        mandatory functions: setup and loop
    
        void setup() performs the initial setup of 
        variables and hardware
    
        void loop() contains code that will be run as an 
        endless loop
    
        Think of main() { setup(); while(1) loop(); }
                                 
Language reference

    
        Similar to C syntax        
                                       Variable types:
                                           * boolean
    
        Serial communication
                                           * char
    
        Basic input/output:                * byte
                                           * int
         
              digitalRead,                 * unsigned int
              digitalWrite                 * long
                                           * unsigned long
         
              analogRead,                  * float
              analogWrite                  * double
                                           * string
 
    
        ...                                * array 
gcc­avr compiler

    
        Code is translated to C code and later compiled
    
        Library AVR­Libc is used
    
        Binary can be uploaded through the serial 
        connection because Arduino chip does have a 
        bootloader code
    
        Bootloader receives the code and writes it to 
        flash memory
                                
Boot sequence

    
        After a RESET:
        
            Bootloader code checks if an upload is being done 
            over the serial connection.
        
            If not, it jumps to the beginning of the user code
    
        User code upload does not destroy the 
        bootloader
    
        Bootloader cannot be programmed using the 
 
        serial, though         
Programming the bootloader

    
        Arduino commercial kits do 
        include the bootloader code 
        in the microcontroller
    
        To change it, you need to use 
        the In­Circuit Serial 
        Programming (ICSP pins)
        
            ICSP adapters for serial or 
            parallel ports can be built 
 
            cheaply                  
Uploading new code

    
        In older versions, users have to press RESET 
        button on Arduino
    
        Newer versions (diecimila) make a RESET with 
        the DTR signal of the serial port (USB2serial)
    
        RESET is needed because user code was 
        running and we want the bootloader to take 
        control now so upload can happen

                               
Arduino shields


    You can stack other boards on top of Arduino to 
    add additional hardware to your project like:
    
        a proto­board
    
        a ZigBee wireless interface
    
        a DC motor controller
    
        a stepper motor controller
    
        your own shield

                                 
Stack of shields




             
External power supply

    
        You can use a wall 
        wart from 9­18 VDC
    
        USB cannot power 
        beyond 500 mA load




                               
Programming Arduino

    
        The Arduino IDE is freely available from 
        Arduino webpage.
    
        Arduino uses FTDI USB to serial chip. 
    
        Drivers for that chip are available for many 
        platforms.
    
        You do not need to install additional drivers for 
        Linux, Windows or Apple OS X.
                                 
Hello World!
                                         Compile   Upload   Activate Terminal

    
        As Arduino does not a 
        have a screen, we can 
        use the serial port to 
        print out
        
            Serial.begin(speed)
        
            Serial.println(”...”)



                                      
                     Terminal Area
Blink

    
        Pin 13 has a LED
    
        Let's use it




                              
Analog input

    
        Let's read from input 0 
        and print to the serial
    
        Can we call this a PC­
        based instrument? 




                                  
PWM output

    
        Not all the digital                         tcycle
        outputs allow PWM
        
            Pin 13 does not work, 
            pin 11,10,9,6,5,3 does
                                              ton
    
        analogWrite function 
        takes care of this                           t on
                                          Vout =              ×Vcc
        
            You may call it analog                  t cycle
            output
                                       
Libraries

    
        There are certain classes available for driving 
        common devices like:
        
            stepper motors
        
            serial EEPROM memory
        
            RC servos
        
            LCD panels
        
            Software serial port

 
        
            etc                     
Prototype platform

    
        Once you've got your system running you may:
        
            completely remove the bootloader
        
            design a new PCB with all the needed elements
        
            remove USB communication if yo do not need it
    
        Or you can leave it this way
        
            it may be your cheapest choice


                                   
Other references

    
        http://www.freeduino.org
        
            it contains a list of more than 400 references
             
                 among them a Programming Tutorial
    
        And there are many variations:




                                       
Questions & Answers

    
        Hopefully ... 




    
        Don't be shy!

                          
Thank you!




          

Más contenido relacionado

La actualidad más candente

Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 

La actualidad más candente (20)

Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Arduino
ArduinoArduino
Arduino
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
Arduino for Beginners
Arduino for BeginnersArduino for Beginners
Arduino for Beginners
 
Arduino Platform with C programming.
Arduino Platform with C programming.Arduino Platform with C programming.
Arduino Platform with C programming.
 
Introduction to Arduino and Hands on to Iot
Introduction to Arduino and Hands on to IotIntroduction to Arduino and Hands on to Iot
Introduction to Arduino and Hands on to Iot
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
Intro to Arduino Revision #2
Intro to Arduino Revision #2Intro to Arduino Revision #2
Intro to Arduino Revision #2
 
Basic Sensors
Basic Sensors Basic Sensors
Basic Sensors
 
Arduino Programming for Basic Robotics - University of Moratuwa
Arduino Programming for Basic Robotics - University of MoratuwaArduino Programming for Basic Robotics - University of Moratuwa
Arduino Programming for Basic Robotics - University of Moratuwa
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
 
Arduino 101
Arduino 101Arduino 101
Arduino 101
 
Arduino Introduction Guide 1
Arduino Introduction Guide 1Arduino Introduction Guide 1
Arduino Introduction Guide 1
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Arduino 8-step drum sequencer 3 channels
Arduino 8-step drum sequencer 3 channelsArduino 8-step drum sequencer 3 channels
Arduino 8-step drum sequencer 3 channels
 
DSL Junior Makers - electronics workshop
DSL Junior Makers - electronics workshopDSL Junior Makers - electronics workshop
DSL Junior Makers - electronics workshop
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
Arduino basics
Arduino basicsArduino basics
Arduino basics
 

Destacado

54350108 metro-prototype-new
54350108 metro-prototype-new54350108 metro-prototype-new
54350108 metro-prototype-new
pomil
 
Chapter 7 stepper motor
Chapter 7 stepper motorChapter 7 stepper motor
Chapter 7 stepper motor
Hattori Sidek
 

Destacado (20)

Metro train
Metro trainMetro train
Metro train
 
Akash
AkashAkash
Akash
 
Automatic Metro
Automatic MetroAutomatic Metro
Automatic Metro
 
Arduino
ArduinoArduino
Arduino
 
Arduino Introduction Presentation
Arduino Introduction PresentationArduino Introduction Presentation
Arduino Introduction Presentation
 
54350108 metro-prototype-new
54350108 metro-prototype-new54350108 metro-prototype-new
54350108 metro-prototype-new
 
Metro Train Automation & display System
Metro Train Automation & display SystemMetro Train Automation & display System
Metro Train Automation & display System
 
Wireless technology 1g 2g 3g 4g
Wireless technology 1g 2g 3g 4gWireless technology 1g 2g 3g 4g
Wireless technology 1g 2g 3g 4g
 
Aurdino presentation
Aurdino presentationAurdino presentation
Aurdino presentation
 
Metro train prototype
Metro train prototypeMetro train prototype
Metro train prototype
 
Introduction to Arduino and Circuits
Introduction to Arduino and CircuitsIntroduction to Arduino and Circuits
Introduction to Arduino and Circuits
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Chapter 7 stepper motor
Chapter 7 stepper motorChapter 7 stepper motor
Chapter 7 stepper motor
 
Sensors & Actuators
Sensors & Actuators Sensors & Actuators
Sensors & Actuators
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino Development For Beginners
Arduino Development For BeginnersArduino Development For Beginners
Arduino Development For Beginners
 
Metro presentation
Metro presentationMetro presentation
Metro presentation
 
Arduino Presentation
Arduino PresentationArduino Presentation
Arduino Presentation
 
Arduino
ArduinoArduino
Arduino
 
Analysis of 1G, 2G, 3G & 4G
Analysis of 1G, 2G, 3G & 4GAnalysis of 1G, 2G, 3G & 4G
Analysis of 1G, 2G, 3G & 4G
 

Similar a arduino

Similar a arduino (20)

Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
arduino.pdf
arduino.pdfarduino.pdf
arduino.pdf
 
Embedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontrollerEmbedded system programming using Arduino microcontroller
Embedded system programming using Arduino microcontroller
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
 
Arduino01.pptx
Arduino01.pptxArduino01.pptx
Arduino01.pptx
 
Arduino spooky projects_class1
Arduino spooky projects_class1Arduino spooky projects_class1
Arduino spooky projects_class1
 
Physical Computing with Ruby and Arduino
Physical Computing with Ruby and ArduinoPhysical Computing with Ruby and Arduino
Physical Computing with Ruby and Arduino
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshop
 
Cassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshopCassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshop
 
Arduino Workshop @ MSA University
Arduino Workshop @ MSA UniversityArduino Workshop @ MSA University
Arduino Workshop @ MSA University
 
Start with arduino
Start with arduinoStart with arduino
Start with arduino
 
How to use an Arduino
How to use an ArduinoHow to use an Arduino
How to use an Arduino
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
 
01_DIGITAL IO.pptx
01_DIGITAL IO.pptx01_DIGITAL IO.pptx
01_DIGITAL IO.pptx
 
Arduino
ArduinoArduino
Arduino
 
Programming the PS3
Programming the PS3Programming the PS3
Programming the PS3
 
Embedded systems presentation
Embedded systems presentationEmbedded systems presentation
Embedded systems presentation
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
 
Arduino Workshop Day 2
Arduino  Workshop Day 2Arduino  Workshop Day 2
Arduino Workshop Day 2
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 

Último

Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
lizamodels9
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
Matteo Carbone
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
lizamodels9
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
amitlee9823
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
Renandantas16
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
dlhescort
 

Último (20)

Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
Call Girls From Pari Chowk Greater Noida ❤️8448577510 ⊹Best Escorts Service I...
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
 
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptxB.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
 
Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 

arduino

  • 1. Meeting Arduino by Miguel Sánchez Polytechnic University of Valencia, Spain February 2008    
  • 2. Outline (1)Introduction (2)What is Arduino? (3)Arduino main features (4)Programming Arduino (5)Q & A    
  • 3. Design of embedded systems  Love it or hate it  Many details (software, hardware, I/O, pcb ...)  Not easy to practice with:  expensive  errors maybe be destructive (more expensive)  many tools are proprietary (compilers, pcb CAD...)  Development kits are cool but ... expensive    
  • 4. What is Arduino?  From http://www.arduino.cc  Arduino is an open­source electronics  prototyping platform based on flexible, easy­to­ use hardware and software. It's intended for artists,  designers, hobbyists, and anyone interested in  creating interactive objects or environments.    
  • 5. Open­source hardware?  It seems an odd concept  Like Open­source software, designers are  making  all the many details of the design  public, including:  schematics & pcb  development environment (multi platform)  boot loader code    
  • 7. Arduino main features 13 digital outputs (6 PWM) USB RESET in­circuit power system  selection a programming 9­18 VDC     power outputs 6 analog inputs
  • 8. Hardware details  Built around ATMEL ATmega168 micro  controller  16KByte flash / 1KByte RAM / 0.5KByte EEPROM Clock 0 – 20Mhz 10 bit ADC, PWM,  capture counters,  USART, I2C, SPI,  programmable watchdog, etc  USB to serial converter Can be USB­powered     
  • 9. There are other formats  Older versions use ATmega8  There are small versions without comms  Older versions used RS­232 instead of USB  Program upload required user to press RESET  not anymore!    
  • 10. Who did this and why?  Arduino is an open  hardware and  open/free software for  Physical Computing.  Physical ... what?      
  • 11. Artists platform  Maybe the intended use is for making artistic  interactive installations  It can be used by students and hobbyists too!  You can buy a board on eBay or from a local  supplier for less than 20 EUR  add a USB cable and you can start playing    
  • 12. What about the software?  Arduino platform is completed by a software  development environment  It's a C­like language (that it is actually parsed  to generate standard C­code)  It is great thing that there is a GNU C compiler  for ATMEL microcontollers  They made it easy: compile, upload, run    
  • 13. Arduino IDE  Written in Java  It works on Windows,  Linux, OSX, ...  It includes a mini  terminal for debugging  Freely available    
  • 14. Arduino Language  It is based on Wiring language  developed by Hernando Barragán (Universidad de  los Andes, Colombia)  The Arduino IDE is based on Processing IDE  Ben Fry and Casey Rias (MIT Media Lab)  Both projects are also open­source ones  Several libraries are part of the language (serial    I/O, stepper motors, basic I/O, delays, etc)  
  • 15. Program structure  Instead of a main function you have two  mandatory functions: setup and loop  void setup() performs the initial setup of  variables and hardware  void loop() contains code that will be run as an  endless loop  Think of main() { setup(); while(1) loop(); }    
  • 16. Language reference  Similar to C syntax  Variable types:     * boolean  Serial communication     * char  Basic input/output:     * byte     * int  digitalRead,      * unsigned int digitalWrite     * long     * unsigned long  analogRead,      * float analogWrite     * double     * string    ...       * array 
  • 17. gcc­avr compiler  Code is translated to C code and later compiled  Library AVR­Libc is used  Binary can be uploaded through the serial  connection because Arduino chip does have a  bootloader code  Bootloader receives the code and writes it to  flash memory    
  • 18. Boot sequence  After a RESET:  Bootloader code checks if an upload is being done  over the serial connection.  If not, it jumps to the beginning of the user code  User code upload does not destroy the  bootloader  Bootloader cannot be programmed using the    serial, though  
  • 19. Programming the bootloader  Arduino commercial kits do  include the bootloader code  in the microcontroller  To change it, you need to use  the In­Circuit Serial  Programming (ICSP pins)  ICSP adapters for serial or  parallel ports can be built    cheaply  
  • 20. Uploading new code  In older versions, users have to press RESET  button on Arduino  Newer versions (diecimila) make a RESET with  the DTR signal of the serial port (USB2serial)  RESET is needed because user code was  running and we want the bootloader to take  control now so upload can happen    
  • 21. Arduino shields  You can stack other boards on top of Arduino to  add additional hardware to your project like:  a proto­board  a ZigBee wireless interface  a DC motor controller  a stepper motor controller  your own shield    
  • 23. External power supply  You can use a wall  wart from 9­18 VDC  USB cannot power  beyond 500 mA load    
  • 24. Programming Arduino  The Arduino IDE is freely available from  Arduino webpage.  Arduino uses FTDI USB to serial chip.   Drivers for that chip are available for many  platforms.  You do not need to install additional drivers for  Linux, Windows or Apple OS X.    
  • 25. Hello World! Compile Upload Activate Terminal  As Arduino does not a  have a screen, we can  use the serial port to  print out  Serial.begin(speed)  Serial.println(”...”)     Terminal Area
  • 26. Blink  Pin 13 has a LED  Let's use it    
  • 27. Analog input  Let's read from input 0  and print to the serial  Can we call this a PC­ based instrument?     
  • 28. PWM output  Not all the digital  tcycle outputs allow PWM  Pin 13 does not work,  pin 11,10,9,6,5,3 does ton  analogWrite function  takes care of this t on Vout = ×Vcc  You may call it analog  t cycle output    
  • 29. Libraries  There are certain classes available for driving  common devices like:  stepper motors  serial EEPROM memory  RC servos  LCD panels  Software serial port    etc  
  • 30. Prototype platform  Once you've got your system running you may:  completely remove the bootloader  design a new PCB with all the needed elements  remove USB communication if yo do not need it  Or you can leave it this way  it may be your cheapest choice    
  • 31. Other references  http://www.freeduino.org  it contains a list of more than 400 references  among them a Programming Tutorial  And there are many variations:    
  • 32. Questions & Answers  Hopefully ...   Don't be shy!