Drawing Machine Madness [polargraph vitamin kit]

December 31st, 2012

This past week I decided to get into the holiday season and buy myself a Polargraph Drawing Machine Vitamin Kit. The 4- to 6-week wait for delivery is making me feel like a kid waiting for Christmas, though my Christmas has been reschedule to mid- to late- january.

After the idea of a drawing machine came up in one of my projects at the LAB two months ago, I’ve been keeping my eyes open for any information about how to create a drawing machine. Somehow, I came across the Polargraph project in my research but I did not find the project’s code repo or store.

That all changed earlier this week when I came across the BRBO Drawing Robot listing on Tindie. This project was created by Sandy Noble, who leads the Polargraph project. After visiting the Polargraph blog I ended up their Polargraph store. And there in front of me was the Polargraph SD Vitamin Kit; it was love at first sight.

After a few hours of hesitation I decided to pull the trigger. Then by the next morning I had convinced James to order a Polargraph Vitamin Kit for the LAB. I’ll admin it was an easy sell since both James and Josh are as excited as I am about playing around with drawing machines.

The Polargraph project is by far the best documented and supported drawing machine project that I have been able to find. I want to thank Sandy Noble for keeping this project alive and moving forward.

I am excited about joining the community of Polargraph owners and I hope that I, and my colleagues at the LAB, will be able to contribute to this project over the coming years.


Switches Library [now fully documented]

December 31st, 2012

Switches

I’m a big fan of switches, and digital inputs of all types. A little over a year ago I published a blog post about the Switches Library for Arduino that I created. This library provides classes for managing the state of switches, buttons, analog switches, and rotary encoders. I developed this library for a project where I neded to connect a large number of switches to multiple different Arduinos.

I never got a chance to fully document how this library works, until now. Earlier today I published an updated version of the library that includes example sketches, a readme file with detailed description of how each switch class works, and source code that is well documented.

The Switches library was designed to enable you to handle input from different types of physical inputs using a consistent code/design pattern. This library is actually a collection of libraries, where each one handles a different type of switch. The switch-specific libraries are refered to as implementation classes in the documentation. These provide helpful features, such as debouncing capabilities for digital switches and smoothing capabilities for analog switches.

Below is an list of the example sketches that have been added to the library. You can access these examples by selecting File -> Examples -> Switches from the top menu bar on the Arduino IDE app.

  • analog_switch demonstrates how the analog switch class can be used to set-up an analog switch. The sketch sends a serial message with the switch’s state whenever its state changes.
  • digital_switch shows how the digital switch class handles a digital switches, when in momentary mode. The example sketch sends a serial message with the switch’s state whenever its state changes.
  • multi_state_rgb_button illustrates how to create a sketch that manages a multi-state button with an rbg led that reflects the button’s current state. The example sketch updates the led color and sends a serial message with the switch’s current state whenever the button’s state changes.
  • rotary_encoder shows how to hook-up a rotary encoder using the switches encoder library. The sketch sends a serial message with the encoder’s current state whenever its state changes.

I had a fun time testing out the digital switch, multi-state rgb button, and analog switch examples on the ProtoSnap Pro Mini kit from Sparkfun. I’ve had this little prototyping kit since I got it from Nathan Seidle at the MakerFaire in San Mateo, so I have to give a shout out to Nathan and Sparkfun.

Please note that I was not able to test the rotary encoder example yet. I will update the code as necessary when I test the code in the coming week.

About the Header Image for This Post I created this image using Creative Commons licensed photos from flickr. To credit the owners of these photos, I put together an annotated version of this image that features links to the original source images.


Proximity Detection [mpr121 capacitive touch sensor]

December 29th, 2012

During the past few months at the LAB we have been working with the MPR121 Capacitive Touch Sensor breakout board from Sparkfun. This capacitive sensing controller features touch sensing and proximity detection capabilities, though our work has focused on proximity detection exclusively.

We used the tutorial published by Jim Bloom on bildr as our starting point. This tutorial walks through the process of hooking-up the breakout board to an Arduino, and features a sketch that configures the controller to sense touch events from all 12 electrodes.

Our next step, was to figure out how proximity detection works on the MPR121 and what needs to be done to activate and configure this capability. Here is a brief description of how detection sensing works, taken from one of the application notes on Freescale’s product site:

