Introduction to Arduino

Similar documents
Arduino Prof. Dr. Magdy M. Abdelhameed

Introduction to Arduino

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

ARDUINO BOARD LINE UP

Lesson 5 Arduino Prototype Development Platforms. Chapter-8 L05: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Introduction to Arduino. Wilson Wingston Sharon

Alessandra de Vitis. Arduino

OBSTACLE AVOIDANCE ROBOT

IDUINO for maker s life. User Manual. For IDUINO development Board.

IDUINO for maker s life. User Manual. For IDUINO Mega2560 Board(ST1026)

keyestudio Keyestudio MEGA 2560 R3 Board

Getting to know the Arduino IDE

Introduction to Microcontrollers Using Arduino. PhilRobotics

Introduction to Microprocessors: Arduino

Lesson 6 Intel Galileo and Edison Prototype Development Platforms. Chapter-8 L06: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Introduction to Microcontrollers

FUNCTIONS For controlling the Arduino board and performing computations.

TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO

Microcontrollers for Ham Radio

<Table of content> <Parts and description> <Circuit board Guide> <Pins> <Basics of Coding> <Intro to Arduino> <Intro> <Downloading Arduino IDO>

The Arduino Briefing. The Arduino Briefing

Intel Galileo gen 2 Board

LinkIt ONE. Introduction. Specifications

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Bluno Mega 2560 (SKU:DFR0323)

Arduino Internals. Dale Wheat. Apress

w w w. b a s e t r a i n i n g i n s t i t u t e. c o

TA0139 USER MANUAL ARDUINO 2 WHEEL DRIVE WIRELESS BLUETOOTH ROBOT KIT

Sten-SLATE ESP Kit. Description and Programming

BASIC ARDUINO WORKSHOP. Mr. Aldwin and Mr. Bernardo

Introduction To Arduino

Intel Do-It-Yourself Challenge Intel Galileo and Edison Paul Guermonprez

Arduino: What is it? What can it do?

Create your own wireless motion sensor with

Power Monitoring System using Matlab and IoT

Arduino and Matlab for prototyping and manufacturing

Computer Architectures

DFRobot CurieNano A mini Genuino/Arduino 101 Board SKU: DFR0453

Electronic Brick Starter Kit

ARDUINO MINI 05 Code: A000087

More Arduino Programming

Arduino Part 2. Introductory Medical Device Prototyping

ARDUINO MEGA ADK REV3 Code: A000069

ARDUINO YÚN MINI Code: A000108

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas

Arduino Programming. Arduino UNO & Innoesys Educational Shield

IME-100 ECE. Lab 3. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

USER MANUAL ARDUINO I/O EXPANSION SHIELD

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

An FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal

Freeduino USB 1.0. Arduino Compatible Development Board Starter Guide. 1. Overview

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S

ARDUINO LEONARDO ETH Code: A000022

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

COL862 - Low Power Computing

ESPino - Specifications

USB. Bluetooth. Display. IO connectors. Sound. Main CPU Atmel ARM7 JTAG. IO Processor Atmel AVR JTAG. Introduction to the Lego NXT

Laboratory 1 Introduction to the Arduino boards

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

EEG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

Dual-POB. View Full-Size Image View Full-Size Image. ( POB-Technology ) ( POB-Technology ) Description

Lecture 6: Embedded Systems and Microcontrollers

FireBeetle ESP8266 IOT Microcontroller SKU: DFR0489

Arduino Uno Microcontroller Overview

Carl Peto. 10th August 2017 SWIFT FOR ARDUINO

Intel Edison Workshop

Arduino Platform Part I

ARDUINO UNO REV3 Code: A000066

Embedded Systems and Kinetic Art. CS5968: Erik Brunvand School of Computing. FA3800: Paul Stout Department of Art and Art History.

Logistics. Embedded Systems. Kinetic Art. This Class. Embedded Systems and Kinetic Art. Kinetic Art

Arduino ADK Rev.3 Board A000069

WiFiBee MT7681 (Arduino WiFi Wireless Programming) SKU: TEL0107

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface.

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

Adafruit Metro Mini. Created by lady ada. Last updated on :12:28 PM UTC

ARDUINO UNO REV3 SMD Code: A The board everybody gets started with, based on the ATmega328 (SMD).

ARDUINO M0 PRO Code: A000111

TANGIBLE MEDIA & PHYSICAL COMPUTING MORE ARDUINO

TA0297 WEMOS D1 R2 WIFI ARDUINO DEVELOPMENT BOARD ESP8266

An open-source, multi-parameter, full fledged human body vital sign monitoring HAT for Raspberry Pi as well as standalone use.

BILLING AND CONTROLLING OF INDIVIDUAL LOADS OF A COMPOSITE SYSTEM USING SIMPLE ANDROID APPLICATION

ARDUINO MEGA 2560 REV3 Code: A000067

Microcontroller Basics

ARDUINO YÚN Code: A000008

Intro to Arduino. Zero to Prototyping in a Flash! Material designed by Linz Craig and Brian Huang

