Professional Documents
Culture Documents
003
CONNECTING ARDUINO + GRASSHOPPER
PRIMER BY JASON K JOHNSON AND ANDREW PAYNE
Firefly Primer - Firefly Version 1.003
By Jason K Johnson and Andrew Payne
Copyright 2010 All Rights Reserved
The Firefly toolbar, Primer and several example files were released in conjunction with the
AA/CCA Biodynamic Structures Summer 2010 Workshop hosted by the CCA in San Francisco
in July 2010. Over the course of the workshop Firefly was beta-tested by over 40 participants.
Although we have worked for months to design, build and test Firefly, we are excited to have
the opportunity to share it with a larger user group. We encourage you to e-mail us comments,
corrections and suggestions: info@fireflyexperiments.com
Andrew Payne
LIFT Architects / Harvard GSD, Cambridge MA.
www.liftarchitects.com
Technical Collaborators:
Robert Lee has made critical contributions to the Firefly project. We want to thank him for his
continued support. A full list of acknowledgements is listed on the Firefly blog.
“If architects designed a building like a body, it would have a system of bones and muscles and
tendons and a brain that knows how to respond. If a building could change its posture, tighten
its muscles and brace itself against the wind, its structural mass could literally be cut in half.”
-Guy Nordenson, Princeton University / Nordenson and Associates
“We foresee the possibility that most (if not all) architectural space will become responsive
and be animated through intelligent kinetic capacities. Each space will have a series of sensors
which allow the occupational patterns within the space to be registered and fed back into
the intelligent responsive structures. This can operate on many scales and levels. I think what
emerges is a new era within architecture, or between architecture and some other disciplines
…”
-Patrick Schumacher (from an interview conducted by Alessandra Belia on 10 Feb 2004)
Images: Kuka fabrication robot, Aegis Wall, MIT Senseable Cities Lab,
Makerbot personal fabricator, Usman Haque, Future Cities Lab
Firefly Primer - Firefly Version 1.003 - Page 4
Table of Contents
INTRODUCTION 03
Table of Contents 05
You will need to install the following software packages/plug-ins to use Firefly. For Steps 04-05 you will need an
Arduino board and USB cable. For the the purposes of these introductory tutorials we are assuming that you
will be using the Arduino Duemilanove board. Support for other boards will be published in the next version of
the Firefly Primer.
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
Confirm the installation: Launch Rhino 4.0 SR8; Type “grasshopper” in the Command prompt; Once
Grasshopper has launched in a new window - confirm that the Firefly tab has been added (see image below).
Congratulations you have installed the Firefly plug-in!!!
Firefly Tab
Blink Me !!!
USB
///////////////////////////////////////////////////////
Note: The first time you run the Arduino software, it will automatically create a directory for your Sketchbook.
You can view or change the location of the sketchbook location with the File > Preferences dialog. The sketches
in your sketchbook can be opened from the File > Sketchbook menu or from the Open button on the toolbar.
Upload Button
e. Upload the Program: Simply click the “Upload” button. Wait a few seconds - you should see the RX and TX
leds on the board flashing. If the upload is successful, the message “Done uploading.” will appear in the status
bar. You will keep the USB connected to the Arduino - this is how Firefly will communicate with the sensors,
motors and LEDS connected to the board.
Congratulations - your Arduino board is now ready to communicate with Grasshopper / Firefly!!!
Firefly Toolbar
BOARDS
Duemilanove Read - read values on all digital and analog Arduino DUEM pins
Duemilanove Write- write values on all digital and analog Arduino DUEM pins
Mega Read - read values on all digital and analog Arduino MEGA pins
Mega Write - write values on all digital and analog Arduino MEGA pins
Open Port - open the serial port, set the port number and the baud rate
OTHER INPUTS
UTILITY
Binary Blink - oscillates 0’s and 1’s based on an incoming pattern of integers
Buffer - Store the last number of values based on the buffer domain
Fader One-Way - fade between one value to another based on a time interval
Fader Two-Way - fade between a min and max value based on fade in /out
Playback - the playback component will retrieve values from a text file (.txt, .csv, and .dat)
Smoothing - Smooth (or average) an incoming value Firefly Primer - Firefly Version 1.003 - Page 8
2.1 Open Port
A
Step 01. Set the Step 02. Toggle
Port number Open to “True”
The Open Port component allows you to establish the connection between the Arduino and Grasshopper. First,
confirm the communication Baud Rate (Since 9600 works for just about everything - beginners can skip this
step!). Second, Set the Port Number [A] and then Open or Close the Serial Port Connection using a True/False
Toggle [B] [False = Port Closed; True = Port Open]. The Firefly Duemilanove Read/Write and Mega Read/Write
components will only send/receive data if the port is open.
Note: Always close the serial port before closing your Grasshopper sketch. If you do not close your port then the
next time you open the file you will encounter a pop-up screen with a whole series of nasty errors messages!
* You can use multiple Open Port components to connect multiple Arduino boards to Firefly.
Input parameters:
Open (Boolean) Boolean (True/False) value to Open or Close the Serial Port
Port (Integer) The Port Number has to be the same Serial Port assigned in the Arduino Sketch. You can find
which COM port [C] you are using by clicking on the Tools>Serial Port button on the Arduino IDE (see below).
Baud (Integer) The BaudRate value should match the speed set in the Arduino sketch. Standard values: 4800,
9600, 14400, 19200, 28800, 38400, 57600.
Output parameters:
Msg (String) Current status of Serial Port
The FireFly Duemilanove Read component will read values for all corresponding digital and analog pins on the
Arduino Duemilanove, Diecimilla, or Lillypad board. Note: This component is meant to be used in tandem with
the FireFly Duemilanove Arduino program (a .pde file) which can be downloaded from the Firefly website at:
www.fireflyexperiments.com
[A] Port: This should match the Port number that you first established in the Open Port component
Input Parameters:
Start (Boolean) Input an Boolean value (True/False) to start receiving values from the Arduino
Port (Integer) The Port Number has to be the same Serial Port assigned in the Arduino Sketch.
Timer (Boolean) Set a Boolean Toggle to turn the timer on (True) or off (False)
Rate (Integer) Time interval (ms) to wait after the solution has been expired. The default is for the timer to up-
date at its fastest possible rate. It you only want to read your sensors every 2 seconds you would enter “2000”
here, or every half second would be “500”, etc.
Output Parameters:
APin0 (Integer) Incoming sensor value from Analog In Pin 0
APin1 (Integer) Incoming sensor value from Analog In Pin 1
APin2 (Integer) Incoming sensor value from Analog In Pin 2
APin3 (Integer) Incoming sensor value from Analog In Pin 3
APin4 (Integer) Incoming sensor value from Analog In Pin 4
APin5 (Integer) Incoming sensor value from Analog In Pin 5
DPin2 (Integer) Incoming sensor value from Digital In Pin 2
DPin4 (Integer) Incoming sensor value from Digital In Pin 4
DPin7 (Integer) Incoming sensor value from Digital In Pin 7
Msg (String) Current status of Serial Port
The FireFly Duemilanove Write component will write values for all corresponding digital pins on an Arduino
Duemilanove, Diecimilla, or Lillypad board. Note: This component is meant to be used in tandem with the Fire-
Fly Duemilanove Arduino Sketch (a .pde file) which can be downloaded from the Firefly website at:
www.fireflyexperiments.com
Note: The current Firefly Firmata build assigns Digital (PWM) Pins 9, 10, and 11 for use with Servo engines,
and Digital Pins 3, 5, 6 are dedicated to Digital (PWM) for LEDS etc. All other Digital Pins can be used for Digital
Write (HIGH/LOW).
[A] Port: This should match the Port number that you first established in the Open Port component
Input parameters:
Start (Boolean) Input an Boolean value (True/False) to start writing values to the Arduino
DPin13 (Integer) Integer to write to Digital Pin13. The integer (0) will send a LOW value and a (1) will send a
HIGH value.
DPin12 (Integer) Integer to write to Digital Pin12. The integer (0) will send a LOW value and a (1) will send a
HIGH value.
DPin11* (Integer) Integer to write to Digital Pin 11. If the PWM button is not checked, then the integer (0) will
send a LOW value and a (1) will send a HIGH value. If the PWM button is checked, then any PWM value be-
tween 0-255 can be sent to the specified pin.
DPin10* (Integer) Integer to write to Digital Pin 10. If the PWM button is not checked, then the integer (0) will
send a LOW value and a (1) will send a HIGH value. If the PWM button is checked, then any PWM value be-
tween 0-255 can be sent to the specified pin.
DPin9* (Integer) Integer to write to Digital Pin 9. If the PWM button is not checked, then the integer (0) will
send a LOW value and a (1) will send a HIGH value. If the PWM button is checked, then any PWM value be-
tween 0-255 can be sent to the specified pin.
DPin8 (Integer) Integer to write to Digital Pin12. The integer (0) will send a LOW value and a (1) will send a
HIGH value.
Firefly Primer - Firefly Version 1.003 - Page 11
DPin6* (Integer) Integer to write to Digital Pin 6. If the PWM button is not checked, then the integer (0) will
send a LOW value and a (1) will send a HIGH value. If the PWM button is checked, then any PWM value be-
tween 0-255 can be sent to the specified pin.
DPin5* (Integer) Integer to write to Digital Pin 5. If the PWM button is not checked, then the integer (0) will
send a LOW value and a (1) will send a HIGH value. If the PWM button is checked, then any PWM value be-
tween 0-255 can be sent to the specified pin.
DPin3* (Integer) Integer to write to Digital Pin 3. If the PWM button is not checked, then the integer (0) will
send a LOW value and a (1) will send a HIGH value. If the PWM button is checked, then any PWM value be-
tween 0-255 can be sent to the specified pin.
Output parameters:
Out (String) Returns the string that will be sent to the Arduino board. The Arduino sketch that accompanies
this component will split this string up and send the values to the appropriate pins.
Msg (String) Current status of Serial Port
The Arduino Duemilanove (“2009”) is a microcontroller board based on the ATmega168 or ATmega328. It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscil-
lator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to sup-
port the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter
or battery to get started.
“Duemilanove” means 2009 in Italian and is named after the year of its release. The Duemilanove is the latest
in a series of USB Arduino boards; for a comparison with previous versions, see the index of Arduino boards.
The FireFly Mega Read and Write component will read and write values to all corresponding digital and analog
pins on an Arduino Mega board. Note: This component is meant to be used in tandem with the FireFly Mega
Arduino Sketch which can be downloaded from the Firefly website at: www.fireflyexperiments.com
This component is recommended for advanced users only. The Arduino Mega has 54 digital input/output pins
(of which 14 can be used as PWM outputs), 16 analog inputs and more. Detailed specs can be found here:
http://arduino.cc/en/Main/ArduinoBoardMega
Digital Pins 2,3,4,5,6,7 can fade LEDS (PWM option must be selected)
Digital PWM Pins 8,9,10,11,12,13 are capable of controlling Servos (PWM option must be selected)
Digital Pins 22,23,24,25,26,27,28,29,30,31,32,33 can control digital LEDS (on/off)
Retrieve a value coming over the Serial Port from the Arduino board.
Input parameters:
Start (Boolean) Input an Boolean value (True/False) to start receiving values from the Arduino. Note: You must
first open the serial connection by using the Open Port component (Firefly/Boards/Open Port) before setting
the Start input value to True.
Port (Integer) The Port Number has to be the same Serial Port assigned in the Arduino Sketch. You can find
which COM port you are using by clicking on the Tools>Serial Port button on the Arduino IDE.
Timer (Boolean) Set a Boolean Toggle to turn the timer on (True) or off (False)
Output parameters:
Out (String) The incoming value from the serial connection.
Msg (String) Current status of Serial Port
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
Serial.println(“This message is being sent from the Arduino!”);
delay(100);
}
Input parameters:
Start (Boolean) Input an Boolean value (True/False) to start writing values to the Arduino. Note: You must first
open the serial connection by using the Open Port component (Firefly/Boards/Open Port) before setting the
Start input value to True.
Data (String) String to write to the Serial Port
Port (Integer) The Port Number has to be the same Serial Port assigned in the Arduino Sketch. You can find
which COM port you are using by clicking on the Tools>Serial Port button on the Arduino IDE.
Output parameters:
Out (String) Returns the string that will be sent to the Arduino board.
Msg (String) Current status of Serial Port
Read a file from a Pachube feed. Pachube (http://www.pachube.com ) allows you to store, share and discover
real-time sensor, energy and environment data from objects, devices and buildings around the world. Pachube
is a convenient, secure and scalable platform that helps you connect to and build the internet of things.
(Quoted from Pachube.com). *See the Pachube Read Tutorial in section 3.2 of this Primer
Input parameters
Feed (String): Pachube web address of feed.
API Key (String): Users API Key
Output parameters
csv (String) Returns the CSV output from a given csv pachube feed.
Msg (String) Returns the title and timestamp for the retreival of the pachube feed
ID (String) Returns the XML ID of each element in a pachube feed
Tag (String) Returns the XML Tag of each element in a pachube feed
Min (String) Returns the minimum value of each element in an XML pachube feed
Max (String) Returns the maximum value of each element in an XML pachube feed
Val (String) Returns the current value of each element in an XML pachube feed
Unit (String) Returns the units of each element in an XML pachube feed
Firefly Primer - Firefly Version 1.003 - Page 16
2.9 Wii Nunchuck
This component will allow you to read all of the sensor values from the Wii Nunchuck. Note: This component is
meant to be used in tandem with the Wii Nunchuck Arduino Sketch which can be downloaded from the Firefly
website at: www.fireflyexperiments.com
Input parameters:
Start (Boolean) Input an Boolean value (True/False) to start receiving values from the Arduino. Note: You must
first open the serial connection by using the Open Port component (Firefly/Boards/Open Port) before setting
the Start input value to True.
Port (Integer) The Port Number has to be the same Serial Port assigned in the Arduino Sketch. You can find
which COM port you are using by clicking on the Tools>Serial Port button on the Arduino IDE.
Output parameters:
AccX (Integer): Returns the accelerometer X value
AccY (Integer): Returns the accelerometer Y value
AccZ (Integer): Returns the accelerometer Z value
JoyX (Integer): Returns the joystick value of the X-axis
JoyY (Integer): Returns the joystick value of the Y-axis
Zbut (Integer): Returns the status of the Z button
Cbut (Integer): Returns the status of the C button
Msg (String): Current status of Serial Port
Input parameters:
P (Integer): The blink pattern is a list of integers that will determine the time interval (ms) between the
oscillating output of zero’s or one’s. For instance, a blink pattern of ‘100,200,300,400’ will first output a zero for
100ms, then a one for 200ms, then back to a zero for 300ms, and finally another one for 400ms. If the repeat
toggle has been set to true, this blinking pattern will continue. The smallest time interval that is currently
accepted in the blink patter is 25ms.
S (Boolean): Start/Stop Boolean toggle
R (Boolean): Repeat Pattern
Output parameters:
B (Integer): Binary Output of 0’s and 1’s
Input parameters:
V (Number) Incoming value
D (Domain) Target Domain to store data in the buffer.
Output parameters:
V (Number) The list of buffered values
Mn (Number) The minimum value in the buffer
Mx (Number) The maximum value in the buffer
Input parameters:
Val (Number) Incoming value
Min (Domain) Domain to constrain values
Output parameters:
Val (Number): Constrained Value
Input parameters:
V (String) The incoming data to track
R (Boolean) Reset the log of values
T (Boolean) Start recording values into the data log
W (Boolean) Wrap index to list bounds. If the Wrap value is set to true and the incoming log value exceeds the
length limit, then it will begin re-recording over the previous values from index number zero.
L (Integer) Set the number of values you wish to store in the data log. If an length of zero is set, then the data
log will record values indefinitely (or until you stop the recording).
P (String) Optional file path in your directory to stream the data log
Output parameters:
O (String) The output log of data
Fade between one value to another based on a time interval (ms). These are great components to fade LEDS or
pulsing motors using timed intervals.
Fade between a minimum and maximum value based on the fade in and fade out time interval (ms).
Input parameters:
V1 (Integer) The minimum value for the fade
V2 (Integer) The maximum value for the fade
T or T1 (Integer) The time interval (ms) to fade from the minimum value to the maximum value. The smallest
time interval that will be accepted is 100ms.
T2 (Integer) The time interval (ms) to fade from the maximum value to the minimum value. The smallest time
interval that will be accepted is 100ms.
D or D1 (Integer) A time delay (ms) to wait before after the value has reached the maximum value but before it
starts the fade back to the minimum value.
D2 (Integer) A time delay (ms) to wait before after the value has reached the minimum value but before it
starts the fade back to the maximum value.
S (Boolean) Start/Stop Boolean toggle
Output parameters:
O (Integer) Fading Output
The Playback component will retrieve values from a text file (acceptable file types: .txt, .csv, and .dat) and will
begin returning individual values at a given frame rate(s). You can input multiple framerates to simultaneously
keep track of multiple outputs at different intervals
Input parameters:
P (String) File path(s) to monitor. The playback will remove any timestamp values from the original file.
Acceptable file types include .txt, .csv, and .dat
S (Boolean) Start/Stop Boolean toggle
F (Integer) Frame rate (ms) to the return each value from the file. Currently the smallest frame rate allowed is
25ms.
R (Boolean) Repeat Playback pattern
Output parameters:
O (String) The playback output values
Smooth (or average) an incoming value based on a sampling level. In the illustration above, the raw APin0
sensor value is 673. APin0 is connected to the V parameter. A text Panel holding the number 10 (generally
anything between 10-20 works well) is connected to the N parameter. On the right side of the Smooth
component you can see a text Panel holding the smoothed value of 673.0.
A comparison of the two Value Tracker graphs (above right) best illustrates how effective the smooth
component can be when reading analog sensors like Photoresistors, IR proximity sensors, Accelerometers, etc.
The graph above (B) is jagged and jittery, while the lower graph (A) is relatively smooth and flowing.
Input parameters
Val (Number): Incoming value
N (Integer): The number of samples to average
Output parameters
A (Number): A smoothed average of values.
These additional components are not Firefly specific components but you will use them quite often. They
come pre-packaged as a part of the standard Grasshopper build. You will utilize many of these components
when you use Firefly so it is critical that you know where to find them and how to incorporate them into your
projects. This is a just a sampling of what we consider to be the most important for beginning users - as you get
more advanced you will certainly begin to incorporate many more into your projects. If there are components
or custom clusters that you invent and you think they should be included in the next Firefly Primer - please
leave us a comment on the Firefly website: www.fireflyexperiments.com
Boolean Switch - Toggle a switch between TRUE / FALSE. (True outputs a 0; False outputs a 1)
Number Slider - output a specific range of numbers by sliding a dial lef and right
Input parameters:
V (Number) Values to remap
S (Domain) Optional source domain.
T (Domain) Target domain
Output parameters:
R (Number) Remapped numbers.
Firefly Primer - Firefly Version 1.003 - Page 26
Params > Special > Panel
Panel - output parameters of components, or input parameters into a component (text or numbers).
Panel Description
Panels can receive their information from elsewhere. If you plug an output parameter into a Panel, you can see
the contents of that parameter in real-time. All data in Grasshopper can be viewed in this way.
For this first Firefly tutorial you will utilize the three most basic Firefly components: Open Port, Duemilanove
Read and Duemilanove Write. To begin with - your Arduino board’s USB cable should be connected to your
computer and the green “power” light should on. The “Firefly DUEM Firmata” should also be uploaded to you
board. Next you will place these three Firefly components into your Grasshopper workspace, then you will
prepare them to both read and write data over the USB serial port.
Steps 1 will cover building the actual circuit using an Arduino Board, breadboard, Servo, LEDs
Steps 2-4 will cover the process of setting GH/Firefly Open Port, Read and Write
Steps 5 will cover linking your GH/Firefly sketch to specific geometry
b. STANDARD
SERVO
a. LED
SIG
GND +
c. LED (PWM)
GND 5V
USB
+ GND
1K
10 K
d. PHOTORESISTOR
5V GND SIG
a. LED - Connect the long leg of an LED to Digital Pin 13, and connect the short leg to the second-to-last pin
maked GND. Note that Pin 13 has a built-in resistor. If you attach to any other pin you must use a resistor.
b. STANDARD SERVO - Connect a Stardard Servo to Digital Pin 9. Note that this pin is marked PWM (Pulse
Width Modulation). The standard Firefly build allows you to control servos on Digital Pins 9,10,11 only.
c. LED (PWM) - Connect the long leg off the LED to a resistor and Digital Pin 3, and the other to GND.
d. PHOTORESISTOR - Use a Photoresistor and a 10K resistor to construct the circuit pitured above. Connect the
SIG (signal) to any of your Analog In pins. The circuit above uses Analog Pin 1.
Firefly Primer - Firefly Version 1.003 - Page 28
READ C WRITE
PORT
A
E
H J
F
G
Above - The Duemilanove Write Component (see description on the next page)
d. Add three unique Number Sliders to all the components on the left side of the component. Refer to the
diagram above to locate these three slider types:
[E] 0-1 Slider (Slider Type: Integer; Lower Value: 0 and Upper Value: 1)
[F] Servo Slider (Slider Type: Integer; Lower Value: 0 and Upper Value: 179)
[G] LED Slider (Slider Type: Integer; Lower Value: 0 and Upper Value: 255)
Note on DPins marked with a star* [H]: The DPin11*, DPin10*, DPin9*, DPin6*, DPin5*, Dpin3* parameters
have a “PWM” option (Pulse Width Modulation). If you right click over the DPin parameter text you will see
an option to select PWM [I]. If PWM is selected, Pins 5,6,7 can be used to fade LEDS, and Pins 9,10,11 can
control Servo Motors. These PWM pins correspond the the PWM pins indicated on the Arduino Duemilanove
board. If the PWM button is not checked, then the integer (0) will send a LOW value and a (1) will send a HIGH
value. If the PWM button is checked, then any PWM value between 0-255 can be sent to the specified pin.
The example (below) creates a real-time 3D map of your Analog Inputs and draws a line accross them. We
first connect the 6 outputs from the Duemilanove Read component to the Z input of a Point component
[A]. We then use a Series Component to input (0,5,10,15,20,25) into the Y input [B]. A Pline [C] is used to
connect these points and create a dynamically updating line in space. We then add another corresponding
Point component. These points will be fixed to ground plane. Again, we use the Series Component to input
(0,5,10,15,20,25) into the Y input [D]. The final step is to connect both sets of points with vertical lines [E].
C C
B
A
D
E
E
Figure 1. The Rhino modeling window (left) and Grasshopper Interface (right)
Firefly Primer - Firefly Version 1.003 - Page 30
3.2 - Tutorial: Pachube Read
My Settings
In order to begin monitoring various sensor feeds from pachube.com, you will first need to create an account.
Begin by going to the URL: http://www.pachube.com and click on the Sign Up link at the top of the page. After
providing a unique user name, e-mail address, and password you will be directed back to the pachube home
page.
When logged in, you will notice a grey menu bar at the top of the page with various links to manage your ac-
count. On the far right hand side of this menu, you will find a link to manage “My Settings”. After clicking on
this link, you will be directed to your account settings page where you will find your API Key.
Some Pachube API methods don’t require authentication (primarily those involving syndication and those that
contain no real-time data, for example 24-hour history CSV and graphs). This enables them to be used in third-
party websites or mashups that require public access.
However, most real time data methods do require a Pachube API key. Your API Key is your personal identifica-
tion code that will be required to access many real-time feeds on pachube.
Note: Since your API Key is your personal identifier on pachube, it is crucial that you keep this code private. Do
not share this information with others and make sure you do not share Grasshopper files which may contain
your key inside the document.
Now that we have setup an account, drag and drop a Text Panel onto the canvas. Copy and paste your API Key
(from your account settings) into the Text Panel. Connect the output of this Text Panel to the API Key input
node of the Pachube Read component.
There are several different methods for accessing the thousands of live realtime sensor feeds that are updated
to the pachube servers every minute. Map View allows users to find a feed based on geolocation. Tags are
color coded based on categories: agriculture, buildings, devices, energy, environment, transport, and other.
List View gives users a text based version of all online feeds. Finally, Cloud View provides a list of all feed tags
and scales the text of each tag based on the number of occurrences of each tag (larger fonts indicate the
greater number of occurrences of a given tag). We can also Search Feeds or Tags by using the search box at
the top of the page.
For this tutorial, we will use a feed created by the National Wind Technology Center in Denver, CO. Type the
following web address into your browser: http://www.pachube.com/feeds/1197 . The readings that are dis-
played are derived from instruments mounted on or near an 82 meter (270 foot) meteorological tower located
at 39° 54’ 38.34” N and 105° 14’ 5.28” W (datum WGS84) with its base at an elevation of 1855 meters (6085
feet) above mean sea level.
Each feed’s page (e.g. http://www.pachube.com/feeds/1197) lists three URLs for accessing realtime data in
various formats: CSV, JSON & EEML (an XML format). The XML file format contains the most descriptive infor-
mation about a sensor feed (including metadata), while the CSV format contains the least. Note: The Grass-
hopper Pachube Read component can only access XML or CSV file formats.
By retrieving data from one of these URLs you will access the remote environment’s most recent datastream
values and metadata (up to a resolution of 5 seconds) and can use this data to control, trigger, modulate or
otherwise affect your device, building, environment, actuator, etc.
Each feed page has a data stream link labeled ‘embed, history, triggers’ which reveal a drawer with a number
of URLs and code snippets:
History: quick view of the last 24 hours of data in 15-minute increments, CSV format, no timestamps (total of
96 datapoints). This URL address can only be accessed by adding the .csv file extension.
Archive: complete datastream history in 15-minute increments, CSV format, includes timestamps. This URL
address can only be accessed by adding the .csv file extension.
PNG graph: HTML code snippet for embedding a configurable PNG graph of the datastream. Currently the
PNG graphs cannot be imported into Grasshopper.
Zoom graph: HTML code snippet for embedding a zoomable graph of the last 30 days of data. Currently the
Zoom graph cannot be imported into Grasshopper.
POWER SUPPLIES
PowerSupplyOne [Huge Selection of Power Supplies]
SENSORS
Acroname [Sharp IR Sensor Source - we use the GP2Y0A02YK]
Making Things [Great range of Sensors - highly recommend]
Sparkfun Sensors [many flavours] Sensor Kit by Sparkfun
LadyAda [Bits and Pieces; Sensors and Arduinos and much more]
SERVOS
Servocity [Great Selection of Servos and Supplies]
LEDS
SuperBrightLEDS.com [Single LEDs or multiple strings, all types, good quality]
Other misc. tools that you might consider purchasing: a soldering iron and solder, wire strippers, helping
hands, digital multimeter, etc. Here is a great link for info on the best tools to purchase.
[Note: These are working lists. Please e-mail us a related links and we’ll consider adding them to our lists]
SERVOS
Hacking Servos for continuous rotation: http://www.seattlerobotics.org/guide/servohack.html
Arduino Related
Arduino [obviously, but this is a key software especially to hack the Firefly Firmata!]
Processing [Arduino is based on Processing by Casey Reas and Ben Fry]
Modkit [Drag and Drop programming for Arduino]
[Note: These are working lists. Please e-mail us a related links and we’ll consider adding them to our lists]
Nobel, Joshua. Programming Interactivity: A Designer’s Guide to Processing, Arduino, and Openframeworks.
O’Reilly Media, 2009. (Amazon)
Platt, Charles. Make: Electronics (Learning Through Discovery Series). Make Publishers, 2009. (Amazon)
Banzi, Massimo. Getting Started with Arduino. Make Publishers, 2008. (Amazon)
Reas and Fry. Processing - Programming Handbook for Designers. MIT Press. (Amazon)
Igoe and O’Sullivan. Physical Computing: Sensing and Controlling the Physical World with Computers. Course
Tech CPR. (Amazon)