SlideShare a Scribd company logo
1 of 30
An introduction to Arduino
Rita Pucci
pucci@di.unipi.it
Content
• Introduction on Arduino world;
– Idea of Arduino project;
– “Arduino” employment;
• Arduino: the device;
– Models of devices;
– Models enable for your projects;
– Technical characteristics;
– Device characteristics;
– Sensors;
• Arduino: development environment;
– How to prepare the environment;
– IDE;
– Sketch and its structure;
– Language and libraries;
• Arduino: Support;
– Libraries;
– Forum and Support;
– Interesting projects;
• Examples;
• Try it;
The Idea of Arduino
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.
“Arduino”
“Arduino” is employed for:
• IDE• Device • Forum
Arduino Hardware
Models available for your
projects
UNO YÚN LILYPAD
Arduino UNO
• AVR Arduino microcontroller
• Atmega328
• 16 Mhz
• 32 Kb Flash memory
Arduino YÚN
• AVR Arduino microcontroller
• Atmega32u4
• 16MHz
• 32 Kb Flash memory
• Linux microprocessor
• Atheros AR9331
• MIPS @400MHz
• 16Mb Flash memory
Arduino LILYPAD USB
• AVR Arduino microcontroller
• ATmega32u4
• 8Mhz
• 32Kb Flash memory
Technical characteristics
Arduino UNO Arduino Yún Arduino Lilypad
ATmega328
ATmega32u4 / Atheros
AR9331
ATmega32u4
16 Mhz 16 Mhz 8 Mhz
5 V/7-12 V 5 V/7-12 V 3.3 V/3.8-5V
32 Kb Flash memory 16 MB Flash memory 32 Kb Flash memory
Sensors, Actuators, and Shields
• Sensors
– Accelerometer module
– Tilt module
– Button module
– Linear potentiometer
– Rotatory potentiometer
– Joystick module
– Hall sensor module
– LDR sensor module
– Temperature sensor module
– Touch sensor module
– Humidity sensor
– GPS module
• Actuators
– Led (red, blue, green, yellow)
– Power Led module
• For high power
– Mosfet module
– Relay module
• Shields
– Bluetooth
– GSM
Bluetooth shield
• 'SPP' serial link client
device, that can pair
with any computer or
tablet and appear as a
serial/COM port
• Automatically detect
and change the serial
baud rate
• DTR/RTS/DSR flow
control pins are
automatically synced to
the computer serial port
GSM shield
• Quad-band GSM/GPRS modem
• Supports TCP/UDP and HTTP
• Speed maximum is 85.6 kbps
GSM shield
Through the modem, it is possible to make voice calls.
GPS module
• Power usage is incredibly low
• Ultra-low dropout 3.3V regulator
so you can power it with 3.3-
5VDC in, 5V level safe inputs
• Logged every 15 seconds and
only when there is a fix
Arduino Software
How to prepare the
environment
The open-source Arduino environment makes it easy to write code and upload it to
the I/O board. It runs on Windows, Mac OS X, and Linux. The environment is written
in Java and based on Processing, avr-gcc, and other open source software.
Arduino IDE can be downloaded at www.arduino.cc
Download
software
Install
Arduino
program
Plug the
device
Run the
Arduino
program
Tell Arduino
(program)
about
Arduino
(board)
Selection Location and Type
Select your arduino
Select the location
of device
Terminology
• “sketch” – a program you write to run on an Arduino
board
• “pin” – an input or output connected to something.
– e.g. output to an LED, input from a knob.
• “digital” – value is either HIGH or LOW.
– (aka on/off, one/zero) e.g. switch state
• “analog” – value ranges, usually from 0-1023.
– e.g. LED brightness, motor speed, etc.
IDE
Verify
Upload
New
Open
Save
Serial
monitor
Toolbar buttons
Console display
Sketch editor
Language
The Arduino environment is based on Atmel Atmega microcontrollers. The AVR
language is a "C" environment for programming Atmel chips.
The programs can be divided in three main parts:
Sketch Structure
Variables
Functions
Sketch and its structure
Called when a sketch starts.
The setup function will only run once.
Does precisely what its name suggests,
and loops consecutively.
Other structure functions
• Control Structures: if then else, for, switch, while, continue, return, goto …;
• Further Syntax: ;, {}, //, /**/, #include, #define;
• Arithmetic Operators: +, -, =, /, *, %;
• Comparison Operators: ==, !=, <, >, <=, >=;
• Boolean Operators: &&, ||, !;
• Pointer Access Operators: *, &;
• Bitwise Operators: &, |, ^, >>, <<, ~;
• Compound Operators: ++, --, ==, +=, -=, *=, /=, &=, |=;
Variables
• Constants: level of energy (HIGH; LOW); mode of pin(INPUT; OUTPUT;
INPUT_PULLUP); led13(LED_BUILTIN);…;
• Types: word; String;…;
• Conversions: word();…;
• Variable scope and qualifiers: Volatile;…;
• Usefulness: sizeof();
Functions
Functions are distinguished according to the pin:
• Digitals: pinMode(); digitalRead(); digitalWrite();
• Analogs: analogReference(); analogRead(); analogWrite();
• Advanced I/O: tone(); noTone(); shiftOut(); shiftIn(); pulseIn();
• Time: millis(); micros(); delay(); delayMicroseconds();
• Math: min(); max(); abs(); ...;
• Trigonometry: sin(); cos(); tan();
• Random Numbers: randomSeed(); random();
• Bits and Bytes: lowByte(); highByte(); bitRead(); bitWrite(); bitSet(); bitClear();
bit();
• External Interrupts: attachInterrupt() detachInterrupt()
• Interrupts: interrupts(); noInterrupts();
• Communication: Serial; Stream;
Arduino Support
Libraries
All Libraries for all Arduino shields and
components are on: Library
Forum & Support
Support for arduino programmer:
http://forum.arduino.cc
Tutorial of Arduino Owner:
Arduino Tutorial
Starter projects with Arduino:
Starter Projects
Tutorial for AdaFruit component:
– GSM and GPS
– Adafruit products
Interesting projects
• Bare Conductive
• Smart citizen kit
• Little Robot Friends
• Little Bits
• Primo
• Earth Make
• Annikken Andee
Let’s try it
• Blink Led
• Potentiometer rotary + blink led
• LDR + led
• Potentiometer linear + 4 leds
• Humid + Term + Touch
• Volatile Button

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Arduino seminario

  • 1. An introduction to Arduino Rita Pucci pucci@di.unipi.it
  • 2. Content • Introduction on Arduino world; – Idea of Arduino project; – “Arduino” employment; • Arduino: the device; – Models of devices; – Models enable for your projects; – Technical characteristics; – Device characteristics; – Sensors; • Arduino: development environment; – How to prepare the environment; – IDE; – Sketch and its structure; – Language and libraries; • Arduino: Support; – Libraries; – Forum and Support; – Interesting projects; • Examples; • Try it;
  • 3. The Idea of Arduino 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.
  • 4. “Arduino” “Arduino” is employed for: • IDE• Device • Forum
  • 6. Models available for your projects UNO YÚN LILYPAD
  • 7. Arduino UNO • AVR Arduino microcontroller • Atmega328 • 16 Mhz • 32 Kb Flash memory
  • 8. Arduino YÚN • AVR Arduino microcontroller • Atmega32u4 • 16MHz • 32 Kb Flash memory • Linux microprocessor • Atheros AR9331 • MIPS @400MHz • 16Mb Flash memory
  • 9. Arduino LILYPAD USB • AVR Arduino microcontroller • ATmega32u4 • 8Mhz • 32Kb Flash memory
  • 10. Technical characteristics Arduino UNO Arduino Yún Arduino Lilypad ATmega328 ATmega32u4 / Atheros AR9331 ATmega32u4 16 Mhz 16 Mhz 8 Mhz 5 V/7-12 V 5 V/7-12 V 3.3 V/3.8-5V 32 Kb Flash memory 16 MB Flash memory 32 Kb Flash memory
  • 11. Sensors, Actuators, and Shields • Sensors – Accelerometer module – Tilt module – Button module – Linear potentiometer – Rotatory potentiometer – Joystick module – Hall sensor module – LDR sensor module – Temperature sensor module – Touch sensor module – Humidity sensor – GPS module • Actuators – Led (red, blue, green, yellow) – Power Led module • For high power – Mosfet module – Relay module • Shields – Bluetooth – GSM
  • 12. Bluetooth shield • 'SPP' serial link client device, that can pair with any computer or tablet and appear as a serial/COM port • Automatically detect and change the serial baud rate • DTR/RTS/DSR flow control pins are automatically synced to the computer serial port
  • 13. GSM shield • Quad-band GSM/GPRS modem • Supports TCP/UDP and HTTP • Speed maximum is 85.6 kbps
  • 14. GSM shield Through the modem, it is possible to make voice calls.
  • 15. GPS module • Power usage is incredibly low • Ultra-low dropout 3.3V regulator so you can power it with 3.3- 5VDC in, 5V level safe inputs • Logged every 15 seconds and only when there is a fix
  • 17. How to prepare the environment The open-source Arduino environment makes it easy to write code and upload it to the I/O board. It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing, avr-gcc, and other open source software. Arduino IDE can be downloaded at www.arduino.cc Download software Install Arduino program Plug the device Run the Arduino program Tell Arduino (program) about Arduino (board)
  • 18. Selection Location and Type Select your arduino Select the location of device
  • 19. Terminology • “sketch” – a program you write to run on an Arduino board • “pin” – an input or output connected to something. – e.g. output to an LED, input from a knob. • “digital” – value is either HIGH or LOW. – (aka on/off, one/zero) e.g. switch state • “analog” – value ranges, usually from 0-1023. – e.g. LED brightness, motor speed, etc.
  • 21. Language The Arduino environment is based on Atmel Atmega microcontrollers. The AVR language is a "C" environment for programming Atmel chips. The programs can be divided in three main parts: Sketch Structure Variables Functions
  • 22. Sketch and its structure Called when a sketch starts. The setup function will only run once. Does precisely what its name suggests, and loops consecutively.
  • 23. Other structure functions • Control Structures: if then else, for, switch, while, continue, return, goto …; • Further Syntax: ;, {}, //, /**/, #include, #define; • Arithmetic Operators: +, -, =, /, *, %; • Comparison Operators: ==, !=, <, >, <=, >=; • Boolean Operators: &&, ||, !; • Pointer Access Operators: *, &; • Bitwise Operators: &, |, ^, >>, <<, ~; • Compound Operators: ++, --, ==, +=, -=, *=, /=, &=, |=;
  • 24. Variables • Constants: level of energy (HIGH; LOW); mode of pin(INPUT; OUTPUT; INPUT_PULLUP); led13(LED_BUILTIN);…; • Types: word; String;…; • Conversions: word();…; • Variable scope and qualifiers: Volatile;…; • Usefulness: sizeof();
  • 25. Functions Functions are distinguished according to the pin: • Digitals: pinMode(); digitalRead(); digitalWrite(); • Analogs: analogReference(); analogRead(); analogWrite(); • Advanced I/O: tone(); noTone(); shiftOut(); shiftIn(); pulseIn(); • Time: millis(); micros(); delay(); delayMicroseconds(); • Math: min(); max(); abs(); ...; • Trigonometry: sin(); cos(); tan(); • Random Numbers: randomSeed(); random(); • Bits and Bytes: lowByte(); highByte(); bitRead(); bitWrite(); bitSet(); bitClear(); bit(); • External Interrupts: attachInterrupt() detachInterrupt() • Interrupts: interrupts(); noInterrupts(); • Communication: Serial; Stream;
  • 27. Libraries All Libraries for all Arduino shields and components are on: Library
  • 28. Forum & Support Support for arduino programmer: http://forum.arduino.cc Tutorial of Arduino Owner: Arduino Tutorial Starter projects with Arduino: Starter Projects Tutorial for AdaFruit component: – GSM and GPS – Adafruit products
  • 29. Interesting projects • Bare Conductive • Smart citizen kit • Little Robot Friends • Little Bits • Primo • Earth Make • Annikken Andee
  • 30. Let’s try it • Blink Led • Potentiometer rotary + blink led • LDR + led • Potentiometer linear + 4 leds • Humid + Term + Touch • Volatile Button