The document describes a workshop on prototyping connected devices using Arduino. It introduces Arduino and its components. It then discusses an exercise where participants prototype a music cube that controls music playback with gestures. Participants design, build, and test a cube prototype that uses an accelerometer sensor and Arduino microcontroller. The cube connects to a computer and plays MP3 files. Areas for improvement and further applications are discussed.
5. IxDA 14
Getting Real with Connected Devices
We transform
the way people
experience
brands
5
Thursday, February 6, 14
6. IxDA 14
Getting Real with Connected Devices
R/GA
Make Day
7
Thursday, February 6, 14
7. IxDA 14
Getting Real with Connected Devices
Why
prototype?
9
Thursday, February 6, 14
8. IxDA 14
Getting Real with Connected Devices
Experience
wins over
specification
From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
10
9. IxDA 14
Getting Real with Connected Devices
Reduces
misinterpretation
From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
11
10. IxDA 14
Getting Real with Connected Devices
Saves time,
money & effort
From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
12
11. IxDA 14
Getting Real with Connected Devices
Reduces waste
From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
13
12. IxDA 14
Getting Real with Connected Devices
Prototyping
is generative
From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
14
13. IxDA 14
Getting Real with Connected Devices
The opportunity
to craft
15
Thursday, February 6, 14
14. IxDA 14
Getting Real with Connected Devices
Design
by making
16
Thursday, February 6, 14
34. IxDA 14
Getting Real with Connected Devices
Variable - Store things
String myName = “Sebastien”; // a string
int myAge = 10; // an integer
float myHight = 1.78; // a float
bool isMale = true; // a boolean
35
Thursday, February 6, 14
35. IxDA 14
Getting Real with Connected Devices
If / Else Statements - Conditions
int myAge = 10;
String myName = “”;
If(myAge==20) // false
{
myName = “Sebastien”;
}
else // do this now
{
myName = “Ilia”;
}
36
Thursday, February 6, 14
36. IxDA 14
Getting Real with Connected Devices
Functions
Self-contained bit of code that can be called whenever. It
can take parameters and return a value.
Important uses:
- Encapsulate code/functionality
- Stops code duplication
37
Thursday, February 6, 14
37. IxDA 14
Getting Real with Connected Devices
Functions
void storeMyName()
{
myName = “Sebastien”;
}
storeMyName(); // stores Sebastien in myName
String getMyName()
{
return “Sebastien”;
}
getMyName(); // returns Sebastien
int multiply(int firstNumber, int secondNumber)
{
int result = firstNumber * secondNumber;
return result;
}
multiply( 2, 2); // returns 4
38
Thursday, February 6, 14
38. IxDA 14
Getting Real with Connected Devices
Basic Arduino Sketch
The setup() function is called when a sketch starts.
Use it to initialize variables, pin modes, start using
libraries, etc. The setup function will only run once,
after each power up or reset of the Arduino board.
The loop() function does precisely what its name
suggests, and loops consecutively, allowing your
program to change and respond. Use it to actively
control the Arduino board.
39
Thursday, February 6, 14
39. IxDA 14
Getting Real with Connected Devices
Debugging
void setup(){
Serial.begin(9600);// opens serial
port, sets data rate to 9600 bps
}
void loop(){
Serial.println("Hello World!");
}
40
Thursday, February 6, 14
40. IxDA 14
Getting Real with Connected Devices
Exercise 1:
Flashing LED
41
Thursday, February 6, 14
41. IxDA 14
Getting Real with Connected Devices
Flashing LED - schematic
42
Thursday, February 6, 14
42. IxDA 14
Getting Real with Connected Devices
Flashing LED - Arduino code
int ledPin=10;
//set IO pin of LED in control
void setup()
{
pinMode(ledPin,OUTPUT); //set digital pin
IO is OUTPUT
}
void loop()
{
digitalWrite(ledPin,HIGH);
//set PIN 10to HIGH
delay(1000);
//delay 1000ms, 1000ms = 1s
digitalWrite(ledPin,LOW);
//set PIN 10 is LOW, 0V
delay(1000);
//delay 1000ms, 1000ms = 1s
}
43
Thursday, February 6, 14
43. IxDA 14
Getting Real with Connected Devices
The Brief
44
Thursday, February 6, 14
44. IxDA 14
Getting Real with Connected Devices
The Brief
A new music streaming service wants to create a
‘connected device’ that will be able to interact with
the service.
They want to create an experience that is new, and
fun. They want to launch within a year and they want
to keep the price point around €100
You have access to any sensors in your kit, plus an
accelerometer (that measures angles of rotations).
45
Thursday, February 6, 14
46. IxDA 14
Getting Real with Connected Devices
The Cube
47
Thursday, February 6, 14
47. IxDA 14
Getting Real with Connected Devices
The Idea
48
Thursday, February 6, 14
48. IxDA 14
Getting Real with Connected Devices
The Idea
49
Thursday, February 6, 14
49. IxDA 14
Getting Real with Connected Devices
The Idea
A cube that controls music with gestures
Wireless
Directly connected to music streaming service
No need for a computer or other device
Connects to a wireless speaker
50
Thursday, February 6, 14
50. IxDA 14
Getting Real with Connected Devices
Designing the prototype
A cube that controls music with gestures
Wireless
Directly connected to music streaming service
No need for a computer or other device
Connects to a wireless speaker
51
Thursday, February 6, 14
51. IxDA 14
Getting Real with Connected Devices
Designing the prototype
A cube that controls music with gestures
Connect via USB
Play MP3s instead
Connect to computer
Connects to a wireless speaker
58
Thursday, February 6, 14
52. IxDA 14
Getting Real with Connected Devices
Arduino +
Processing
59
Thursday, February 6, 14
53. IxDA 14
Getting Real with Connected Devices
Processing
60
Thursday, February 6, 14
54. IxDA 14
Getting Real with Connected Devices
Speaking to Arduino
via USB
61
Thursday, February 6, 14
55. IxDA 14
Getting Real with Connected Devices
The Environment
62
Thursday, February 6, 14
56. IxDA 14
Getting Real with Connected Devices
Building the
Cube
63
Thursday, February 6, 14
57. IxDA 14
Getting Real with Connected Devices
The Sensor
64
Thursday, February 6, 14
58. IxDA 14
Getting Real with Connected Devices
Accellerometer + Gyro:
MPU6050
65
Thursday, February 6, 14
59. IxDA 14
Getting Real with Connected Devices
Accellerometer + Gyro:
MPU6050
X
66
Thursday, February 6, 14
Z
Y
60. IxDA 14
Getting Real with Connected Devices
Accellerometer + Gyro:
MPU6050
X
67
Thursday, February 6, 14
Z
Y
61. IxDA 14
Getting Real with Connected Devices
Accellerometer + Gyro:
MPU6050
X
68
Thursday, February 6, 14
Z
Y
62. IxDA 14
Getting Real with Connected Devices
Building
the Circuit
69
Thursday, February 6, 14
63. IxDA 14
Getting Real with Connected Devices
The Components
70
Thursday, February 6, 14
64. IxDA 14
Getting Real with Connected Devices
Putting it Together
Accelerometer
+ Gyro
VCC
GND
SCL
SDA
71
Thursday, February 6, 14
Arduino
3.3V
GND
A5
A4
65. IxDA 14
Getting Real with Connected Devices
The Files
72
Thursday, February 6, 14
66. IxDA 14
Getting Real with Connected Devices
The Arduino Files
MPU6050_DMP6.ino
MPU6050.h
MPU6050.cpp
I2Cdev.h
I2Cdev.ccp
helper_3dmath.h
MPU6050_6Axis_MotionApps20.h
The main Arduino program
that the other files support
To facilitate communication
with the sensor
These 2 files are math
helpers to get the rotations
https://github.com/jrowberg/i2cdevlib/tree/master/Arduino
73
Thursday, February 6, 14
67. IxDA 14
Getting Real with Connected Devices
1. Getting data
from the sensor
with the Arduino
74
Thursday, February 6, 14
68. IxDA 14
Getting Real with Connected Devices
2. Reading data
from Ardiuno
with Processing
75
Thursday, February 6, 14
69. IxDA 14
Getting Real with Connected Devices
3. Using the data
in Processing
76
Thursday, February 6, 14
70. IxDA 14
Getting Real with Connected Devices
Building
the Box
77
Thursday, February 6, 14
71. IxDA 14
Getting Real with Connected Devices
Building the Box
78
Thursday, February 6, 14
72. IxDA 14
Getting Real with Connected Devices
Building the Box
79
Thursday, February 6, 14
74. IxDA 14
Getting Real with Connected Devices
How can it be improved?
Usability issues?
Communication of functionality?
Better feedback?
Other forms?
Unexpected ideas?
Additional functionlity?
How to navigate playlists?
81
Thursday, February 6, 14
75. IxDA 14
Getting Real with Connected Devices
Sketching
82
Thursday, February 6, 14
79. IxDA 14
Getting Real with Connected Devices
Re-using the
interaction
model
86
Thursday, February 6, 14
80. IxDA 14
Getting Real with Connected Devices
Stay in
Touch
87
Thursday, February 6, 14
81. IxDA 14
Getting Real with Connected Devices
rgaixda14.tumblr.com/submit
88
Thursday, February 6, 14
82. IxDA 14
Getting Real with Connected Devices
Further
Reading
89
Thursday, February 6, 14
83. IxDA 14
Getting Real with Connected Devices
Further Reading
90
Thursday, February 6, 14
Getting Started
with Arduino by
Massimo Banzi
Getting Started
with Processing by
Casey Reas & Ben Fry
Making Things Talk
by Tom Igoe