Post on 20-Aug-2015
Hello real world!An introduction to physical computing
Tom Luyten & Gaston Jamin
• Blinks LEDS• Drives motors• Makes sound• Senses your presence• Detects gas• …
= electronic prototypingtool for designers
Anatomy of an interactive device
Source: Getting started with Arduino – Massimo Banzi
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• ...
Some possible hardware actuators:• Vibration motor• Regular motor• Sound• Muscle stimulus• Light• images• The web• Pump• Solenoid• Resistance wire• Relais• Radio frequency• …
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
workshop
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,…
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
Electronics 101
• 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
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
http://arduino.cc/en/Guide/Environment
Standalone example
Hello world! (=blink)
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
Hello world! (=blink)
Plug inPress play…HELLO WORLD!
Image: adafruit learning systems
Producing sound
Producing sound
Image: adafruit learning systems
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
Sensing distancehttp://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor
Sensing distanceFile examples sensors PING
Combination
CombinationBlackboard
Make Arduino talk to your computer
Make Arduino talk to your computerhttp://www.processing.org
Make Arduino talk to your computerhttp://www.processing.org
Make Arduino talk to your computerhttp://www.processing.org
Serial communication send
Serial communication receive
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.
Next week…
Tinker, hack, break, rebuild, connect and explore!