Anyone home? (spring 2013)

Anyone home? is an interactive art installation shown at Once Removed, a gallery exhibit in Olive Tjaden Gallery, February 18, 2013 – February 22, 2013.

Designed and built with Allie Riggs, Anyone home? is a “conversation piece” that invites visitors to write a message on the illuminated podium using a touchpad. After a short period of time, a response appears on the box, generated by an algorithm that pulls (with varying degrees of randomness) from several email threads. The podium broadcasts (via email) images of new messages, and periodically checks its email to determine a response.

The “semi-deterministic” interactivity had the effect of driving conversations in new, spontaneous directions. The relatively novel medium of communication played with the traditional relationship between artist and patron, and the anonymous/ephemeral nature of participation seemed to create a sense of curiosity and wonder.

Anyone Home? from Allie Riggs on Vimeo.

The code is included below and is available as a gist.

Massimo Vignelli 1972 NYC subway map poster

I scoured the Internet to find a poster of the 1972 Massimo Vignelli NYC subway map, but couldn’t find any for sale. After some searching I found this pdf and printed a poster using PosterBrain (what they lack in low prices, they make up for in ridiculously friendly customer service emails). Here’s how it came out. (All the text is readable and clear, my camera isn’t the best quality.)

vignellimapposter

Light field camera using angle-sensitive pixels (fall 2012-spring 2013)

I’m working on designing and building a light field camera for my M.Eng design project at Cornell. A light field camera captures information about incident rays of light like a traditional camera (their position, wavelength, aggregate intensity) but also can record their direction. This allows for some interesting capabilities (refocusing images after they’ve already been taken, passive 3D range mapping, to name a few). A commercial example of a light field camera is Lytro. Unlike existing technology, which uses microlens arrays (expensive and somewhat difficult to manufacture), angle-sensitive pixel (ASP) technology developed in the Molnar group at Cornell allows light field capture using a single lens and CMOS-compatible manufacturing techniques.

My specific project involves designing the camera electronics to interface with the ASP imager IC, making a portable, USB-compatible device.

Project Proposal

Download (PDF, 790KB)

Poster for BOOM 2013

Download (PDF, 2.12MB)

Face(book)² (summer 2012)

Face(book)² is a physical manifestation of Facebook — literally, Facebook inside of a book.

Created with Jeremy Blum at Facebook Summer of Hack NYC, it allows you to read & interact with Facebook inside of a hollowed-out textbook. Using an Arduino Mega, a pair of XBee RF transceivers, and a bunch of miscellaneous electronics, you can browse through your news feed, view posts & comments, and “like” stories.

At the beginning of the hackathon, we didn’t really know what we wanted to make, other than something involving hardware. Although I’ve worked on software projects at hackathons before, I really love working with electronics and building things with my hands. So Jeremy and I lugged huge duffel bags full of random electronics to Facebook’s NYC headquarters and got to work.

Once we planned out the idea, we spent a while searching in Barnes & Noble for a book that was suitably large to fit all the electronics inside. We then set to work building the project, starting with writing a wrapper for the Facebook Open Graph API for the Arduino. In Python, using fbconsole, a stationary computer communicates with Facebook and sends data over a serial connection using a limited communication protocol that we devised.

Since we’re limited by the size of the serial buffer, we took the time to format everything for display on a few character LCDs in Python. The Python script also handles a simple state machine, meaning that the Arduino can simply send commands like “.n” (for “next”) and the computer will return the appropriate posts, knowing where the previous posts were cut off by the displays.

