Monday, June 22, 2009

Using the TripleWide X to Make an Open Source PSP

...that Plays Ping Pong. Sony's got nothing on the Arduino... :-)

Update: A lot of folks have emailed me about posting a kit to build the Open Source PSP, so I've added it to the Liquidware site as the "Open PSP Kit". Thanks!

Introducing the TripleWide ExtenderShield X (and Pascal's Triangle)

The Open Source TripleWide is funded by the Open Source Hardware bank (thanks!) just came in the mail, and Mike and I spent past week building up a few of them. The TripleWide is like the what yuo'd get as the result of applying the binomial theorem and Newton's expansion, represented in Pascal's triangle... in other words, first there was a protoShield, then a bunch of different types of protoshields, then a DoubleWide ExtenderShield, and then a TripleWide ExtenderShield.

Assuming this:


Therefore this:

But since Pascal's triangle has two 3's in the third row, naturally that means there had to be two different versions of the TripleWide: one with single inline headers to fit the Arduino, and one with double inline headers for the Illuminato ... hence the "X" name:




Incidentally, I think it's safe to say the next row (called the 4th row because the top 1 is the 0'th row) of Pascal's triangle is a bit intimidating... I can't imagine what a QuadWide or SextupleWide ExtenderShield would look like - actually I can, and it's not pretty, and certainly not small.

Anyway, the whole point of the TripleWide is to allow someone to put up to 3 shields on an Arduino Mega or Arduino Duemilanove or Diecimila. That initially sounds weird, but now that there are more and more shields out there, it's starting to make sense. For instance...


The Open Source Ping-Pong-Playing "PSP"



Here are some pictures of the TripleWide ExtenderShield placed on top of an Arduino, with a TouchShield, and 2 InputShields (one set to mode A, and the other set to mode B):






And here's a video that Mike took of him and Chris playing the ping pong game:



The source code for everything is over at the "App Store"... and I just put the TripleWide up on the liquidware shop...

Tilt-based accelerometer-powered Space Invaders

Mike just sent me an email with the urgent flag set with a link to ArduinoWill's video... what I'm doing still up at 2 am on a Sunday is anyone's guess... but this was definitely worth it...



"This clone of the classic Space Invaders game runs on the Arduino Duemillinove with the Liquidware TouchShield Slide and the Sparkfun 3 Axis Accelerometer. Using the accelerometer as a tilt sensor to control the movement of your defender and tapping the screen (running my 1.4 firmware) to fire."



Ha ha - what's up with shooting your own bunker... boo... what's the cheat code for regeneration? :-) The coolest part to me is the part where depending on how far accelerometer is tilted, the speed of the slide either goes faster or slower.

The souce code is uploaded over at the "App Store" (which isn't really a store because everything is Open Source and free...)... and to top it all off, nice icon :) That's pretty cool...

Thursday, June 11, 2009

Designing the Illuminato, Round 3

With two projects (the ButtonShield and the Illuminato, Round 2) now out the door, I figured it was time to get the ball rolling on a few others OSHW Bank projects. Justin S, Andrew, Jeff, and a few other folks have been working on shields of their own, and I've already gotten quite a few questions and suggestions about Illuminato, Round 3.
A USB-mini connection and standoff holes (thanks Robb!) are a couple thoughts that floated to the top. What do you think? Feel free to get a hold of me directly at jhuynh at gmail. I guess this is one makeshift way of doing collaborative, open source hardware design, without having to ship Gerber files back and forth :)
Then in about a week or so, I'll post up a revised list of features going into the next Illuminato here and over on the Illuminato page from the shop, based on what everyone seems to be looking for, and open up the OSHW Bank queue for Round 3!

Wednesday, June 10, 2009

Live footage of the ButtonShield in the wild



Here's a little video of the finished ButtonShield in action. This video shows me pressing the buttons one by one, and showing what the shift key looks like. This is the quick version:




Of course, here's the source code that runs on the Arduino - it's very simple, to keep the interface at a bare minimum. That way, the Arduino doesn't have to constantly poll each of the buttons one by one - the ButtonShield takes care of all of that, and just sends back its values.





#include < ButtonShield.h >

ButtonShield buttonsA = ButtonShield(0); /* Created a new ButtonShield on Mode A */
ButtonShield buttonsB = ButtonShield(1); /* Created a new ButtonShield on Mode A */

void setup() {
Serial.begin(9600);
}

void loop() {
Serial.print("ModeA: ");
Serial.print(buttonsA.readButtons());
Serial.print(" ModeB: ");
Serial.print(buttonsB.readButtons());
}



Each board has a built-in set of "firmware" that takes care of polling the buttons, and abstracts a lot of the really annoying parts of dealing with 36 buttons and 2 modes (thanks Chris for helping me on that part).

And this is the (really) long version of pretty much the same thing, except it also shows a little more detail on getting the shield up and running:



Oh, by the way, you can't really see it in the video, but there's also a single high-brightness white LED on the backside of the shield, which serves a little as a "backlight". Of course it it's too annoying, there's an SPDT switch on the backside that toggles the backlight on and off :-)



Thanks!

Monday, June 8, 2009

Introducing the ButtonShield

This weekend, Chris, Omar, Mike, and I got together, and we "learned" how to use a "solder reflow oven." Technically, we didn't so much learn as "stumble along" and it wasn't so much a reflow oven as a $120 Target-bought toaster oven (rated to go as high as 350 degrees Fahrenheit). This isn't hot enough to melt solder under specification, but luckily for me, Target sells cr*ppy^D^D^D^D^D^D^Dwonderful toasters, and the one I bought delightfully exceeded my expectations and its specifications and got all the way up to ~480 degrees.

Here's a picture of the finished ButtonShield:

It's a small Arduino shield keyboard that snaps onto the standard Arduino pin layout, has 2 modes so it can be used with most other shields out there, and has a space bar and shift key that lights up 2 LEDs in the lower left of the shield when pressed. Its compatible with the Diecimila, Duemilanove, Mega, Illuminato, and Basic STAMP (using the CoreBoard). I got the idea from Justin a few months ago when the Open Source Hardware bank was launching, and thought it would be a fun project. It wasn't my idea originally, so I wasn't going to build it unless someone wanted it. And apparently some did, because a the pre-buy queue on the Open Source Hardware Bank kept filling up! Here's a highly technical description of what it is - note, it is *NOT* a Butt-On-Shield as the spacing and capitalization below would have one believe:


It has a shift key and a space bar up in the front left corner of the shield. I couldn't find buttons anywhere shaped the say I wanted, so I borrowed a design lesson from my old art courses and "implied a platonic shape through the use of space juxtaposed with void" ... translation: I outlined it:


This is a picture of the reverse side of the shield. It has an A and B mode switch, so I can choose which pins I want to use on the shield (to make way for other shields, for instance). The pins happen to be the exact same as the InputShield, so technically an InputShield and a ButtonShield could be used at the same time on an Arduino without clobbering each other:

I think I like this angle better - it shows the dedicated processor on the back, which simplifies grabbing keystrokes because it takes care of all the constant polling of each key so the Arduino doesn't have to occupy all that space in its main() loop:
Borrowing from the Illuminato's design, each edge has a set of exposed JTAG programmable pins:


That was nice.... now on to the gritty details of how the shield actually got made (it all happend this past weekend)... Since this was the first time I had done oven-based solder reflowing (instead of doing it by hand), I followed a bunch of tutorials online, and they all said to pay $99 to get a stencil cut. So I did. It came in the mail, but none of us could figure out how to line up the PCB to the correct holes. Alas, a few google searches later, and I figured it out (thanks Nate and Electronics Lab):


Here's a picture, top-down, of the stencil covering a PCB, getting ready to smear solder paste on it. The can of solder is on the right, and the squeegy is right below it:

Once that's on, Chris and I ran the $1,000,000 Professional Pick-and-Place called MattAndChris'sHand(tm). Each board needed 34 buttons (4 rows x 8 columns plus space and shift). I got in a groove, and noticed if I did one board, it would take me about 3:30. But if I lined up 3 boards, it took me about 2:45 for each board. And if I lined up 5 boards, took a swig of coffee, and had all the buttons in front of me, I could do one board in about 2:25. According to the Henderson Experience Curve, that's not bad, but I shouldn't expect to go much faster than about 2:15 even at my best.

This is what the board looks like with all the buttons it, ready to go into the oven:

And here's a shot of a few going into the oven intially. They need to "bake" for about 2 minutes:

Here they are cooling down... each time they came out, Chris took it upon himself to announce, "The Cookies are Ready!" And yet somehow, for him, that joke never got old, not even after the 14th time:

Ok, side 1 is now done, but these boards have a second side. So time to solder paste the backside...:

...and to place the next set of parts:

One by one, I loaded them onto the tray:

And Chris then put them into the oven:

Of course, when they came out, on each board there were about 1 or 2 little mistakes, where the solder paste globbed up and crossed or connected a few of the leads on the chips (especially on the backside). That was mainly because I used too much solder paste at times, but it's pretty hard to control how much gets pressed down through the holes... so... time for some manual rework:

And here's Chris sitting next to Omar, who stopped by to help program each of the ButtonShields with code when they were done being reworked (and after Mike cleaned off the flux from each board):

So now what? Well, now that the boards are done, and programmed, it's time to start building some toys, like a portable Arduino computer:

And a project I've been wanting to do for a while now, my Arduino-Powered Star Trek Tricorder:




Judging from my highly scientific comparison of mine vs. the original, I think it's safe to say that despite being several star dates before the Spock-wielded tricorder, mine has more buttons and is mesh networked. Put that in your super-logical, pointy-eared pipe... :-)



In the meantime, I've uploaded the ButtonShield over on the liquidware website, and I'll post another blog tomorrow with a couple videos of the ButtonShield in action :)

Wednesday, June 3, 2009

5 Ways Open Source Hardware is Like Big Pharma

Ok, first things first. There is one big, obnoxious, clear way that Open Source hardware is NOT like big pharma: it’s not a large profit-seeking institution in a market that tries to make money through complex ethical decisions about life or death. Now that that’s out of the way, I can move on :)

This past weekend at Maker Faire, Phil was nice enough to extend the invitation to me to sit on the OSHW panel, next to some other very active OSHW advocates. He threw questions about licensing, collaboration and asked for examples from the panel. I participated, but I also took notes in order to write up all the things I wanted to say but couldn’t… for this blog. I’m very biased I think. In preparation for the panel, I spent some time researching major industries for examples and analogies to Open Source Hardware, because I’ve come to disagree that Open Source Hardware’s nearest and dearest cousin is Open Source Software – I think it’s something else, maybe even more like patents? In the meantime, I think there are strong arguments that OSHW has very little to do with OSS. So, I’m going to try to make my case that OSHW is a lot like Big Pharma... based on the notes I took on an index card during the panel…

1) Innovation Costs Big Money
I hate the word "innovation" because it doesn't seem to mean anything anymore. Anyway, there’s some statistic that floats around the pharma industry that to develop a single drug, it costs billions of dollars. It's one of those rites-of-passage that people in the pharma industry seem to say a lot, because of course it doesn't cost that much; most of the expense goes towards throw-away costs of failed drugs that never see the light of day. Just replace failed drugs with solder, expendables, broken revisions, website infrastructure, hosting costs, coding time, oscilloscopes, microscopes, compiler and JTAG debugger costs. There’s a strong incentive in the pharma industry to distribute, re-allocate, or spread out all those funds. That’s fancy-speak for “try not to pay it all yourself, and instead find a way to make someone else pay.” Open Source Hardware is the same way, at least for me. Where at all possible, guys I know (and I) try to use equipment and borrow software and materials from school, work, institutions, and labs willing and able to lend. Otherwise, setting up a lab to do OSHW (at least to my degree of happiness) would have cost more than $30,000! So OSHW wouldn't happen without shared infrastructure.

2) The Generic "Replicant" Dilemma
Call it hindsight obviousness... Apparently, it costs large amounts of money to find the chemical or substance that has a direct and measurable impact on a specific disease. But once you have that formulation, it costs relatively nothing to reproduce. Big Pharma has this problem in a very big way, with generic drug manufacturers. In 25 words or less, the problem is that Indian production companies churn out unbranded, but nearly identical versions of the branded drugs, and sell them at fractions of the cost. Some people argue that the branded version of a drug means quality, service, or even placebo effect that results in a better "health outcome" (ugh - more business words), but at the end of the day, from a strictly functional point of view, there’s no difference. Same with Open Source Hardware. Right now, there’s a big difference between the “individual” and “institutional” Open Source Hardware. Individuals like OSHW because they (I, me) can hack and alter what I buy. But institutions don't really like Open Source Hardware, because if a company builds 50 of something that is “Open Source” there’s a big risk that another company will improve the design and make 50 better versions of the electronics, and then some of the original 50 never sell, and that means the first company to build something risks losing money.

That's weird. It boils down to: Consumers and Producers have very different incentives when it comes to Open Source Hardware. That brings me to…

3) Damn Gestalt! The System Works Better Than Any One Part of It
There’s some meme in press that floats around that the biopharma and biotech industries seem to produce drugs, those drugs seem to help people, and in general progress is made. But for every 1 company that does well, dozens of others smaller companies fail to push a single drug past FDA approval, and go bankrupt or get bought out for pennies. It's like drug pipeline portfolio theory: in general, designing and selling drugs is profitable, but betting all your money on any single IND probably isn't going to work out. It’s also like a “gambler’s dilemma” – every once in a while someone wins, and that makes everyone happy, but on average everyone loses money. Open Source Hardware works the same way. For every project that takes off, there are dozens that don’t quite work, and each project usually costs a few thousand dollars in PCB revisions and soldered parts. So as an individual, it can cost money to participate in the R&D part of Open Source Hardware, but as a customer or consumer of Open Source Hardware, it’s great because I get all the benefits! The Community as a whole does better and gains more than the average Contributor. I think I'm going to call this the "Open Source Hardware Gestalt Curse."

The solution, I think, is to try to remove the split between consumers and producers. If OSHW is always done by DIY'ers, the system balances because the individual who bears the cost to build something immediately sees their own reward.