MPR121 has a unique feature that all the electrode inputs can be internally connected together so that all the surface touch sensing area on the inputs are “summed” together to act as a single large electrode pad. This can effectively increase the total area of the sensing conductor for non-contact near proximity detection for hand approaching.

This means that proximity detection works best when all 12 touch sensing electrodes are connected, and that the MPR121 can sense proximity and touch simultaneously.

After one afternoon of reading through the MPR121 documentation site, and a day of going through the Proximity Detection and Capacitance Sensing Settings application notes and testing different register settings with our prototype, we figured out how to activate the proximity sensing capabilities. In the process, we learned to configure over 15 registers. For the most part, we used the suggested settings from the application notes for these registers.

Check-out the tutorial on github for instructions on how to hook-up an Arduino to an MPR121 breakout board. You can download the Arduino sketch here, or from the github tutorial page. The tutorial is included in the readme file, along with the sketch and a hook-up diagram.


James & Josh at PSFK [choreographing spaces]

December 28th, 2012

I just finished watching this video of James and Josh’s talk at the PSFK conference in London from back in October. James and Josh are the co-founders and co-directors of the LAB at Rockwell Group, where I currently work. In this video they talk about the LAB’s focus on exploring ways to blur the line between physical and virtual spaces, and our approach to thinking about and designing interactive spaces.

Here are some highlights from the 15-minute talk, taken from PSFK’s blog:

  • The physical and digital realms are not resistant to one another.
  • Learning through making is what builds innovation.
  • Interactive spaces are designed through a series of inputs and outputs.
  • Technology transfer occurs through architecture, place-making, networking and the world wide web.

Learn more aout the LAB at Rockwell Group.
Find out more about the 2012 PSFK conference.


Logging Lightning [with a spacebrew data logger]

December 28th, 2012

arduinos with lightning sensor

We recently acquired a lightning sensor at the LAB. This awesome little sensor reportedly can detect lightning within a 40 kilometer range. After a night of thunderstorms we finally found the time the hook-up this sensor. Unfortunately, the storms were gone today so we didn’t get a chance to confirm that the sensor can indeed detect lightning.

Luckily, we recenly developed a data logging app for Spacebrew, which we’ve dubbed spacelog. This simple node-based app logs all the data it receives from a boolean, a range, and a string subscription channel. It saves the data as json-formatted strings in a text file in a local tmp directory.

To test the lightning sensor, we hooked it up to Spacebrew and set-up a data route to the data logger. We are leaving these apps running over the weekend, during which time we hope to capture some lightning activity from somewhere near the LAB.

More About the Data Logger

The data logging app can be easily started and configured via the command line. To start the app, just navigate to its base directory and run the command below. I’ll admit I’m oversimplifying things a little bit; you will need to read spacelog’s readme file to make sure you have all the required software, such as node.js along with appropriate modules.

node spacelog.js [optional arguments]

The three optional configuration arguments are:

  • server=server_name where server_name is the hostname of the spacebrew server.
  • name=app_name where app_name is the app name that will be registered with spacebrew.
  • file=file_name where file_name is the name of the file that where data will be saved.

Get the data logging app from github.

Currently this app is not able to track the source application for the data that it receives. Therefore, we recommend running multiple instances of this app if you need to be able to parse data from different sources. When running multiple instances make sure to configure each one with a unique spacebrew app name, and data file name.

The data logging app is an open source app that uses jog.


Spacebrew Arduino Library

December 26th, 2012

Over the past few months we’ve been working on making it possible to connect Ethernet- and wifi-enabled Arduinos directly to Spacebrew. We are happy to announce that the Spacebrew Arduino Library is now available in beta.

This library makes it possible to create Arduino-based Internet of Things prototypes that can connect to Spacebrew and be untethered from a computer. Previously, most of my Arduino-based physical computing prototypes were tethered to a computer and depended on a forwarding app that connected to the arduino via serial, and to other apps via sockets.

Arduinos that are connected to Spacebrew show-up like any other Spacebrew client. You can connect the input and output channels from your Arduino sketches to those of any other applications that support the appropriate data types. The Spacebrew library supports all three of Spacebrew’s standard data types – boolean, range (int values between 0 and 1023), and strings.