ARDUINO INDUSTRIAL 1 01 Code: A000126

09/05/2014. Engaging electronics for the new D&T curriculum. Geoff Hampson Managing Director of Kitronik. Presentation overview

Basic Electronic Toolkit for under $40

Programming Manual of MYOSA

Beetle SKU:DFR0282. Contents. Introduction

Rephone Core 2G-AtmelSAMD21

Farklı Arduino Boardlar

ARDUINO PRIMO. Code: A000135

IoT Event Box Assembly Manual

RedBoard Hookup Guide

EXPERIMENT 7 Please visit to learn all features of arduino before you start the experiments

Sanguino TSB. Introduction: Features:

SECOND EDITION. Arduino Cookbook. Michael Margolis O'REILLY- Tokyo. Farnham Koln Sebastopol. Cambridge. Beijing

Romeo BLE Quad Robot Controller SKU: DFR0398

Transcription:

Introduction to Arduino Mobile Computing, aa. 2016/2017 May 12, 2017 Daniele Ronzani - Ph.D student in Computer Science dronzani@math.unipd.it

What are Microcontrollers Very small and simple computers Cheap and useful Present in every smart system Atmel is one of the family of microcontrollers 2

What is the DIY paradigm Create something without professional knowledge Many fields Programming Education Critical theory Business Electronics... 3

The Arduino project Arduino UNO 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.cc An Italian prototyping tool project Ready-made electronic products at low costs Open Source Boards with different performances Shields that extend the functions Wi-Fi, GPSR, Ethernet, microsd reader,... Shields and sensors 4

Some History of Arduino Arduino was born in 2005 in Ivrea, Italy IDEA: less expensive device for controlling interactive electronic projects Rapid prototyping Name "Arduino" in honor of Bar di Re Arduino Start to produce boards in a small factory Arduino was built around the Wiring project of Hernando Barragan. Hernando's thesis project at the Interaction Design Institute Ivrea. Remove the deep knowledge barriers Massimo Banzi 5

The First Protoype 6

Arduino Today Arduino community is mushrooming across the globe 80% from Europe and USA More than 200 distributors 7

Some Competitors - 1 Lego Mindstorm Intelligent brick computer Programmed in Brick Logo Strong community Too much expensive (cost: ~ $349) i-cubex Objects respond to human actions and environmental parameters Human Interface Devices Easy but expensive Phidgets Easy-to-assemble sensors and controllers Not open source (proprietary) Requires less hardware and software knowledge ~ 3.5 x the cost of Arduino board 8

Some Competitors - 2 Make Controller Kit More powerful CPU than Arduino Has quite a lot of "bang for the buck" Raspberry It is closer to a computer Includes CPU, USB ports, Ethernet, HDMI,... Includes an own OS (Linux) Teensy Same Arduino firmware Compatible with Arduino Very small size UDOO Merges Arduino and Raspberry Powerful prototyping platform Linux or Android OSs 9

The three key concepts of Arduino Project Hardware Can sense the environment by sensors, and affects it by controlling lights, motors, and other actuators. Environment Allows to write code in the Arduino programming language and using the Arduino development environment. Community It is made up of everyone from and to hobbyists, students, designers and engineers all across the world. 10

Why should we use Arduino? Simple, academic purposes Open source Hardware & Software: permits to manufacture the boards and software distribution by anyone Arduino compatibile: Canaduino, Freeduino, Linduino, SainSmart,... GNU Lesser General Public License (LGPL) Opportunistic prototyping Community Wiki Forum Tutorials Could be used as an IoT starting point Physical computing objects 11

2006: New Generation (NG) ATmega168 First Mini Arduino 2007: Portable and communication i-bluetooth Sew-through contacts pads 2009: Nano and LilyPad New Arduino Mega with ATmega1280 2010: Rapid development Official Arduino Uno 2012: Miniaturization and CPU power enhance LilyPad Simple/Snap and Micro Arduino Due (32 bit) 12

Evolution of Arduino 2013: 700.000 official boards were sold 2016: 17 versions of the Arduino board have been commercially produced. 13

Some Current Arduino Boards UNO Current official reference of Arduino Boards Most used and documented board Mega Designed for more complex projects 54 digital I/O pins, 16 analog inputs ATmega2560 LilyPad Designed for e-textiles and wearables projects Can be sewn to fabric and to power supplies Nano Compact board similar to the UNO 14

Arduino as Physical Computing Platform Physical Computing involves the design of interactive objects that can communicate with humans using sensors and actuators controlled by a behaviour implemented as software running inside a microcontroller. 15

Smart Objects in the Internet Of Things IoT is a new emerging technology where the things are connected altogether and interact Arduino provides the tools Remote processing of data Connection of physical objects to the Internet IoT Manifest Open SW & HW: Possibility to share works More innovation Sustainable Devices should be easily upgraded Fair You should have control of your devices Security 16

Arduino Cloud A new platform to make building IoT Creation of tools that allow connection and control of device on/by the Internet MQTT broker makes connection between each object 17

Home Control and Automation 18

Arduino Usage Examples Beat Bearing 19