We also spent a while devising a method to display profile pictures on a Nokia LCD from Adafruit, from the hackNY hardware workshop I ran earlier this summer. It turns out it’s easy to get profile picture thumbnails that are the right size (e.g. http://graph.facebook.com/jpwright/picture), but formatting it properly was a lot of work — using the Python Image library, the picture is converted to monochrome, then carefully written out as a string of bits which the Arduino interprets using the Adafruit Graphics Library. It turns out that converting a bitmap to a suitable character array is not easy to do on the fly — there’s desktop software that does this well, but it’s a pain to implement for something dynamic like profile pictures.

We used an accelerometer, also from Adafruit, to allow scrolling by turning the cover of the book. Once the angle of the cover crosses a certain threshold, a “scroll” command is sent from the Arduino to the computer. A few buttons were attached — one to let you click on each post, one to return to the home screen, and a dedicated “like” button. In addition, we used a limit switch to detect when the book was opened or closed.

Video

Source Code


Download
jpwright / facebook-squared

Press

“Hackathon results in the Facebook book”, Hackaday, July 30, 2012.

Learn More

See Jeremy Blum’s blog.

How to run Arduino on the Adafruit atmega32u4 breakout board

I picked up a few of the Adafruit Atmega32u4 breakout boards for a workshop earlier this summer. These are great, inexpensive little devices, but they’re only intended for AVR development in C, not Arduino. Adafruit used to support running Teensyduino on these, but they don’t anymore, and my attempts to run Teensy on them were really buggy — using the Arduino serial library would cause them to crash, for example.

It turns out that using the Leonardo bootloader is much more reliable. Here’s how to get that set up:

  1. Set up an external programmer. You can’t flash the bootloader on the breakout board over USB. You’ll need a separate ISP, or you can set up another Arduino as an ISP if you want (follow this tutorial)
  2. Flash the bootloader. In the Arduino IDE, go to Tools > Programmer, and select the appropriate device. Go to Tools > Board and select Arduino Leonardo. Then click Tools > Burn Bootloader.
  3. Update references. Changing the bootloader means your pin references in software won’t line up properly with your hardware. Compare the schematics (breakout board vs Leonardo), and address the pins as you would on a Leonardo, but connect them according to the atmega32u4 breakout board schematic. Since the breakout board has fewer pins than the Leonardo, naturally you can’t use the same range as the Leonardo documentation would tell you.

    Here’s a pinout diagram for the breakout board running the Leonardo bootloader. Thanks to Nikhil Lal.

If you really, really want to run Teensyduino, you can still find Adafruit’s documentation on how to set it up, and this forum thread might help fix problems. Again, they don’t recommend doing that, and I ran into a lot of trouble when using standard Arduino libraries.

hackNY Summer Series: CornellNYC Tech

Being the only Cornell student in this year’s class of hackNY fellows, I was pretty excited when I noticed that Dan Huttenlocher, dean of computing and information science at Cornell, was giving a talk to hackNY along with Greg Pass, former CTO of Twitter and current Entrepreneurial Officer of CornellNYC Tech, and Thatcher Bell, Principal at DFJ Gotham, both Cornell alumni. To be honest, this was mostly because of (1) my Big Red pride, and (2) I was looking to convince them to let me hang out at Cornell’s new space at Google NYC as much as possible this fall.

However, what myself and the other fellows learned was that CornellNYC Tech is so much more than a satellite campus of our stodgy institution in Ithaca, NY, to be filled with traditional lecture halls and professors. Rather, it’s a visionary, one-of-a-kind proposal that seeks to deeply integrate academia with entrepreneurship, industry, and the technology community.

To give some background, CornellNYC Tech was selected in December by Mayor Bloomberg as the winner of a competition for a new applied sciences graduate campus in New York City, for which it received land on Roosevelt Island for construction to be completed in 2017. In the interim, Cornell will run classes & events out of temporary space in Google’s NYC office. Once the campus is open, Cornell will offer a joint two-year M.S. in Applied Science with the Technion Institute, in additional to traditional M.S. and Ph.D. offerings in fields like computer science, electrical engineering, and information science.

Huttenlocher began by describing the current model of tech development: a pipeline consisting of abstract academic research, focused R&D of concepts that come from universities, product development, marketing, and sales. The cordoning off of academic research means that ideas are disconnected from innovations, and tons of academic research doesn’t translate into meaningful technology because entrepreneurs either aren’t aware or can’t find profitable endeavors that use it.

CornellNYC Tech wants all of those stages to occur in parallel. The campus will break down traditional university conventions and create a place for students, faculty, industry leaders, and entrepreneurs to do research & make things together, at the same time. In doing so, the hope is that connections will naturally form between those groups. This will not only create mutual opportunities for collaboration, but will also enable real-time feedback loops to drive research & innovation in productive directions. Academics will advise entrepreneurs on technology development, and entrepreneurs will share real-world experiences and knowledge with academics.

In many ways, the project is itself a frighteningly ambitious startup — a proposal to disrupt academia by utilizing the help of government, two institutions not exactly known for their agility or flexibility. In addition, the inclusion of Technion as a partner institution flips the trend of U.S. universities expanding overseas on its head. The hope is that Technion, which is positioned at the center of the technology industry in Israel, will bring an international perspective to NYC.

Another important goal of the project is to accelerate the growth of the burgeoning tech industry in NYC. To accomplish this, students will have advisors in industry in addition to academic advisors. All three speakers specifically mentioned graduate education as something that should be closer to apprenticeship, in which students hone their skills and prepare to use them to do amazing things outside of school. Thatcher argued that this type of network-building was vital in creating a thriving a tech community to overcome the vastness of NYC’s economic activity in which other industries compete for people, attention, and investment.

Huttenlocher also addressed the issue of finding the right faculty members to participate. Much like a startup, he said, the first few hires set the tone for the organization’s entire culture. For Cornell, finding faculty members willing to relocate and work in an environment where they’ll be coworking right next to students and entrepreneurs instead of in a cozy office will be a challenge. While faculty members will still be affiliated with departments established in the Ithaca campus, their work in NYC will be much more decentralized and interdisciplinary. However, those people do exist — Deborah Estrin and Huttenlocher himself, who has bounced between Cornell, Xerox PARC, and various startups, are proof of that.

Greg Pass brings a wealth of experience to the table as well, having scaled Twitter from its early fail-whale days to the powerhouse that it is now. He emphasized that innovation should be data-driven and incremental, as opposed to academic theorizing that often privileges finding “clever” solutions at the expense of quick, practical ones. In response, Huttenlocher quipped that too much emphasis on being clever “bites you in the ass 100% of the time.”

All were sure to mention the experimental nature of the project, noting that we won’t see results for several years. If successful, it’s a model of education that could be applied in many other areas, even in primary education, and one that could revolutionize universities as we know them.

The excitement of hackNY in the room (the beautiful art.sy headquarters) was palpable, and I’m incredibly enthusiastic to have a future at the growing nexus of hackNY, CornellNYC Tech, and the NYC tech community.

hackNY Hardware Workshop: Super Blinky

Super Blinky is a better version of Blinky.

This tutorial introduces a few new concepts:
1) Pulse-Width Modulation (PWM), to fade the LED.
2) Analog-to-Digital Conversion (ADC), to read a potentiometer (variable resistor, used for analog encoding)
3) Communication using UART over a Serial-to-USB connection

