Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

In this periodic series of “Letters,” Shawn Wallace, member of AS220, the Providence, RI community arts and technology space, shares his experiences with the Fab Academy, a distributed learning collaborative, built on the infrastructure of the Fab Lab network. — Gareth

Interfacing microcontrollers and applications

By Shawn Wallace

FabAcademy05img01.jpg

The Fluxamaphonic, a physical interface to a computer-based FM synthesizer.

It is week 24 of the Fab Academy, and we’re finally getting into integrating the various machining, electronics, and programming skills we’ve been practicing. The final two months of the program will focus more on design and engineering, and will culminate in a semester project, due in June. For now, the students are focused on their projects for the current two week cycle, focusing on interface and application programming. The assignment is to write a user interface for an input or output device using whatever combination of controllers, languages, and toolkits you wish.

The image above is the Fluxamaphonic input device; some knobs and buttons for playing and modulating two computer-generated sine or saw waves. It was made by Elliot Clapp, who had participated in Shawn Greenlee’s excellent crash course in Pure Data at AS220 Labs. Elliot decided to create a physical interface to a Pure Data (Pd) patch using Arduino as the microcontroller platform. Pd is an open source visual programming language for integrating sound, video, and physical interfaces, created by Miller Puckette. You can think of it as an open and free alternative to Max/MSP.

The design of the Fluxamaphonic, as with all of our interface projects, followed these essential steps:

1. Capture data and map the numbers to a transport protocol. In the case of the Fluxamaphonic, the six potentiometers are hooked up to 10-bit A-to-D converters (i.e, the analog inputs on an Arduino board). These numbers are sent as two bytes over a serial connection, so nothing needs to be done to the data. The Arduino is flashed with the Pduino firmware, which allows the Pd patch to request data from the Arduino over a serial connection.

FabAcademy05img02.jpg

Elliot milled a custom Arduino shield to handle all the potentiometer and switch connections.

2. Choose a hardware transport interface. The Fluxamaphonic uses the USB connection of the Arduino.

3. On the application side, map the data from the transport protocol to usable numbers. In this example, the input numbers are in the range 0 to 1024. The Pd patch maps these numbers to a range of 0 to 500, which better corresponds to the desired range of frequencies.

4. Do something with the data. The Fluxamaphonic generated two saw or sine waves at varying frequencies. This is easy to accomplish in Pd, but not that readable if you are new to the patching language.

FabAcademy05img03.jpg

Part of the Pd patch.

Here are a few of the other interface projects made in the Fab Academy class:


A light-sensitive animation, written using Processing by Victor Freundt of the Barcelona Fab Lab.


A “light sensor and energy generator” by Beno Juarez of the Barcelona Fab Lab.

FabAcademy05img04.jpg

My own DIY “Hobo video game controllers” for the Fluxly video game. Pennies cut in half act as resistive sensors and control Actionscript sprites via a serial connection.

The next article will present the results of student experiments with sensors, actuators, and embedded networking!

More:

From MAKE magazine:

make volume 21 little cover.jpg

MAKE Volume 21 is the Desktop Manufacturing issue, with how-to articles on making three-dimensional parts using inexpensive computer-controlled manufacturing equipment. Both additive (RepRap, CandyFab) and subtractive (Lumenlab Micro CNC) systems are covered. Also in this issue: instructions for making a cigar box guitar, building your own CNC for under $800, running a mini electric bike with a cordless drill, making a magic photo cube, and tons more. If you’re a subscriber, you may have your issue in hand already, and can access the Digital Edition. Otherwise, you can pick up MAKE 21 in the Maker Shed or look for it on newsstands near you!

Gareth Branwyn

Gareth Branwyn is a freelancer writer and the former Editorial Director of Maker Media. He is the author or editor of a dozen books on technology, DIY, and geek culture, including the first book about the web (Mosaic Quick Tour) and the Absolute Beginner’s Guide to Building Robots. He is currently working on a best-of collection of his writing, called Borg Like Me.


Related
blog comments powered by Disqus

Featured Products from the MakerShed

Follow

Get every new post delivered to your Inbox.

Join 25,547 other followers