Getting Up and Running
Here’s how to get up and running with the Spacebrew Arduino Library:

  1. download the Spacebrew Arduino Library and the WebSocketClient Library.
  2. unzip both libraries and copy them into the Arduino libraries folder.
  3. restart the Arduino IDE.

To get started using the library, check out the examples and read the library overview page on github. Once you are up and running, take a look at the Spacebrew Arduino Examples collection, which features more advanced examples (currently only one). You can download this collection from github.

Double Arduino Set-up
This library use several protocols, such as websockets, that are text-intensive, and depends on other libraries, such as the Ethernet library, that take up a good amount of memory. That’s why running a Spacebrew client on an Arduino requires a large amount of SRAM and sometimes does not play nice with other libraries.

To address this issue we use a two Arduino set-up for some of our prototypes. In these set-ups one Arduino manages local data collection and/or display, while the other Arduino manages the Spacebrew connection. The Spacebrew Arduino Examples repo on github includes a tutorial that explains how to create a set-up like this, and features sample sketches and hook-up instructions.


ArduinoConnect [library for processing]

December 25th, 2012

The ArduinoConnect library enables processing sketches to connect to specific Arduinos, regardless of the serial port to which they are connected. This library was originally developed for the Make Your World project, where we needed to connect over twenty Arduinos to a handful of computers. Now-a-days I use it for all my Arduino/Processing prototypes because it makes sure the Processing sketch can only connect to the appropriate Arduino.

Make Your World - Arduinos

Check-out the source code on github.

This library works by using unique serial id numbers to identify specific Arduinos. The unique serial id number is provided as a string parameter in the ArduinoConnect class constructor as demonstrated in this gist example.

The serial id numbers for all Arduinos connected to a computer can be accessed by calling the ArduinoConnect.printArduinoSerialNumber() method, as shown in this gist example. This method prints to the console the serial id numbers of all Arduinos connected to the computer, along with the serial port to which they are connected.

Install ArduinoConnect
Here’s how to install the library in four easy steps:

  1. Download the zip file from github repo.
  2. Unzip the downloaded file.
  3. Go to the distribution folder.
  4. Copy ArduinoConnect folder into your Processing libraries folder

Kudos and Credits
This library was primarily developed by Quin Kennedy here at the LAB, thanks Quin it saved our lives in San Mateo. I led the effort to clean up the code so we could package it into a library. The source code for extracting Arduino serial ids was adapted from open source work done by Dave Vondle from Ideo Labs http://labs.ideo.com. The ArduinoConnect library is also open source.


Spacebrew Javascript Examples

December 25th, 2012

Over the past months I’ve been playing around with Spacebrew using javascript, processing and arduinos. I had a lot of fun with my explorations and in the process I developed a bunch of sketches, some simple others more involved. This past weekend I uploaded a selection of javascript sketches. Here is a quick overview of the new stuff you’ll find in the javascript examples repo on github:

  • iphone events: web app that forwards iphone accelerometer and gyrometer events to spacebrew. Has not been tested on other phones but should work on phones that support the appropriate html5 features.
  • colored screen: simple app that controls the background color of a browser window. It accepts three range values from spacebrew and uses those values to set the page’s background color. I played around with this sketch by running it on fullscreen on three computers and controlling the color using the iphone events app on my phone.
  • slideshow: simple social slideshow app. It accepts strings that contain urls that point to images and adds new images to the slideshow. The images are played in a continuous loop, and can also be controlled by commands received through spacebrew.
  • text transform: transforms text messages from spacebrew. The user interface enables users to link a “key” message to a “mapped” message (this combination is called a transform map). The app listens for incoming messages from spacebrew. If an incoming message is matched to a “key” message, then the corresponding “mapped” message is sent out to spacebrew.
  • url launcher (chrome extension): controls the navigation of your chrome browser. It accepts a string that contains a url. It also publishes a boolean value when the browser has been idle for a period of time that can be specified via the query string. **disclaimer** this app will seriously take over your chrome browser so read the readme. Ok, it won’t harm your machine but it may require that you quit out of chrome and disable the extension to learn how to configure the app via the query string.

