Main

Development Archives

June 18, 2008

Mac Pro Optical Digital Audio Output and the Mute button

One of the great things about the new Mac Pro is its full size optical digital output, which feeds pure and clean digital audio to my receiver and on to the speakers in the office or main room. The downside of this is that the implementation is such that there is no master volume or mute capability; the optical out is a direct hard line out of whatever your apps hand it. Controlling volume with iTunes is no big deal, but it's really really annoying when you open a website with blaring loud awful music and have no way to quickly mute the sound. The best way I know is to open the System Prefs and change the audio output. So I figured what better time to hack a little AppleScript to at least automate the output switch.

I've only touched AppleScript on one other occasion, and I must say it's a bit of a mystery to me. It's sort of like the developers tried so hard to make the code like English that it turns into a confusing mess of pseudocode, and I've yet to find any comprehensive reference of what's possible in quick glances at what seems to be a maze of documentation. (Any pointers to such a reference would be much appreciated, BTW) But, there's always Google. To be fair, I've only spent a few moments with it and was able to figure out what I needed to make my mute button work, albeit with a big chunk of copy and paste from the O'Reilly Mac Devcenter blog.

So, without further ado, here's the code. You'll need to use AppleScript Utility (in /Applications/Applescript) to "Enable GUI Scripting" for this to work (the script will help you out with this if you haven't already done so). Use the Applescript Editor (also in /Applications/Applescript) to save the code (it seems to do some compilation in the process).

The long lines are hard to read here on the site, so the code is also available here.

(*
Modified from the script found at http://www.oreillynet.com/mac/blog/2006/07/applescript_audio_output_switc.html to
switch between Digital output and Internal speakers, to act as a mute when using Digital out
*)

(*
This script toggles between two audio outputs in the "Sound" pane in "System Preferences" and adjusts the volume. 
Modified from a script at http://forums.macosxhints.com/showthread.php?t=45384 
to add volume control and GUI scripting detection. --David Battino, www.batmosphere.com.

USES GUI SCRIPTING; "ENABLE ASSISTIVE DEVICES" OPTION MUST BE CHECKED IN THE "UNIVERSAL ACCESS" PREFERENCE PANE
*)

tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.sound"
end tell
tell application "System Events"
	if UI elements enabled then
		try
			tell application process "System Preferences"
				tell tab group 1 of window "Sound"
					click radio button "Output"
					if (selected of row 3 of table 1 of scroll area 1) then -- Digital out is selected
						set selected of row 1 of table 1 of scroll area 1 to true
						tell application "Finder"
							set volume 0
						end tell
					else
						set selected of row 3 of table 1 of scroll area 1 to true -- Internal speakers are selected
						tell application "Finder"
							set volume 2
						end tell
					end if
				end tell
			end tell
			tell application "System Preferences" to quit
		on error
			tell me to activate
			display dialog "Problem selecting audio device." buttons {"Whoops!"} default button 1
		end try
	else --GUI scripting is disabled
		tell application "System Preferences"
			activate
			set current pane to pane "com.apple.preference.universalaccess"
		end tell
		display dialog "Please check the box called \"Enable access for assistive devices.\"" buttons {"Okay"} with icon 1 default button 1
	end if
end tell

The script opens the System Preferences dialog, clicks on Sound, selects the Output tab, and toggles between outputs 1 and 3, which in my case are "Internal Speakers" and "Digital Out". When setting the output to the internal speakers it also sets the volume to 0 (mute). Perfect.

Now with a Quicksilver trigger, the script runs when I press F10 (in my case fn+F10, since I have the other special keys enabled) and mute is toggled. I also used the Quicksilver triggers and the iTunes plugin to map F11 and F12 to iTunes volume up and down. Not quite as nice as master volume + mute, but hey, it's digital to the amp — worth a little annoyance.

June 10, 2008

Multiple Database Connections in Ruby on Rails

I've been doing a lot of work in Ruby on Rails lately and absolutely love it. In the past few days I've needed to port an existing database over to a new schema for comparisons and benchmarking. It took a bit of digging to find what turned out to be a typical RoR (read: elegant) answer to the related problem of maintaining connections to multiple databases in Rails, so I thought I'd offer a link to Dr Nic here.

August 11, 2007

YouTube Badge

I finally set up YouTube to take videos directly from my mobile phone, so I wanted to automatically embed my most recent video on this blog (find it in the sidebar above the Flickr photos). I couldn't find anything exactly like what I wanted (i.e. plain and simple), so I threw together a little PHP script to do the job. Here's the source. After changing the username, width, height, and optionally the API key (get yours from YouTube), either paste the source directly into your template files or save it to its own separate file and include it. In either case, your site must run on PHP for this to work. No guarantees on this one, it's just thrown together, but it works for me. Good luck.

May 19, 2007

The ghost of Jimmy Kimmel...

...on the ORB!

Jimmy and his team were great. We shot a short interview which should air on Jimmy Kimmel Live! within the next couple of weeks. Jimmy said he "felt like the Mona Lisa" and that his mug on the ORB was "the most beautiful thing I've ever seen". MAKE!

May 14, 2007

En route.

This comes to you from a quiet hotel lounge on the east side of Denver on our way to the MAKE Magazine Maker Faire, where we will join some 400 makers (including a handful of ITP'ers such as Andrew Schneider, Team Botanicalls, Giana Gonzalez, Tom Igoe, and last but not least, FabInfo instructors Toru Hasegawa and Mark Collins) with ORB and ultraORB in hand and ready to exhibit. A few tens of thousands of attendees are expected of all ages and all walks of life and I'm expecting a fantastic time sharing our work with the curious as well as exploring the rest of the exhibits. I'm also slated to give a talk/demo on Thursday's Maker Day, a day of events held specifically for the exhibitors and other presenters and organizers.

Maker Faire is held at the San Mateo Fairgrounds in San Mateo California and is open to the public on May 19-20. Advance tickets are $15 for adults, $10 for students 21 and under, and $5 for children 12 and under ($20/$15/$5 respectively on-site). Hope to see you there.

May 8, 2007

One final ITP all nighter

Just for old times' sake...

May 6, 2007

ultraORB Thesis Presentation

The presentation of the ultraORB at ITP Thesis week is now online and can be streamed here or downloaded here. I'm working now to improve the programming, moving toward displaying controlled geometric objects Tuesday and Wednesday at the ITP Spring Show.

May 3, 2007

Double spin (1/2).

Moving forward — a quick spin with one of the two boards. Now on to connect the brushes to power up the other half. More later...

May 2, 2007

Goodnight

The initial mockup. Time for bed.

May 1, 2007

Lights.

LEDs are soldered and testing is underway. There are a few minor bugs to tweak out with the lighting and then it's on to full assembly and programming. The color balance is a bit askew, but that's an issue for another day. 48 hours to go...

April 30, 2007

12.5%

Here's a view of 1/8th of the final assembly with LEDs in place. 280 LEDs to go.

Resting atop the PCB is the CNC machined aluminum board mount, holding in the foreground one of the four DC-DC stepdown converters from short-circuit.com. The board mount is topped by the three conductor commutator assembly, handmade from readily available materials and a few custom laser cut plexiglas spacers. The commutator mates with a set of brushes to deliver +15VDC, GND, and a timing signal from one of a pair of hall effect sensors mounted on the assembly rotating about the vertical axis (each quadrant of each PCB also has its own hall effect sensors to sense rotation about the horizontal axis).

April 29, 2007

ultraORB Concept Video

For those of you who haven't been following along with the in-person presentations, here's a little clip of video that was shot about a month and a half ago, showing the ultraORB concept in action. This is a demo and concept test with 4 single-color LEDs — the version due to be presented this coming week will have a total of 320 tri-color LEDs under microprocessor control to create a truly three dimensional persistence of vision display.

April 15, 2007

The view from the solder station

After a couple of days of intense soldering, the first major task is complete. The 960 0201 LEDs are all in place. It's funny, after two days of work, the boards look almost entirely the same to the naked eye. While I can barely focus on the screen to write this (seriously — now I understand what it's like to need glasses, if thankfully temporarily), the upside is that after soldering almost 1k 0201 parts, the 0402 package parts look like bricks and are easier than ever to handle. In any case, I'm here to say that it is very possible to hand solder 0201 parts. Time to go clear the head and get ready for another day of soldering tomorrow. In the meantime, here's the view from the soldering station:

April 14, 2007

Convert .bin + .cue -> .iso on Mac OSX

I had a need recently to convert a .bin/.cue CD Image pair to .iso for mounting on OSX. I was considering writing a quick utility to handle the task, but in the process of researching the file formats, I found BinChunker, a GPL-licensed piece of code that does exactly what I need, simply and directly. The official site has the source code and RedHat RPM's, but if you are on OSX, I did a quick compile of the latest version which you can download here.

Once you download the utility, issue this command from a shell prompt in the directory where you downloaded the file:

sudo cp bchunk /usr/bin/

This will copy the file into a location where the system can find it at will (a.k.a. the path). Then, to convert a .bin/.cue pair to a .iso, you can issue this command:

bchunk myinputfile.bin myinputfile.cue myoutputfile

Short, sweet, and simple — and lightweight too, weighing in at only 20k.

UPDATE: As commenter Frederik has pointed out, this can give a permission denied error if your user account does not have execute permissions on the file. Execute this command after copying the file to /usr/bin/ to solve this problem:

sudo chmod a+x /usr/bin/bchunk

If you are getting a not found error, make sure that /usr/bin/ is in your path. To check this, type echo $PATH and look for /usr/bin/ in the result. If it isn't there, type sudo nano /etc/profile and add /usr/bin; to the PATH=... line. Then press CTRL+x followed by Y to confirm and the enter key to verify the filename to save and exit nano. Then execute source /etc/profile to refresh the path.

April 12, 2007

Wuhan Direct

The circuit boards are here, having made the trip from the GoldPhoenix fab in Wuhan, China to Manhattan in about 36 hours. The parts are here, a day early in typical DigiKey fashion. Now it's time to start burning some flux. Before I do, though, here are a couple of quick photos from the unpacking process.


The virgin board. I have a pair of these to solder, with at a guess maybe 3-4k SMD pads each. It looks like I won't be seeing much daylight for the next week or two.


If you've ever wondered what $2k in DigiKey parts looks like, wonder no more. Not all that impressive on the surface, eh?

April 8, 2007

Forward Progress

Finally there is some positive progress to report on the latest ORB. The circuit boards have been designed and ordered (thanks, as usual, to Shane @ GoldPhoenix) and the CNC milled aluminum circuit board supports are completed and in hand. Many thanks to David Gotter (bio) and Rob Klaus of D&R Machine for their excellent work and patience in helping me through my first design for CNC fabrication. Check out David's other project, Further OPTIONS developing "innovative vehicle entry systems for wheelchair-bound individuals". D&R offers extremely capable and affordable machining services and is open for long-distance business via Internet and mail order. Contact them for your next project.

I'm also very excited to say that this piece has become a three-generation project. In addition to my collaborator and father, Ron Sears, my grandfather Jim McCoy is contributing his masterful woodworking and finishing skills to this project. Everything is in line for a beautiful piece.

This week, my biggest test thus far will begin: a massive soldering undertaking centering around 320 surface mount RGB LEDs, and a matching 960 resistors in 0201 packages. That's 0.024" x 0.012" for those of you keeping score at home. In addition, the design utilizes sixteen 80-pin PIC microcontrollers and a slew of other circuitry. If I can still focus my eyes well enough to see the audience at thesis week, I'll call it a victory. Starting later this week, when the parts and boards arrive, I'll be posting photos and possibly video of the assembly process right here on this blog.

For now though, here's a peek at one of the pair of aluminum board mounts fabricated at D&R Machine. There's much, much more to come, culminating in an initial exhibition at the ITP Thesis Week and Spring Show, on May 3 and May 8-9, respectively.

March 19, 2007

Maybe the best reason to boot Windows

One of the technological highlights of TED was Microsoft's Photosynth. A way of mapping user-submitted photos to 3D models as a novel way of photo-mapping the world, it was absolutely stunning. The demo, linked above, runs in IE or Firefox, but only on Windows, but it's worth the trouble, both as an actual experience and as a hint of what's to come. The presenters had a great attitude regarding the common anti-MS sentiment of the world ("Who would ever have thought that there would be a Microsoft talk at a session called 'Simplicity'?"), and once they started showing their work, they clearly had no reason for concern. Take a look for yourself and be impressed.

Vista on the MacBook Pro

I recently came across a gifted copy of Windows Vista Ultimate. As it turns out, I needed a copy of Windows for some CAD work on my MacBook Pro, so I figured I'd give it a shot. Vista isn't officially supported by Apple's Boot Camp, but after a bit of Googling, it seemed relatively safe, so I continued.

Installation was flawless. I inserted the Vista CD when Boot Camp asked for XP, and everything proceeded smoothly. It is a big installation though, consuming almost half of the 20GB I allotted to it. I followed these instructions to get the Apple drivers installed (not seamless, but it works) and everything is up and running.

I've only been using it for a few days, but all in all, I'm rather impressed. As a relatively recent Windows to OSX convert, the interface isn't so bad. I still prefer the Mac in terms of usability, but I have to admit, Vista is sort of pretty. It is hard though to miss the tail chasing that's going on here by Microsoft. The new Windows menu file system layout is oddly reminiscent of Finder. Even one of the bundled screensavers is a pretty apparent clone of the default OSX saver. The new desktop modules basically put Dashboard on the desktop, and the new Aero window management features add some 3D eye candy to Expose, albeit at the expense of hot corners — not a good tradeoff for my habits, but admittedly pretty. It almost makes me wonder, do the Windows designers run OSX at home? Either way, to me, a little more Apple flavor in Windows is a welcome addition, but not necessarily a source of honor and pride for Microsoft.

IE7 also copies its killer app from Safari: both are best used to download FireFox. IE7 does have one nice feature that I've noticed in the few minutes I've used it though: you can spawn a new tab by clicking a little stub button on the tab bar. A nice feature, although this Firefox extension does the trick as well.

Performance-wise, I'm satisfied. The new visual effects run smoothly on the MBP, although it should — the Pro has an ATI Radeon X1600 GPU with 256MB of dedicated graphics RAM. CAD apps possibly marginally less snappy than with a barren XP install, but all in all very usable, even in cases where the apps aren't officially Vista-rated.

I first installed Vista under Parallels in Mac OSX. This worked, but in the interest of saving space and not having redundant installs, I deleted the image to install it in a separate Boot Camp partition. After doing this, I found that the current version of Parallels doesn't support booting from a Vista Boot Camp partition. I'm looking forward to this feature, as it's nice to be able to quickly jump into Windows, but have the option for a full boot for more demanding apps like 3D CAD.

Would I pay $400 for Vista Ultimate? Probably not, unless I absolutely had to use a Windows-only application. It's nice, but so is OSX and for that matter Ubuntu, given enough patience and skill in setup and configuration. That leads to what is, for me, really the biggest problem with Windows these days: I miss the UNIX console. Having to download a separate ssh client and install my own scp seems completely unreasonable, especially considering the 9GB+ install footprint with everything but the kitchen sink (and UNIX terminal standards) thrown in.

I look forward to the day when Ubuntu and other Linux distros truly reach consumer-ready status, and that day is coming. Even today though, it blows my mind to see kiosks proudly displaying the blue screen of death. I would never pay thousands of dollars for Windows licenses for something like subway car displays or even Times Square signage when the simple GUI and configuration arguments should realistically be thrown out the window, much like they are in most of the web servers of the world, in favor of reduced cost and increased stability.

To continue to thumb its nose at the Linux community's technology is Microsoft's mistake, and recently I've started to think it would be a fatal one. Vista continues Microsoft's commitment to this grand mistake, but also shows that they still have some fight to bring to the ring.

March 6, 2007

Everything old is new again

Maybe there's a correlation to the fact that I'm not a big Twitter fan and the fact that never in my life have I used wall. And that, on the other hand, find / | grep is always right at my fingertips.

From 'sfearthquakes' on Twitter: By Marc Hedlund

One of my favorite business model suggestions for entrepreneurs is, find an old UNIX command that hasn't yet been implemented on the web, and fix that. talk and finger became ICQ, LISTSERV became Yahoo! Groups, ls became (the original) Yahoo!, find and grep became Google, rn became Bloglines, pine became Gmail, mount is becoming S3, and bash is becoming Yahoo! Pipes. I didn't get until tonight that Twitter is wall for the web. I love that.

(Via O'Reilly Radar.)

February 20, 2007

DigiKey OpenSearch Plugin

I was doing the first of many parts orders from DigiKey, a massive online supplier of electronic components, for the semester, and finally decided to make an OpenSearch plugin for Firefox. This lets you search for DigiKey parts from the search bar in the upper-right corner of OpenSearch compatible browsers. I've only tested this in Firefox 2.0.0.1, and I'm pretty sure that it won't work in IE7 (surprise!) because IE7 doesn't support POST requests for OpenSearch plugins. Get Firefox.

Install this plugin now or view the XML.

The format for creating these plugins is a very straightforward XML file. You can find the docs on how to create your own on developer.mozilla.org.

NOTE: This plugin is in no way supported by the Digi-Key corporation. Please do not bother them with help requests if it doesn't work properly (probably because you are running IE). Contact the author with any questions or problems - at which time I will probably just tell you to Get Firefox.

January 30, 2007

ssh/scp Login Without Password

I'd been wanting to figure this out for awhile, and yesterday finally took a few minutes to dig up the answer, which I found most clearly stated here by Mathias Kettner.

If you want to be able to login to multiple machines, you still only have to do the first step once. After you've created the public and private key files once, you can copy the same public key to each server using the steps that follow.

NOTE: I've slightly modified these directions from Mathias' copy to be more pertinent to the specific case of a local copy of Mac OSX connecting to remote servers, but the resulting commands are identical.

First open a terminal session on your Mac and generate a pair of authentication keys. Do not enter a passphrase:

your-computer:~> ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A


Now use ssh to create a directory ~/.ssh as user myusername on myserver.com. (The directory may already exist, which is fine):

your-computer:~> ssh myusername@myserver.com mkdir -p .ssh

myusername@myserver.com's password:


Finally append your new public key to myusername@myserver.com:.ssh/authorized_keys and enter myusername's password one last time:

your-computer:~> cat .ssh/id_rsa.pub | ssh myusername@myservername.com 'cat >> .ssh/authorized_keys'

myusername@myservername.com's password:


From now on you can log into myservername.com as myusername from your terminal without a password:

your-computer:~> ssh myusername@myservername.com

myservername:~>


January 29, 2007

Filesystem Sharing Between OSX and Ubuntu

As an update to my last post regarding my hpmount debacle, I've found a pretty good solution for my problem. I've got a dual-boot Ubuntu/Windows desktop, which I almost always run in Ubuntu, a MacBookPro running OSX, and a LaCie external USB hard disk. I want to be able to share the disk across computers without the 4GB file size limitation of FAT32 and would ideally keep the disk running HFS+ since it is primarily to be used for my Mac. Windows compatibility would be a nice bonus, but isn't really a priority.

The simple answer is this. The disk can be formatted in HFS+, but journaling has to be disabled for Ubuntu to mount it read/write. This seems to be actually doable safely on the fly, such that the disk could normally be used journaled, as long as journaling is disabled prior to attempting to write to it from Ubuntu. This can be done from the command line as follows:

sudo /usr/sbin/diskutil disableJournal /Volumes/MyDisk

for a volume named MyDisk

After mounting and working with the disk normally in Ubuntu, journaling can be reenabled in on the Mac as follows:

sudo /usr/sbin/diskutil enableJournal /Volumes/MyDisk

Info found in the Apple docs.

hpmount, du, and df

After trashing the HFS+ partition on my brand new (but loaded with important data, of course) LaCie USB hard disk by trying to mount it read/write in Ubuntu with hpmount so I could copy my music folder without having to go over the network (my advice: pretend hpmount doesn't exist), I was pleased to find that I could at least mount it read only in Ubuntu to save my data before reformatting the drive. This was after trying all of the OSX disk utility and fsck standard stuff to no avail.

To make a long story somewhat shorter, in the process of copying all the data off to my Ubuntu drive, I learned a few nice options of du and df, the unix disk usage and disk free space commands. The highlight for me is -h for human-readable. Here's the link to the rest.

Now I get to not only move the music folder over the network, but all the stuff that was originally on my removable drive. Fantastic.

January 22, 2007

Orb @ ITP

The Orb will be on display at ITP for the remainder of the Spring semester. Here are a few photos and a video of it in its new home.

Video (Quicktime, 1280x720, 98MB, 1:00) - Link

December 26, 2006

The Orb Makes the Virtual Rounds

Since the warm reception at the ITP Winter Show The Orb has been getting a good amount of attention around the blogosphere. Here are some of the mentions of which I'm aware (in rough order of appearance):

keeyool.com
MAKE Magazine
Hack A Day
notcot
Core77
Gizmodo
TodayNow
Ize.hu (can anyone translate?)
An Unreasonable Man

It's also been YouTubed (thanks to MaximusNYC):

December 17, 2006

Sneak Preview

With 7 hours and change to spare, the Orb is ready for showtime...

December 3, 2006

Illustrations for the New York Times published today


View the interactive version.

The illustrations I did for the New York Times in collaboration with Lisa Strausfeld of Pentagram were published in today's edition of the New York Times magazine. The illustrations, created in Processing, are the result of a physics-based model of keywords connected by springs. The strength of the virtual spring connecting a pair of keywords together is dependent upon their rate of cooccurrence on the Internet, a measure of their degree of relationship to each other. In addition to the three tiles shown above which are featured in the online version of the article, the cover of the magazine and the following pages of the print article all feature different views of the model.

Similar views, populated with data collected from internal networks, could be used by intelligence agencies in their efforts to determine terms that are interconnected and being discussed by diverse and disconnected agents.

The article also begins with an interview with ITP's Matthew Burton.

December 1, 2006

GumSpots - Live from Copenhagen


Today, tomorrow, and Sunday we are presenting GSPS from the ITP Fall 2005 show at Nordic Exceptional Trendshop at ITU in Copenhagen, Denmark.

This is my first trip to Europe and after taking a few hours yesterday to explore a bit on foot, I'm struck with the beauty and friendliness of Copenhagen — a truly wonderful city. The same goes for everyone involved from the university and especially the people of Innovation Lab who have been most welcoming and helpful.

November 18, 2006

Orb: First glimpses

I'm back in St. Louis (Jersevyille actually) and just got to see the frame for the Orb for the first time about an hour ago. It looks fantastic. Here are a couple of photos. I can't wait to start putting the pieces together. The red and amber streaks are just a pair of LEDs rotating on the frame in 3D space. 64 tri-colors addressing somewhere between 16k and 32k points in space should be pretty mindblowing.

P1000312sm.jpg

P1000311sm.jpg

November 12, 2006

OrbPCB

The PCBs for the 3D spherical display are in, and here's a sneak preview of the beginning stages of assembly:

As I get farther into the assembly process (the entire system will use four identical copies of this board) I will attempt to get some action photos detailing my surface mount soldering process. This is my first time soldering a .5mm pitch QFP package (the PIC18LF8722) and I was pleased to find that it wasn't bad at all. The only remaining question mark then is the 8CASON package of the 64Mbit Atmel flash memory (shown at left upside-down next to its final home). It fits an SOIC-8 footprint, but with no width to spare, and it is a leadless package, so there is no pad or lead for me to solder with my iron. I'm optimistic about soldering it with ITP's rumored hot air station, so hopefully tomorrow you will be seeing photos of at least one fully completed board and one smiling student, and maybe a hot-air soldering tutorial from a rookie's perspective.

Otherwise, all is proceeding well. Here's a preview shot of the fantastic frame and support mechanism that my father is currently crafting for the project. This photo is a few days old, and the piece is coming along great. We should be starting to put all the pieces together within the next few weeks. Stay tuned...

Update:

I should also mention that I am trying Kester 331 Water Clean flux and the matching solder for the first time and it is incredible. At the first impression at least, soldering is just as easy as with the standard 44 flux/solder that I have been using for years, but the flux residue comes off the boards with a hot water rinse almost instantly. It's far easier to clean 331 with hot water than it is to clean 44 with acetone and alcohol, and obviously much more appropriate to do so in my apartment. I highly recommend it. Of course it is still leaded solder, so don't forget to wash your hands.

November 5, 2006

PCB Tools Overview

Michael Ang and I are teaching a DriveBy at ITP on Monday the 13th about electronics without breadboards, which is to say PCB design, production, and surface mount soldering. In the meantime, I thought I'd give a quick overview of my toolchain from PCB design to production. More details to come, both at the DriveBy and on this site. But for now...

PCB Design

CadSoft Eagle (Mac version requires X11 from Apple)

The freeware version of this package lets you draw boards up to 4" x 3.2". It's a great package, with solid part libraries, and good functionality to easily add your own custom patterns. It's equally at home with surface mount or through-hole designs, and it's the tool we will focus on at the DriveBy.

There are a few quirks to the interface that take some getting used to. First, in order to act on a group defined by the Group tool, you need to right click. On the Mac, this is substituted with a command-click (Make sure 'Emulate three button mouse' is active in the X11 Preferences). So to move a group of items, group them with the Group tool, then switch to the Move tool, command-click, and you're off.

Secondly, the Copy tool oddly only works with single items. To copy a whole group, you first use the Group tool to select them, then switch to the Cut tool. Command-click (note that this doesn't cut in the sense that Windows users are used to, but actually is more like copy), and then switch to the Paste tool to lay down the copy.

The next stumbling block is getting your files exported in the right format to get PCBs manufactured. Virtually always this means Gerber files. Here is a good tutorial from SparkFun about this. For my recent project, a 3D dimensional spherical surface display (PCB shown at left), I actually used the .cam file from the tutorial to do my export. The job is still processing, so we'll see how it goes.

Panelizing Jobs

For my last few projects, I have used Gold Phoenix PCB for production, and have been very satisfied with the service. They can go down to 4 mil trace/space (for an extra fee), and also have cool extras like colored soldermask (also for an extra fee), and a good expedited service (also for an extra fee - surprise?).

The special at Gold Phoenix typically is for one board of around 1 square foot. This means that, since the free version of Eagle can't handle designs over about 3"x4", we need a way to combine multiple designs after the fact into one panel.

GerbMerge to the rescue. This is a Python app that takes the Gerber files exported from Eagle and combines them into a single design using random placement to find a near-optimal layout.

It requires mxBase 2.0.4 and SimpleParse to install. Once installed, you control it using a configuration text file, which you have to customize to the specifics of your project (filenames, number of copies of each board, etc.). There is a sample configuration file in the documentation that will help you get started. Here is mine from this last project, if it might help.

Viewing Gerbers

Finally, once your boards are designed and panelized, you will want to take one last look at your files to make sure that all is correct before sending them (and your money) off to have the PCBs fabricated. There are a number of ways to accomplish this, but my favorite of the moment is gerbv, an open source package created specifically for this task.

There is a Windows port linked from the SourceForge page, but for Mac, the easiest way to get it is through DarwinPorts. It grabbed a whole list of dependencies for me completely seamlessly. You will have to add /opt/local/bin to your path if it isn't already included, though.

When it is all installed you can run it with the files you want to see as command-line parameters, giving you a view of your output files like the one shown here.

More...

This skips about 99% of the process of designing a board, but hopefully will be helpful in getting some tools setup and being able to start playing. Again, the DriveBy on Monday the 13th will cover this and more in more detail, so come with your questions or feel free to post them in the comments to this entry.