29
INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINO Rémi Patiès 19 JUIN 2012

INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

INTRODUCTION TO OPEN-SOURCE ELECTRONIC WITH ARDUINO

Rémi Patiès 19 JUIN 2012

Page 2: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

CONTENT

2

1 Introduction

2 Arduino hardware

3 Arduino software

4 Example

5 Conclusion

Page 3: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

1. INTRODUCTION

3

Page 4: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

4

What is Physical Computing ?

Page 5: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Physical Computing

5

Means building interactive physical systems by the use of

software and hardware that can sense and respond to

the analog world - Wikipedia

“A connection between software and the world”

Page 6: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

What is Arduino?

6

An open-source electronic prototyping platform

• An physical board

• A programming environment

• A great community

Project began in Italy in 2005

Co-founders of the project Gianluca Martino, Massimo Banzi, David Cuartielles

Page 7: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Arduino Hardware

7

• Licence: Creative Commons Attribution Share-Alike 2.5

• Price: 30$

Many Hardware designs

Page 8: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Arduino Software

8

• Licence LGPL

• Price: free

• Multi-platform

Arduino Integrated Development Environment

Page 9: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

What can you do with it?

9

• Robotics

• Home automation

• Music

• Sensor Network • Interactive objects

• Interactive art

• Interactive spaces

• Interactive…

Page 10: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

10

Page 11: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

- 11

Page 12: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

- 12

Page 13: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

- 13

Page 14: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

2. ARDUINO HARDWARE

14

Page 15: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Overview

15

• Based on the microcontroller ATmega328

• 14 digital input/output pins

• 6 analog inputs • 16MHz crystal oscillator

• USB connection

• A power jack

• ICSP header

• Power outputs • Reset button

Top Bottom

Page 16: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Power

16

• Powered via USB connection or with an external power

source

• Vin Input pin

• 5v output pin

• 3v3 output pin

• GND

Memory

• Flash Memory : 32KB (0,5KB used by bootloader)

• SRAM: 2KB

• EEPROM: 1KB

Page 17: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Input and Output

17

• 14 digital input/output pins

• Receive (RX) and transmit (TX) serial data

• PWM

• SPI communication

• 6 analog inputs

• Input Voltage Recommended (7-12V)

Page 18: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Input example - sensor

18

• Motion detection

• Light detection

• Button

• Joystick

• Accelerometers

• Gyroscope

• Microphone

• GPS…

Page 19: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

• Screen (LCD)

• Light (LED) • Servo

• Motors

• Loudspeaker…

Output example

19

Page 20: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Communication

20

• RF shields • USB

• Wi-Fi

• Ethernet

• Bluetooth…

Page 21: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

3. ARDUINO SOFTWARE

21

Page 22: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Overview

22

Page 23: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Langage

23

• C/C++ • Cf. the Web…

http://arduino.cc/en/Reference/HomePage

Page 24: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

The "Hello World!" of Physical Computing!

24

/* Blinking LED */

int ledPin = 13; // LED connected to digital pin 13

void setup()

{

pinMode(ledPin, OUTPUT); // sets the digital pin as output

}

void loop()

{

digitalWrite(ledPin, HIGH); // sets the LED on

delay(1000); // waits for a second

digitalWrite(ledPin, LOW); // sets the LED off

delay(1000); // waits for a second

}

Page 25: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

4. EXAMPLE

25

Page 26: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Gmail Notifier

26

• Idea: • build a physical mail notifier

• How?

• Python script

• Connect to my Google mail account

• Return number of mails to Arduino Board via

a serial connection

• Arduino

• Get the number of mail • Turn On/Off appropriate LEDs

• Batch files

• Launch python script every x seconds

Page 27: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

4. CONCLUSION

27

Page 28: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Advantages and disadvantages

28

• “ It’s Fun ! ” • Price

• Great Community

• Resources

• there are libraries for almost everything

• There are shields for almost everything

• Easy development

• “ But It’s limited… ” • Performances (Signal processing….)

• Memory = 32KB

Page 29: INTRODUCTION TO OPEN- SOURCE ELECTRONIC WITH ARDUINOsed.bordeaux.inria.fr/seminars/arduino_20120619.pdf · ARDUINO Rémi Patiès 19 JUIN 2012 . CONTENT 2 1 Introduction 2 Arduino

Persuaded ???

Thanks!

29