Arduino workshop - hello real world

38
Hello real world! An introduction to physical computing Tom Luyten & Gaston Jamin

Transcript of Arduino workshop - hello real world

Page 1: Arduino workshop - hello real world

Hello real world!An introduction to physical computing

Tom Luyten & Gaston Jamin

Page 2: Arduino workshop - hello real world
Page 3: Arduino workshop - hello real world

• Blinks LEDS• Drives motors• Makes sound• Senses your presence• Detects gas• …

Page 4: Arduino workshop - hello real world

= electronic prototypingtool for designers

Page 5: Arduino workshop - hello real world

Anatomy of an interactive device

Source: Getting started with Arduino – Massimo Banzi

Page 6: Arduino workshop - hello real world

Some possible hardware sensors:• potentiometer• Sliding potentiometer• Switch• Tiltswitch• Accelerometer• Proximity sensor• Photocell• Flexometer• Camera• WII• Kinect• Force sensing sensor• Temperature sensor• Gas sensor• Barometric sensor• Humidity sensor• RFID reader• GPS• Reed switch• Gyroscope• ...

Page 7: Arduino workshop - hello real world

Some possible hardware actuators:• Vibration motor• Regular motor• Sound• Muscle stimulus• Light• images• The web• Pump• Solenoid• Resistance wire• Relais• Radio frequency• …

Page 8: Arduino workshop - hello real world

Boundaries are not definedExample: a tablet can be it’s own sensor and actuator, or can be paired/extended.

Arduinocomputer

tabletcloud

cell phone

Source: Getting started with Arduino – Massimo Banzi

Page 9: Arduino workshop - hello real world

workshop

Page 10: Arduino workshop - hello real world

USB connection

Power source(external)

Digital in/outputs + PWM*

5V + ground Analog in/outputs

processor

*PWMpulse width modulation : digital signal mimmicing an analogue oneused to fade lights, drive motors, create tone,…

Page 11: Arduino workshop - hello real world

The arduino way“the Arduino philosophy is based on making designs rather

than talking about them. It is a constant search for faster

and more powerful ways to build better prototypes. We

have explored many prototyping techniques and developed

ways of thinking with our hands.: • Prototyping• Tinkering• Patching• Circuit bending• Hacking• collaboration

Page 12: Arduino workshop - hello real world

Electronics 101

Page 13: Arduino workshop - hello real world

• Current is a circle – starts at an i/o port, flows to GRND

• Use red for positive wires (from output)• Use black for negative wires (to GRND)

• Look it up, before you hook it up

Page 14: Arduino workshop - hello real world

Get the software

• Current is a circle – starts at an i/o port, flows to GRND • Look it up, before you hook it uphttp://www.arduino.cc

Page 15: Arduino workshop - hello real world
Page 16: Arduino workshop - hello real world
Page 17: Arduino workshop - hello real world

http://arduino.cc/en/Guide/Environment

Page 18: Arduino workshop - hello real world

Standalone example

Page 19: Arduino workshop - hello real world

Hello world! (=blink)

Page 20: Arduino workshop - hello real world

Hello world! (=blink)/* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ // Pin 13 has an LED connected on most Arduino boards.// give it a name:int led = 13;

// the setup routine runs once when you press reset:void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); }

// the loop routine runs over and over again forever:void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second}

File examples basics BLINK

Page 21: Arduino workshop - hello real world

Hello world! (=blink)

Plug inPress play…HELLO WORLD!

Page 22: Arduino workshop - hello real world

Image: adafruit learning systems

Producing sound

Page 23: Arduino workshop - hello real world

Producing sound

Image: adafruit learning systems

Page 24: Arduino workshop - hello real world

Producing sound

/*Adafruit Arduino - Lesson 10. Simple Sounds*/ int speakerPin = 12; int numTones = 10;int tones[] = {261, 277, 294, 311, 330, 349, 370, 392, 415, 440};// mid C C# D D# E F F# G G# A void setup(){ for (int i = 0; i < numTones; i++) { tone(speakerPin, tones[i]); delay(500); } noTone(speakerPin);} void loop(){}

http://learn.adafruit.com/adafruit-arduino-lesson-10-making-sounds/playing-a-scale

Page 25: Arduino workshop - hello real world

Sensing distancehttp://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor

Page 26: Arduino workshop - hello real world

Sensing distanceFile examples sensors PING

Page 27: Arduino workshop - hello real world

Combination

Page 28: Arduino workshop - hello real world

CombinationBlackboard

Page 29: Arduino workshop - hello real world

Make Arduino talk to your computer

Page 30: Arduino workshop - hello real world

Make Arduino talk to your computerhttp://www.processing.org

Page 31: Arduino workshop - hello real world

Make Arduino talk to your computerhttp://www.processing.org

Page 32: Arduino workshop - hello real world

Make Arduino talk to your computerhttp://www.processing.org

Page 33: Arduino workshop - hello real world

Serial communication send

Page 34: Arduino workshop - hello real world

Serial communication receive

Page 35: Arduino workshop - hello real world
Page 36: Arduino workshop - hello real world

This is just a start

There are tons of• Tutorials• Code snippets• Wiring diagramsAvailable to aid you in your experiments

See the Blackboard environment for links.

Page 37: Arduino workshop - hello real world

Next week…

Page 38: Arduino workshop - hello real world

Tinker, hack, break, rebuild, connect and explore!