4) Little Orphan Annie^D^D^D^D^DDrug^D^D^D^DCircuit
For the most part, OSHW – by necessity and opportunity, not necessarily demand – has focused initially on what some might call “Long Tail” products. That’s fancy-speak for “stuff only I or about ~10 other people want” (or if you’re far enough towards the end of the long tail, it means “stuff no one wants” – hmmm does the long tail go to zero, or just hover at 1 for a really long time?). In other words, it doesn’t make any sense for a company to make. In Big Pharma, there’s a similar problem – some drugs cost so much to make, that no company really wants to make them, so they don’t get made at all. Or, a drug can’t be marketed or sold at a high enough price, so there’s no profit. That’s a lot like what the Open Source Hardware Bank was introduced to do for the Illuminato. The Illuminato is sold at cost, so no company would ever say, “that makes sense to build!” But it doesn’t mean it shouldn’t exist. It just shouldn’t exist as produced by a company trying to make profit. Maybe Big Pharma should set up an Open Source Healthcare Bank?

5) Surplus Allocation: Who Deserves It More vs. Who Wants It?
What is the relationship between open invention and capitalistic profit? Who deserves to make money? In Big Pharma, who has earned the right to keep the profit made off of drugs? Should the pharma company keep all the profit, as a reward for trying to fund so many other drugs that didn’t work out, or should the insurance companies make profit by reimbursing less for the price of drugs, or should the individual inventors make all the money since they discovered it all? It seems that the big pharma business model has a build-in assumption that the institutions that take risk of managing drug portfolios (and over-pay executives) should deserve the profit. Open Source Hardware has a similar question to face: should OSHW be sold at a profit at all? If so, who really earns it? Should the people who provide the money earn the profit, should the guys who design the board get the profit, should no one get the profit? This is a very real problem to be answered: should OSHW project brand names be licensed to derivative boards (and if so, for how much?), is it right to make money from students when they buy OSHW stuff (probably not?), and what are the appropriate considerations for an OSHW license that differ from OSS licensing (e.g. replication, recompilation, and enablement means very different things to hardware than software).

It's easy to ask lots of questions... it's harder to design PCB's ... so back to building the ButtonShield!

Monday, June 1, 2009

Maker Faire 2009 at San Mateo

Wow, that was incredible (and exhausting), and now that I'm back, I'm pretty tired, despite it being Monday morning. I can now see what the big deal is all about, and why so many people make such a big deal about going. In hindsight, it was definitely worth the plane ticket, and waking up really early to head out. I spent some time with Justin at the little table (not really a "booth" per se but it worked), but I also spent a lot of time walking around and finally meeting as many other guys as I could. Here are a couple of pictures I took along the way...

This was a picture I took while I sat out on the curb, waiting to meet up with Justin. It was right in front of the fairgrounds (which was in back of me):



This was everything I traveled out with (including the little cup of coffee, and on the way to the airport in New York, I found a plant shop that sold venus fly traps, so I grabbed one of those too, of course):


This is the outside of the building:


Justin and I wanted to replicate what it pretty much is like in CT, NY, and MA when Chris, Mike, Omar, Mark, Tim, Justin, and I get together. It's pretty much chaos, so that's what the table looked like:



I snuck out around the back of the tables and took a picture of Justin showing the TouchShield and the Arduino:



Here's another shot ... (btw, a lot of people in California wear hats apparently. I noticed that all day). This picture was taken shortly before a couple of guys (dudes?) walked up to the table, said they were Stanford engineering undergrads and asked me and Justin "what's the market size for Arduino." Justin said, there are 10's of thousands out there, and one of the guys said "Ha! That's too small to make a difference, and definitely not worth all the effort you put in." Ok, well, I always thought Stanford was a smart place and that folks who went there were nice people. Now, I suppose I can officially say a group of Stanford guys thinks Justin and I are dumb ... oh well ...



There were a couple of TouchShield Slide's at the table, running various apps. One of them had the drawing program Mike made, and a guy came over and drew a fish on it:



At the end of the day, Justin and I got a Make Editor's choice ribbon, which definitely made up for the Stanford guys - take that!



And then I took a few last photos of the fairgrounds building (btw, in the northeast, "fairgrounds" are where livestock are displayed during farmer's markets and festivals. I wonder if that means the same thing in California too...):



Here's another angle, taken lengthwise of the building, which is massive by the way. And of course Justin is in the middle, equally tired as I was at that point:



I was looking on the web, and noticed that Foreverbird snapped a picture of Justin :-) So I linked to it below (Foreverbird took this one, not me)... and you can see the latest version of the OpenBerry project on the table there, actually. I haven't updated or blogged it yet, but I've been coding it ever since...



Thanks to everyone who stopped by and said hello, and especially since this was Justin and my initiation to the West coast and the California DIY culture, it was nice to meet a lot of friendly folks.