I hope you find these sketches useful. Let me know if you have any questions (I’ll be at the jam tomorrow night). I’ll also upload the arduino and processing sketches over the coming weeks.

Download these sketches and other spacebrew javascript examples.

The original version of this post was created for the Spacebrew blog, on December 5th.


Spacebrew [toolkit for interactive spaces]

December 19th, 2012

Since this summer, we have been developing an open source software toolkit for prototyping and producing interactive spaces. Dubbed Spacebrew, this toolkit is a dynamic pub/sub framework that provides a simple and flexible way to link applications. It features a web-based switchboard-themed interface for configuring connections between applications that provides a fun and easy way to explore new and unexpected connections.

Apps that are connected to spacebrew can be configured as subscribers, publishers, or both. As you would expect, subscriber apps feature one or more subscription channels where they can receive data, and publisher apps feature one or more publication channels where they can send out data. I like to call these channels inlets and outlets, stealing from PD and Max/MSP lingo though these are unofficial names.

Each subscription and publication channel is configured to handle a specific type of data. Currently, spacebrew supports three defualt data formats: (1) boolean value, true or false; (2) 10-bit number value, range between 0 and 1023; or (3) string value. Subscription channels can only be linked to publication channels that handle the same data type.

Spacebrew can work with any application that supports Websockets. To help you get started we’ve already created Spacebrew libraries for Processing, Javascript, openFrameworks, and Arduino.

Here is a brief official overview of why we made Spacebrew (from the official Spacebrew blog):

“At the LAB at Rockwell Group, we focus on blurring the line between physical and virtual spaces. We think about choreographing environments and the interaction of the objects, people, and stories within them. We spend a lot of time making things – both physical and digital – talk to each other.

When exploring tools to help make these type of Internet of Things environments, we were frustrated by the abundance of closed solutions that didn’t play well with others. In response, we developed Spacebrew”

Spacebrew has not officially been launched, though we have started to share Spacebrew with our friends and peers in the industry. If you are interested in playing around with Spacebrew Beta 0.1 here is a bunch of helpful links:

(1) Get Spacebrew
There is more then one way to set-up Spacebrew. You can run your own local or remote Spacebrew server, or you can use the public Spacebrew server. For more information about these different options check out the Getting Started tutorial on the Spacebrew blog.

(2) Learn to Use Spacebrew
We have create several examples to get you started with Spacebrew. Many of these can be found at the bottom of the Getting Started page. We’ve also started to develop a series of tutorials for Spacebrew. At the moment, only two are available. We have plans to add many more over the coming months.

(3) Check-out Spacebrew Source
For those of you who are interested in perusing through the source code, here is a link to the github repo.


Interactive Spaces [making physical spaces interactive]

July 22nd, 2012

Earlier this week Keith Hugues from Google released a new open source project called Interactive Spaces. This project provides a software platform for making physical spaces interactive. This software enables you to link multiple different inputs and outputs within a space so that they function in a choreographed manner.

This software is similar to the ECS project from the Lab @ Rockwell. One of the descriptions that has been used for ECS, and is also applicable to IS is that this software provides the backbone for a local Internet of Things.

Interactive Spaces in Action

Over the past several months we (at the Lab) have been working on a project for Google that uses this software (the picture above was one of the projects that we developed for this Google project – picture taken from the Google Code page for IS). After several months of working with initial alpha and beta versions of this project, a stable version was released about a month ago, and now it is about to become available for anyone to try out.  Here is a brief description of IS from the google code page:

Interactive Spaces works by having consumers of events, like the floor, connect to producers of events, like those cameras in the ceiling. Any number of producers and consumers can be connected to each other, making it possible to create quite complex behavior in the physical space.

This is an initial source release. As the final licenses are finished, there will be a binary release. Please see Downloads for a PDF file for documentation. This documentation is in progress.

I don’t know many details about the internal workings of Interactive Spaces. Here is a brief overview of what I do know (you can always explore the source code available on the IS code repo to learn more): it was developed in Java and uses the Open Services Gateway initiative framework. Out of the box it supports scripts written in other languages that can run on the Java platform (such as python/jython), and integration of native applications (though the process is somewhat confusing until you get used to it).