Arduino Usage Examples Twitter Lamp 20

TeleBall (Breakout game) 21

Other Examples 22

Arduino Architecture and Components 23

General Architecture Main components AVR Microcontroller Analog and digital I/O pins Flash memory Integrated in the microcontroller USB port for serial communication USB ATmega328 DC power jack 24

Components: mandatory Wires USB connector Prototyping board (breadboard) Resistors and leds 25

Components: I/O devices 26

Components: communication devices Wired and Wireless comm. devices Infrared WiFi Bluetooth Zig-Bee Ethernet 27

Characteristics - 1 Arduino UNO (ATmega 328) Technical characteristics Clock speed: 16 MHz (Intel 286: 12.5 MHz) - 8-bit Flash program memory: 32 KBytes (0.5 used by bootloader) SRAM: 2 KBytes Input / Output 14 digital input/output pins 6 analog input pins 6 analog output pins (PWM) 28

Characteristics - 2 Layout of Arduino UNO 1 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Analog Reference pin Digital Ground Digital pins 2-13 Digital pins 0-1/Seral In/Out Reset Button In-circuit Serial Programmer Analog In pins 0-5 Power and Ground pins External Power Supply In USB port 2 3 4 10 6 5 9 8 7 29

Digital and Analog pins Digital pins have only two values on/off (0/1) Arduino UNO has 14 digital I/O pins To connect devices that read/produce digital values (switch, leds,...) Analog pins use many states using quantization Arduino UNO has 6 input analog pins To read analog sensors (temperature, pressure,... ) An A/D converter of 10 bit returns integers from 0 to 1023 30

Digital and Analog pins Analog output pins use PWM technique Arduino UNO has 6 digital pins used as PWM (~) The signal is affected on the input pulse duration 31

Programming in Arduino 32

Life Cycle of a program power ON reset press reset Global Variables Declare variables Initialize variables setup() Run once at beginning Set pins loop() Run the main program Repeatedly, after the setup 33

Arduino IDE software Friendly Multi Platform application written in Java Allows you to write programs and upload them to your Arduino board Derived by "Processing" IDE Initially developed in 2003 to simplifies electronic projects Very simple for novice programmers Simple programming language Bootloader Source code of IDE and library are distributed under the free GNU GPLv2 license 34

Arduino IDE software Text editor containing syntax highlighting and automatic indentation Toolbar Text Console Compiler Serial monitor to debug Sketch filled with the two basic Arduino functions: the setup() and loop(). Allows you to read the data that Arduino communicates through the COM serial port 35

Online IDE - Web Editor 36

Wiring-based Language Open Source computer programming language Derived by C/C++ language With some slight simplifications and modifications Includes classical libraries and functions Data types (Integer, float, long, character,...) Operators (Mathematical, logical, comparison,...) Control statements (If, switch/case, while, for,...) Offer to the programmer simple access to I/O devices Wiring programs are called sketch 37

Some functions setup() pinmode(pin, Input Output) or output Serial.begin(9600) talk to the computer at 9600 baud rate loop() set pin ledpin as an input Some values: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200 write text on Serial Monitor Serial.print("... ") digitalwrite(pin, HIGH LOW) digitalread(pin) analogread(pin) analogwrite(pin, intvalue) delay(milliseconds) set a digital pin high/low read a digital pin's state read an a analog pin write an "analog" PWM value wait an amount of time 38

Arduino's Hello World: LED blinking /* Blink Turn on and off a LED every one second */ int ledpin = 13; // LED connected to digital pin 13 void setup() { Serial.begin(9600); pinmode(ledpin, OUTPUT); // sets the digital pin as output } // the loop routine runs over and over again forever: void loop() { digitalwrite(ledpin, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalwrite(ledpin, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } 39

Arduino's Hello World: LED blinking /* Blink Turn on and off a LED every one second */ int ledpin = 13; // LED connected to digital pin 13 Initialise the variable with the pin number void setup() { Serial.begin(9600); pinmode(ledpin, OUTPUT); // sets the digital pin as output } // the loop routine runs over and over again forever: void loop() { digitalwrite(ledpin, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalwrite(ledpin, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } 40

Arduino's Hello World: LED blinking /* Blink Turn on and off a LED every one second */ int ledpin = 13; // LED connected to digital pin 13 void setup() { Serial.begin(9600); pinmode(ledpin, OUTPUT); // sets the digital pin as output } Setup the serial connections and LED // the loop routine runs over and over again forever: void loop() { digitalwrite(ledpin, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalwrite(ledpin, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } 41

Arduino's Hello World: LED blinking /* Blink Turn on and off a LED every one second */ int ledpin = 13; // LED connected to digital pin 13 void setup() { Serial.begin(9600); pinmode(ledpin, OUTPUT); // sets the digital pin as output } Turn the LED on and off // the loop routine runs over and over again forever: continuously in the loop void loop() { digitalwrite(ledpin, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalwrite(ledpin, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } 42

LED and Servo control via Android Application 43

Thank you for the attention Daniele Ronzani dronzani@math.unipd.it 44