Background knowledge: complete Blinky first.

  1. Wire up the potentiometer. Run the outer leads to 5V and GND. The middle lead should be connected to the analog read pin — F7 on atmega32u4 breakout and F0 on teensy++. A potentiometer scales the voltage across the two outer leads by moving conductive material across an internal resistor. This scales the voltage by creating a variable voltage divider.

  2. Move the LED jumper. Why a different pin? We want to use a digital IO pin that is PWM-enabled. Use pin D0.

  3. Set up the serial connection.

    const int ledPin = 0;    // LED connected to digital PWM pin 3, 0 on teensy++
    const int analogPin = 0; // Potentiometer connected to analog pin 0
    
    int analogVal;
    int delayVal;
    int fadeVal = 0;
    boolean fadeUp = true;
    
    void setup()  { 
      Serial.begin(38400); // initiate serial connection at 38400 baud
    } 

    This initiates a serial connection at 38400 baud, or signals/second.

  4. Implement dimming.

    void loop()  { 
      analogVal = analogRead(analogPin);
      
      delayVal = map(analogVal, 0, 1024, 1, 5);
      analogWrite(ledPin, fadeVal);           
      delay(delayVal);                            
    
      if(fadeUp) {
        fadeVal++;
      } else {
        fadeVal--;
      }
      
      if(fadeVal == 255 || fadeVal == 0) {
        fadeUp = !fadeUp;
      }
    }

    This code reads the voltage on the analog read pin (on a scale of 0-1024), uses the map() function to scale that range to 1-5, writes a brightness level to the digital PWM (LED) pin, delays an amount proportional to the read voltage, and changes the brightness level.

    Note: You don’t have to call pinMode() before using analogWrite.

  5. Send data over serial.

    Serial.print("analog 0 is: ");
    Serial.println(analogVal);
    delay(1); //for stability

    Yes, it’s that simple.

  6. Upload sketch, observe superior blinking. Twiddle with potentiometer knob.

    If nothing is happening, check pin assignments, test the LED connection by jumping directly to 5 V, etc. Make sure the right leads of the potentiometer are connected to the right things. There should be blinking regardless of the value on the potentiometer. Turning the potentiometer clockwise should result in faster blinking.

  7. Listen over serial.

    Click “Serial Monitor” (magnifying glass icon) in the upper left corner of the Arduino IDE. The board will auto-adjust to the monitor’s baud rate, but if that doesn’t work for some reason, you can manually set it to 38400 baud (as it is in the sketch). You should see “analog 0 is:” lines appear every time the LED fade changes direction.

    This line contains the analog voltage relative to AREF (i.e. 5 V) on a scale of 0-1024, meaning the actual voltage read is (displayed voltage/1024)*(5 volts)

    Sometimes the IDE gets finicky with serial ports, if it complains try refreshing the serial port menu or unplugging/plugging in your board.

Next: Project Ideas

hackNY Hardware Workshop: atmega32u4 breakout miscellany

To run as a separate device:

Mess with the Teensyduino installation.

Technically, the atmega32u4 breakout board isn’t designed to work with Arduino. By messing with some configuration files in Teensyduino, we can set it up as device in the Arduino IDE and upload code directly. Note: This isn’t necessary to do if you are actually developing on a Teensy++, but it won’t hurt, and if you’re reading this before the workshop, you don’t know which device you’ll be working with, so just do this now.

In <arduino>/hardware/teensy/, rename boards.txt to boards_old.txt and replace it with the boards.txt from the workshop repo.

In <arduino>/hardware/teensy/cores/usb_serial/, rename usb.c to usb_old.c and replace it with the usb.c from the workshop repo.

where <arduino> refers to whatever directory you installed Arduino into. If you had the Arduino IDE open, close it and re-open.

hackNY Hardware Workshop: Project Ideas

Project ideas for you to work on for the rest of the evening. I have the parts for these, and there may or may not be some starter code in the “projects” directory of the repo. Just give it a shot, ask me for help. Let me know when you have picked a project from this list or thought of one on your own and I’ll give you parts.

  • Lightsaber — Using this 3D accelerometer, build a lightsaber app. Have the microcontroller send data over serial to a script to generate lights/sound.
  • Mini Synthesizer — Generate tones, play them on a speaker. Use PWM for simple beeps, do DDS for more complicated sounds.
  • Spin Things — Play with a DC motor.
  • Fun with LCDs (2 groups) — Make something cooler than the hackNY logo on LCD screens. 2 groups because I have a large breadboard with both a Nokia cell phone screen and a 16×2 character LCD screen wired in next to eachother.
  • Blinky v3 — Use a bunch of LEDs to make cooler patterns.
  • Arduinophone (2 groups) — Connect your boards together using the UART TX/RX pins. Have them talk to eachother by spitting out messages received over serial (or maybe just pings, to begin with). It’s like the modern-day equivalent of the can & string telephone.
  • Programmable Electrician — Use a 120VAC relay (capable of switching on & off outlet power lines) and some extension cables I modified a while back to turn on or off any device with a plug using Arduino.
  • Weather Station — Use a temperature and humidity sensor in combination with an LED as a primitive light detector, send data over serial
  • Anything else you want that I have parts for

General tips:

  1. Look up part datasheets. If you don’t know what a part is, find a part number on or near the device, Google it, find the datasheet which is all relevant information.
  2. If there’s a short, cut the power immediately. THEN try to figure out what went wrong in your wiring.
  3. Ask questions! I have experience working with all of these devices.