Thursday, December 30, 2010

Designing for the degenerate case

In mathematics, a degenerate form is one that cannot be perturbed in some way without being rendered a member of a larger, more complex class.  For example, a circle is a degenerate ellipse- change the constant multiplier of one of the terms and you push the form out of the class of circles into the larger class of ellipses.

Next time you're solving a problem, ask yourself: am I solving for a degenerate form?  And, if the answer is yes, is that important?  Let me give an example where the answer to both questions was "yes".  I was tasked once with supporting some motion code which was intended to align a circuit board on a conveyor belt under a camera.

The code as written worked fine in the lab, but in the field, customers began to complain of erratic and unpredictable behavior- boards which would be incorrectly positioned at the start of inspection, pushed off the end of the conveyor, etc.  It turns out that the code had originally been written to the degenerate case of a PCB that had no slots or notches and was less than 300mm long- even though the system was specified to handle ANY board of a length up to 450mm in length.  The result was that it was relatively easy for a slot (or even a hole for a component lead in boards coming through before soldering) to allow enough light through to fail to activate the accurate positioning sensor, resulting in a misaligned board.  Longer boards caused a problem too- they would be (only occasionally) detected as fault conditions because they would trip more than one sensor at once.  Once I rewrote the code with the mental model of trying to align a picture frame with non-parallel leading and trailing edges (basically, the broadest possible class of objects that could come through the machine), a huge number of field issues resolved immediately.

Perhaps the most serious of these degenerate cases is the "normal" human.  I have a number of "abnormalities" (if you will; I hope I don't offend anyone with my terminology but it's important, I feel, to consider denotation rather than connotation and to realize that "abnormal" is, in fact, a term with no qualitative meaning) of capability which have rendered my life, if not worse, at least harder than necessary.  The most significant one is my colorblindness.  I'm a deuteranope* - I have a great deal of trouble with red-yellow-green colors.  I have a great deal of trouble with bicolor LED indicators- the colors of yellow, orange, red, green, and amber used in cheap indicator LEDs are all basically identical to me, differing only in intensity.  The result is that I can  get relative information from them (changes in state) but I can't get absolute information from them (is the light red or green?).  If the encoded information is VERY important (for instance, stop/go signals at an intersection), and color is the ONLY way it is presented, or the only absolute way in which it is presented (for instance, some areas have stoplights that are horizontal, and green can be on the left or the right depending on the orientation of the intersection), the result can be disastrous.  At best, it's an annoyance to roughly 10% of the population who lack "normal" color vision.**

The best way to avoid designing degenerate case flaws into a system is to explicitly write down what your expected use cases are.  Get other people to look at them, and to look for holes in them.  It's okay to discard their feedback, and it's not always important to expand your design to break free of a degenerate case (sometimes it's just too expensive to support every use case, and sometimes other restrictions rule out the need for supporting some use cases)(no need to encode the speedometer in a car such that a blind user can interpret it, for example), but you should consider them just the same.  Fixing a design after the fact is far more expensive than doing it right the first time.

* I think I'm a deuteranope, anyway, based on discussions with a very smart coworker (who happens to be deuteranomolous).  Most online colorblindness tests will only provide a better diagnosis than "yes, you're colorblind" if you enter SOMETHING in the field next to the Ishihara plate image, as the shape you see is what determines what type of colorblindness you have.  I can't see ANYTHING in most of them, but "nothing" isn't an option.  Ironically, these pages were probably designed by someone with normal color vision who completely failed to consider my case.

** So how to solve this problem?  Use two LEDs instead of one with two colors, so the information is position encoded as well as color encoded.  Use a blink code.  Use colors which will be discernible to the largest number of potential users (relatively few people have a kind of colorblindness that causes them to confuse blue with any other color).  Use significant differences in intensity to encode information.

Tuesday, December 28, 2010

5 comments on DIY projects that deserve a big, fat STFU

Whenever you put a project out there in the community, be it on your blog, a community board, or as an article in another venue (or if it gets picked up by say, Hackaday or Make), you're bound to get some comments that are, shall we say, worth less than the calories they took to type.  Worse still are the times you get these comments from someone to whom you are explaining (in meatspace) your current pet project- those times can be a SERIOUS buzz kill and I've lost the will to finish a couple of projects after comments like this.
  1. "You know, Target sells something that [does that]/[does almost exactly that]."  This is more common in meatspace than on the web, I think, because the web audience self-selects for people who understand that the joy is in the making, not the having.  And, frequently, the "almost" is where the bugaboo lies- I want EXACTLY that, not ALMOST exactly that.
  2. "Arduino is for losers."  Or some variation thereon.  Arduino, as a platform, is a lot like Python: best used when development time is the most precious commodity of all, more precious than CPU cycles, money, or cachet.  People who get that, use it.  People who don't get that spend a lot of time trolling comment threads but never actually make anything.
  3. "Using a microcontroller/PC parallel port/Arduino for that was total overkill."  Yes, I know, you could have built that project with four 7400 series logic chips, three capacitors, a resistor, a piece of perfboard, and an inflatable duck, but A. I didn't have those on hand, B. designing that circuit, wiring all that crap together and troubleshooting it would have taken more time than I wanted to spend on the project, and C. I made it and you didn't, so shut up.
  4. "I/my cousin/Nikola Tesla/Jeri Ellsworth already did that better."  That's great, really.  If my "project" page is just a detailed description of my assembly of someone else's kit, I probably deserve to be chided (or at least ignored).  But if not, then the odds are that I either did it ignorant of the prior art (which means my work should be judged on its own merit, not against someone else's) or I think I have something to add on the topic (in which case, you probably didn't read the post to see what I added before commenting, and shame on you for that) or you/your cousin/Nikola Tesla/Jeri Ellsworth didn't post it on the web or adequately document it (meaning, my documentation of the project adds to the richness of the human experience, or something).
  5. "You have too much time on your hands."  Another troll comment from someone who thinks they're hot stuff but never actually does anything.  What, pray tell, SHOULD I be doing with the tiny little amount of spare time I carve out of parenting, working, housekeeping, commuting, and sleeping?  I MIGHT tolerate this from someone who doesn't even OWN a television (because if you own one, I guarantee you spend more time watching it than you think), but since that's only something like 1.5% of the population and that 1.5% is too busy being productive to level such a shallow criticism, anything I'd suggest to this commenter would be inappropriate for a public venue.
I'll tell you who I feel bad for- the kids of these wastoids.  "Pshaw.  You call that a fingerpainting?  Have you ever heard of perspective?  Composition?  Wiping your fingers between colors?"

So, as your mother should've taught you, if you don't have anything nice or constructive to say, STFU.

Last thought- this is a major reason hackerspaces are awesome.  Most of these comments are easy in the faceless netvoid but you'd NEVER trot them out face-to-face.  Plus, by their very nature, hackerspaces attract the people for whom the doing is the most important part; for them, results speak louder than words.

Monday, December 27, 2010

Draft proposal for SI units for bitching...

... as proposed by Jeri Ellsworth:  the "Jones", after EEVblog's Dave Jones.

As with all SI units, we must define it in terms of base units, so I propose this:

1 Jones = (# of complaints about a topic) * (sum of levels of annoyance caused by said complaints weighted by exposure frequency to causative events, in seconds between exposures) * (# of people likely to be exposed to your ranting)

Obviously, the level of annoyance varies from person to person; I imagine a level 1 annoyance ("mild eye rolling followed by repetition of action until desired result is achieved") for a more patient colleague might be a level 5 annoyance to me ("loud sigh with posture change and muttered profanity") and could rank to a level 100 for someone else ("widely distributed internet video rant with attendant behavioral change and increased probability of property damage to exact retribution on an inanimate object").

As a practical example I'll float my issues with OrCAD- there are five things which cause me pain every day with OrCAD, three level two issues ("eye rolling with quiet sigh") and one level 6 issue ("profanity audible but not comprehensible to workers in adjacent cubes") and one level 50 issue ("loud cursing and banging of mouse on desk").  Weighted, I'd say I get one level two event every 60 seconds of OrCAD usage (.033), one level 6 issue every 300 seconds (.02), and one level 50 issue every 3600 seconds (.014), for a total weighted annoyance of .067.  At best, normally, about four people are exposed to my ranting; thus my irritation with OrCAD is about 5*.067*4 = 1.34 Jones.

The nature of this is such that it is similar to the Schmidt Sting Pain Index- individual preferences and tolerances will affect the outcome heavily, as does personal audience size (clearly, Dave has a much bigger audience than I do).

Tuesday, December 21, 2010

Regulators, mount up!

On the heels of a few tweets regarding linear voltage regulators that I passed with a friend yesterday, I think I'll do a couple of posts on voltage regulation.

First, the general concept: voltage regulation is the creation of a stable, low-impedance DC voltage source from an unregulated DC voltage source.  Examples of unregulated DC voltage sources are batteries, "wall wart" type AC/DC converters (even though many of these create very good voltages (these days, anyway), you should always assume that you (or someone else) will plug a different supply in), car cigarette lighter sockets, rectified and filtered transformer outputs, solar panels, fuel cells, dynamos, and fruit with pieces of zinc and copper in.  In fact, pretty much anything other than a locally generated voltage from a well-designed regulator circuit should be treated as an unregulated source (for design purposes, at least).

This first post will concentrate on linear voltage regulators.  Sometimes you'll hear these carelessly referred to as "LDOs", although the LDO (low dropout) regulator is really a subclass of linear voltage regulators, and not all linear regulators count as "low" dropout.



Pictured above is a typical linear regulation circuit.  V1 is the unregulated source; D1 prevents a reverse-connected power supply from destroying the circuit, and should be a large enough power rating that it won't be in danger of damage when the circuit is energized (the 1N4001 is not a bad choice for this, although at higher currents it has a fairly high forward voltage drop).  If the voltage drop from a diode is unacceptable, there are linear regulators available that have built-in reverse voltage protection (the LM2931 is a good example of this), and there is a trick that can be played with a PMOSFET which provides good coverage at the expense of increased cost (I'll not cover that here- maybe in a future post).

The capacitors are where the real work comes in, so to speak.  Every different type of linear regulator will want to have different capacitors on the input and output- some will be happy with no, or minimal capacitance, while others will want a large "bucket" capacitor to provide current during surge periods.  Some need a minimum amount of ESR (equivalent series resistance) to avoid oscillatory behavior while others are fine with a low ESR tantalum electrolytic or ceramic on the output.  There are three things that need to be said here:  first, ALWAYS check the datasheet for the part you're planning to use.  The manufacturer will typically specify on the front page, in bold lettering, quotated, underlined, with a little drawing, what they expect in the way of capacitors and whether low ESR caps are expected/accepted.  Second, the bucket capacitor on the input (C1 above) is much less important in most cases than a decoupling cap and output capacitors, UNLESS there's a significant distance between the unregulated supply and the regulator (i.e., a long wire running from a wall wart calls for an input cap, but a battery a couple of inches away likely doesn't).  Third, you should derate the capacitor voltages by a factor of  (at least) two- if you expect to see 12V on the input, use 25V or better capacitors.  Ceramic capacitors are quite tolerant of at or near spec voltages, while aluminum electrolytics will suffer from prolonged near-spec voltages and tantalum electrolytics will freak out and die horribly with even small spikes above their rated voltage (seriously)(we're talking fire and brimstone freak outs, here).

So, now that you understand the circuitry, there are a couple of other key concepts to understand: quiescent current, dropout voltage, and power dissipation.  Quiescent current is the current the regulator "wastes" in the business of doing its job.  This is another look-it-up-on-the-datasheet value; the quiescent current will vary based on the cost of the regulator and the momentary load current (usually the Iq vs Iload spec is shown by a graph on the datasheet).  Some regulators will have very low quiescent currents (<10uA); it rarely ranges above a few mA.  The variation across load currents is usually not huge in absolute terms; for instance, the LM2931 mentioned above is from 1-10mA across its specified current range.

Dropout voltage is the minimum voltage difference between the input and the output.  The dropout voltage will increase as the load current goes up, and as the temperature of the device increases (we'll talk more about this in the power dissipation section).  If the input voltage is not greater than the output by at least the dropout voltage spec, the regulator will not perform as specified.  Typically, the output voltage will begin to sag, and will remain at a level of approximately Vin - Vdo; as Vin sags further, so will Vout.  Other characteristics will suffer too, such as noise rejection and surge current response.  Cheap regulators like the ubiquitous 7805 may have a dropout voltage exceeding 1V for even fairly light loads; fancier regulators may have dropout voltages well below .1V for light loads.

Power dissipation is the big bugaboo with linear regulators, and the limiting factor in their use.  The standard EE equation of P = I*V is applicable here; as the output current increases, the power dissipation of the linear regulator increases, as well.  The actual equation should look more like this:
P = Iq*Vin + Iload*(Vin-Vout)

This leads us to a couple of observations:  first, the greater the Vin/Vout delta, the more energy is wasted.  This is an important data point, because, while running a 5V system off a 9V battery with a cheap 7805 regulator may seem like a no-brainer, you're going to waste a tremendous amount of the battery's capacity.  An Arduino doing not too much pulls about 70mA; at that rate, you're going to deplete a 9V battery to 6V (which is probably about as low as you want to go before you start to eat into the margin of dropout voltage plus protection diode voltage) in something like 8 hours.  Add an Xbee module and you're going to end up below half of that time.

Second, the greater the Vin/Vout delta, the hotter your regulator is going to get.  With a fresh battery, the regulator on your Arduino is going to be dissipating close to 300mW, BEFORE you add additional load.  Again, the datasheet will give you some idea of what you can get away with here: typically, there will be parameters for Vin max, Vin - Vout max (more important with adjustable regulators), Iout max and Pmax, and typically there will be multiple values for each depending on the selected package and whether or not the device is provided with a heatsink (either in the form of an actual chunk of metal or a solid connection to a large pour of copper).  You'll need to comply with the most restrictive combination- if your 5V regulator specifies 20V maximum input, 100mA maximum output current, and 500mW maximum power dissipation, you obviously can't expect it to source 100mA with a 20V input level without melting.  In fact, if that 500mW dissipation is depending on a big fat heatsink and forced air cooling, you might not even be able to reach that without destroying your part.

So, now, the question that started this all:  If I'm running a 3.3V regulator and a 5V regulator off a 9V battery, am I better off dropping the 5V to 3.3V or conneting the 3.3V regulator directly to the 9V supply?  The answer is, it depends.

Going from 5V to 3.3V is going to result in the 3.3V regulator dissipating less power (because the voltage delta is smaller); that may mean you can use a smaller regulator, or a regulator that can't tolerate the full 9V input supply.  However, that power dissipation gets moved from the 3.3V part to the 5V part, so there's no free lunch in terms of reducing total power consumption.  Maybe that's okay, because the 5V load is light, or because the 5V regulator can handle the greater power dissipation better than the 3.3V part could have.  It may also enable you to use the output capacitors from the 5V regulator as input capacitors on the 3.3V supply, or obviate the need for input capacitors on the 3.3V supply at all.

Connecting them in parallel has the benefit of spreading the power dissipation between the two devices; it also means that a brownout on the 5V supply won't bring down the 3.3V supply (which could be good or bad).

The driving forces behind the decision, then, become your selection of the regulators to be used and the load on each regulator.

Lastly, I'll say that, despite the seemingly great amount of detail here, there's a lot I've left out.  I didn't cover adjustable regulators at all (typically, they use a voltage divider to set the voltage at a pin, from which the output voltage is derived), or regulators with enable pins (generally used for power supply sequencing or disabling parts of the circuit when necessary), or multiple output regulators (pretty much the same as single output, but you'll need to sum the power dissipation of each output rail to calculate the total power dissipation of the package).  Most of that stuff is refinements of the information here, and this is a good practical primer on the topic (or so I hope).

I've got a few more posts on the topic- switched capacitor supplies, inductive switching supplies, batteries, and maybe more on other types of unregulated supplies.

Wednesday, December 15, 2010

Voltage dividers

A common problem in electrical engineering is the use of a resistor divider to create a circuit which derives a second (lower) voltage from a known voltage.  This can be for a reference voltage to an ADC (as on the Arduino), to set the voltage on an adjustable regulator (where the regulator seeks to maintain an output voltage adequate to produce a set voltage at a feedback node), or to calculate the gain on an amplifier circuit, among other possibilities.

The canonical voltage divider circuit
Usually, we know Vin and Vout, but R1 and R2 are unknowns.  We usually pick one of them (based on what's on hand, in the parts library, time of day, dog's birthday, roll of a 20-sided die, etc), then calculate the other.  Almost always, that results in a value which is not readily available, so we pick the closest value, calculate the error, decide it's too much, and pick another resistor value and start over.

Error in the output voltage has a number of possible sources:  input error (typically, we're pulling Vin off a supply rail, which means it's only as accurate as our supply; for a cheap 7805 shunt regulator that may be as much as 5%), bias current error of the sampling circuit (typically fairly minimal in most circuits, but if you want to use high-value resistors to minimize waste current for battery life issues, you may find that the minimal current drawn at the Vout node introduces significant error), variation of the selected resistor values from the ideal values, and error in the actual resistor values from their nominal value.  Depending on what you want to use the output voltage for, even a fairly small error can be quite significant: many devices want power supplies to be within 5% or less, and every little bit of error reduces your design margin.

There are calculators all over the web that will do some of this work for you but they are usually only algebra cranks- they ask for three values and calculate the fourth; they rarely look for a "real" value that will work, and they don't usually tell you what kind of error you're introducing.

Since the values available are discrete and with a fixed tolerance, it's fairly easy to write a program that accepts Vin and Vout as parameters and returns an arbitrary number of solutions based on real values.  Sure, it requires many thousands of calculations (for standard 1% resistors, there are 9,216 possible combinations if you consider only those within one multiplier (i.e., 1.00k<= R < 10.0k); if you expand the range (i.e., 100<=R < 100k), that number quintuples, but what are computers for if not for automating repetitive tasks?

Here's a program that uses Python (2.7) to solve for an arbitrary (default 5) number of solutions to the resistor divider problem.  As arguments it accepts:
  • Vin
  • Vout
  • Series (standard 5% (E24) values, 1% (E96) values, or an arbitrary list from a file)
  • number of results desired
  • whether to include values one step above or below the nominal range
It returns a list to the command line which specifies:
  • multiplier for R1
  • multiplier for R2
  • absolute nominal error
  • worst case errors, +/- (given the tolerance of the parts specified)
  • parallel resistance of R1 and R2 (valuable if output impedance of circuit is important)
The worst case errors are only calculated for standard values- if you input a text file, both worst-case values will be the signed value calculated for the nominal value.

As an example, the TI TPS73201 regulator sets its output voltage based on a voltage divider- Vin is the desired output voltage, Vout is 1.204V, and by selecting appropriate resistor values, Vout can be set.  Furthermore, the datasheet indicates that to minimize error, R1||R2 should be 19k.

A chart is provided in the datasheet for various common voltages; for 1.5V, the suggested resistors are 23.2k and 95.3k (both standard 1% E96 values).  Running the script shows us 24 value combinations that have a better nominal error than that combination, BUT none of those combinations comes as close to the 19k parallel impedance requirement.

Maybe at some point I'll get this script executing in some fashion on a website; if I do, I'll link it.  For now, download it and play with it yourself.  Execute it from a command line; the -h switch will print a fairly comprehensive help list.

Monday, December 13, 2010

Fun with super-cheap LED flashlights

Somehow I've become a prolific blogger lately.  I wonder if this will last...

Today at work I had a serendipitous moment of seeing two desktop objects in an abnormal light: a small, scavenged lens cell and a super cheap (2 for $5) LED flashlight.

As part of my on-going inculcation into the mystical arts of optical engineering, one of my fellow engineers demonstrated to me the ease with which an illuminated object can be projected onto a surface, if the various distances are correct.  His demonstration was with the image of the lit window that faces our cubes, but it occurred to me today that, by tweaking distances, I could probably get a similar image from my LED flashlight, writ large on a blank whiteboard.


Tah-dah!  What's more, I found that, by moving the lens slightly along the optical path, I could bring different elements of the LEDs into focus.  But lets start by analyzing this image.

First, you can see (though not very well) that the LED lenses are fouled quite badly.  Most of the speckling on the middle three LEDs is NOT the whiteboard.  More significant, however, is the fact that, of 12 LEDs, one is off entirely, one is barely on, and one is quite dim.  This is owing to the sub-par circuit design of this flashlight (for $2.50, I don't expect much, but, hey, let's learn from it!): the LEDs are basically all in parallel with each other and with three AAA cells in series.  The result of this is that the LED with the lowest forward voltage gets most of the current, until IT burns out, then the next lowest voltage, and so on down the line.  The LED that is off either has a REALLY high forward voltage or is the first casualty of this chain of failure.

Interestingly, although it's not visible here, some of the LEDs seem to be flickering a bit- this may be a precursor to failure or simply a result of bad solder joints (which is another possible failure for the "off" unit).  Rather than pads, the PCB (if you can call it that) which these LEDs are mounted to is essentially a couple of concentric rings of copper- resulting is an immense thermal mass which needs to be heated up to get a good solder joint.  Most likely, this is being done by hand in a Chinese factory (believe it or not, hand assembly is economical in many Chinese assembly plants), which opens up many possibilities for cold joints and overheated diodes.


By sliding the lens a little further along the optical axis, I was able to bring some other features into focus.  The middle three LEDs (particularly the lower left one) have clearly visible wire bonds to the center of the die.  This isn't really bad or abnormal- I've seen similar things on very expensive LEDs as well.  However, it's a pretty nifty little visible artifact of a part of the assembly process we normally don't think a lot about.

I'll also briefly mention the blue-ish color seems to be a hallmark of VERY cheap LEDs from China- I've ordered some "white" LEDs from the super-cheap vendors on Ebay before and they look almost more blue than white.

Sunday, December 12, 2010

If you can't find it, you don't own it (part 4)

Once you've got it all together, where do you use it?

My workspace is divided in half- an electronics bench with tools and a PC station.  The PC desk is boring- two 19" monitors, speakers, printer, etc- I won't bore you with pics of that.



There are only a couple of things I really want to mention here as being special about my desk.  First, the knife holders.  These are the standard type of wall-mount magnetic knife mounts.  Mounted vertically (because they were too long for horizontal) they hold my small tools- little screwdrivers, a wire stripper, a side cutter.  I have duplicates of all of these tools in the mobile kit but it's nice to have them handy.

Secondly, the whiteboard.  It's magnetic so I can stick stuff onto it, but it's really more useful as a whiteboard- I'm a big believer that whiteboards are the stuff engineering magic is made of.  I have four of them in my cube at work, and one of the smartest facility design elements I've ever seen was in the "new" (this was probably over 10 years ago) EE building at the University of Richmond.  Every hallway in the building had a little alcove directly across from each doorway where people who were walking along could stop, step out the line of traffic, and use a whiteboard in the alcove to explain a concept.

Third- drawers.  And more drawers.  And yet more drawers.  To have any prayer of being productive, you need to categorize and segregate your goodies.  The little wooden cabinets are narrow but long; the plastic drawers on top have several subdividers in each one, and the red cabinet in the lower left is big enough to accommodate quite large items (say, a 7" SMT component reel).

Finally, the monitor is (if I do say so myself) cleverly mounted:

I used a couple of long travel drawer slides from Ax-man to place it such that it can slide to the right, out of the way, exposing a shelf behind.  I keep that shelf mostly empty so I can stash a project that I'm not done with but putting on temporary hiatus.  This keeps the work surface from being cluttered with bits and pieces of stuff I'm not using at the moment, but which I'm not ready to put away.  Also note the little baggie to the left of the monitor- it's a "tiny trash" bag, where I can deposit trimmed leads, stripped wire insulation, ruined screws and the like, thereby keeping that stuff from building up on the work surface.  Clutter begets clutter.


The rest of my stuff is here- the shelves on the left are mostly domestic items- tool kits, screws, etc.  Stuff any reasonable homeowner should have.  Worth mentioning is that my junkbox cyclorama is just out of view in the lower left.  The boxes on the shelf at the back are individually labeled subdivided containers; when I want to put a project in "cold storage" so to speak, either because I want to work on it much later or because I don't want to tear it apart but I'm done playing with it, I throw it in a box, label it, and shelve it.  There is only one "random crap" box- EVERYTHING else is properly labeled, because boxes of random stuff might as well not exist when they get too big or too prolific in number.

Lastly, I'll say this:  there is a reasonable amount of unused space on the shelves on the left, at the bottom.  Unused in the sense that all the boxes that are stacked there are empty.  This, I think, is the last critical element of keeping your space under control: provide for growth.  If you can't immediately categorize an item (meaning, put it in a LABELED drawer or box), or create a NEW category for it (meaning, put a label on an empty box or drawer and throw it in there), the clutter will come back with a vengeance, and you'll never be able to find the parts you need.

Saturday, December 11, 2010

If you can't find it, you don't own it (part 3)

In part three, I'll show off my mechatronics tools and parts kit.  Part four will be my workbench and parts storage; that'll probably follow pretty closely on the heels of this since I'm so totally snowbound I really can't do anything else.


It's bigger than it looks.  I had a hard time with this box- it was one of those tool boxes that new homeowners who fancy themselves "handy" buy, which are inexpensive, totally lacking in adequate internal division, and end up full of things like rusty hacksaws, dull chisels, ruined putty knives and inexplicable sheet metal items with flanges and numbered mounting holes.



As always, mouse over for labels.

Mostly self explanatory; I'm going to mention a couple of things by name.  First, the Pocket Ref on the left side.  My copy predates Make but you can get it from the Maker Shed.  If you don't own this, you should  It has ALMOST everything you'll ever need to know- from the density and chemical composition of a huge range of substances to the masses, orbital periods, and average solar distance to each planet.  In practical terms, it has density, hardness, and coefficient of thermal expansion on dozens of woods, metals, plastics, and glasses.  It would, in fact, be pointless for me to continue to expound, so I'll say this: I have yet to be disappointed by this book when I tried to look something up.

JB Weld, if you don't know it, is a binary compound that works kind of like an epoxy- mix two pastes and they harden over time.  Once it cures, it's really strong, drillable, machinable, etc.- and quite heat resistant, to boot.  It's great stuff.



In the "main chamber" of the box is actual raw material.  Salvaged gearboxes, motors, pulleys, and parts from optical drives take up most of the space, along with a hot glue gun and a bunch of sticks (I go through hot glue like potato chips).  The small divided cases that attach to the lid are full of gears, sprockets, and fasteners, mostly compatible or nearly so with the Tamiya gearboxes that I've got in there.

Finally, on the left side, you can see an assortment of Sculpey III polymer clay.  This stuff is BRILLIANT.  When baked at 275°F (135°C) for about 20 minutes (depending on thickness) it sets up into, essentially, PVC.  Furthermore, the curing temp is lower than the deformation temperature of most OTHER plastics, so you can use it to build out other parts (I've had great success using it to neck down the hub hole in a wheel or gear; pack it in, harden it, then re-drill a smaller hole).  It's also low enough temperature that you can embed electronics inside your creations.  It's not too expensive ($2 or so for a 2 oz. block, which is about the 2/3 the size of a deck of cards), and comes in a whole rainbow of colors.

So, that's effectively the end of my mobile workshop, except for one summary picture:


The little cart is from IKEA- I got it a couple of weeks ago for $9.50 in the As-is section because it didn't have the bag.  The strap is an REI luggage strap meant to hold a smaller piece of luggage to a larger one, but it's tops for this.  The wheels are a completely lost cause in a Minnesota winter, but it beats making three or four trips to get all my crap into the workshop.

I have a wheeled laptop bag, as well, which I keep my netbook and some assorted other stuff in, but it's too dull to warrant a post.  Later tonight or tomorrow I will put up some pictures of my at-home workspace and storage system.

Coroplast snowshoes- it SOUNDED like a good idea...

If necessity is the mother of invention, snow day boredom is the drunken dorm-mate who will ultimately get you picked up by the campus police.

If you're outside of the Minneapolis/St Paul metro area, you may only be cursorily aware of the current snow-tastrophe.  We've gotten about 12 inches so far (300mm for you post-Imperialists) and are expecting another 4-6 (100-150mm).  I managed to get my car safely embedded into a snowbank off of the snow emergency route I live on (read the rules regarding that here- it's harsh but necessary), and, after digging and pushing out a few more people on the walk home, I got bored.

My work has been throwing out shoebox sized coroplast boxes for a while now; and being, as I am, on the verge of collapsing into full-on hoarding behavior, I've been picking them up and carting them home.  I've probably rescued about 800- there's a stack taller than I am at the Hack Factory.  Anyway, I use these things for everything- as boxes for storing stuff, dividers in my toolkit, a platform to spread out my compost on, whatever.  So, of course, faced with the reality of 18" (with drifts) of snow in my front yard, I decided to make snowshoes!


So, the basic construction is pretty simple- the beaver tail at the bottom of the picture folds up behind my boot, and the two pieces of knotted fabric strips tie around my ankle and over my toes.  All the folds are held together by a few layers of packing tape- I'm not bringing diptheria serum to Nome, here, so I don't really care for long-term viability.  I just wanted to walk around on top of the snow a bit.  I've always wanted to try it.

So, without further ado, here's a video of me trying them out...It didn't work quite as well as I'd hoped.



So, my post-mortem:
First, they aren't rigid enough.  They really just fold up around my foot and then I sink down to bedrock anyway.
Second, they are too big towards the instep.  That's what all the goose-stepping was about- once I sank into the snow, the plastic very helpfully fanned back out, necessitating a wide stance and a longer-than-optimal pace length.
Third, the lack of a frame and a really strong shoe connection means that it's really more like trying to walk with a someone throwing a small sled under your foot with each step than on a snowshoe- I slipped and slid both foot on the plastic and plastic on the snow- that's why I fell at the end.

Did I do ANYTHING right?  I think so...the packing tape seems to have held up well, and the pieces of fabric I used as ties were really nicely sturdy and big enough to easily be done and undone with gloves on.  I think a piece of lathing or similar light but sturdy material across the toe and heel edges would've probably made them work reasonably well, but I don't have anything like that in the house and I really didn't feel like trying to slog out to the garage.

It was fun, anyway, and a good way to kill an hour on a snowy day.

Thursday, December 9, 2010

Some thoughts on hackerspaces

Of course, the world is replete with articles like this but I recently had cause to write down my thoughts on the issue and I feel like a little more on it couldn't hurt.

Why did I get involved in Twin Cities Maker back in 2009, before there was a space?  Simple- I wanted to be part of a MEATSPACE community of people that likes to make stuff.  It didn't exist, so when I found the group, there was no way I could NOT get involved.  I think people who worry too much about virtual space replacing "real" interactions should look at hackerspaces as a dynamite counterexample.  By definition, the people who are involved in these groups are the most likely to be tech savvy, the most likely to participate in online communities of informational interchange about their hobbies, the most likely to be creative basement hermits, AND YET, increasingly, they are seeking out face-to-face interaction as an adjunct to their online work.

The tools, the workshop space, the raw material bins: these things, alone, aren't enough.  Oftentimes, I've given people a tour of the Hack Factory and, at the end, they'll say "that's great, but I have most of these tools in my garage.  Why should I pay $50 a month to use them here?" (usually, the touree has an "I-can't-believe-you-haven't-thought-of-this" smirk when they say that).  And I usually say to them, "if that's how you're going to look at it, the Hack Factory probably isn't the right place for you."  They see an underfunded, understaffed, under-equipped TechShop, but a hackerspace collective requires a different mental model than a TechShop, in much the same way as a farmer's market is from a grocery store.  Sure, the superficial trappings are similar (tools for use/food to purchase) but if you've shopped at a farmer's market, the difference is immediately apparent- people sitting, having coffee, chatting with the vendors and one another.  In a word, community, which is the key to a hackerspace being successful- and it's what those people with the spiffy garage workshops don't understand.  

TechShop is, in a way, a cargo cult realization of the concept- a belief that if you put a bunch of tools in a building and charge admission, people (and money) will show up.  The Hack Factory is, in fact, a building wrapped around a community, and tools and materials have shown up- the community created the value of the space.  I'm not knocking TechShop; in a place that's flush with technical types and cash (Silicon Valley), it's a great idea, and I have no doubt that a lot people who go to TechShop feel a sense of community there, as well.  But in most places, the dedication of the individual to the community is more important than the willingness to pony up $100 a month, because you'll find more dedicated amateurs willing to pay $50 (and a parcel of their time) to support a community they believe in than you will to pay $100 for a little extra workshop space and some fancy tools.

Chris Anderson talks a lot (in his book, Free) about these dedicated amateurs, and the value of recognition to these people (us, I should say) as a compensation for their work, and why a lot of online communities attract people to do really high quality work for recognition rather than cash (Wikipedia).  Hackerspaces attract the same sort of person that will spend hours writing and researching a Wikipedia article- they get a charge from the pride of producing a fine piece of work and knowing people appreciate it.  The hackerspace, of course, puts it into meatspace, which (for some folks) increases the relative value to a point where people are not only willing to do the work for free, they are willing to PAY to support the community that enables that appreciation.

In the end, I suspect it's all about finding "your" people- people who understand the motivation behind making something that you could buy, buying something perfectly usable just for the parts inside, people who not only don't mock your three-story mobile toolkit, they think it's pretty cool.  $50 a month seems like a bargain.

Tuesday, December 7, 2010

NDAs, Patents and Projects

Some thoughts below on NDAs, patents, and people seeking project help from me when I'm wearing my freelance engineer hat.  A lot of this comes from having followed the Piclist mailing list for about 10 years, as well as reading quite a bit of Don Lancaster's writings on the matter- as well as a healthy dose of professional dignity imparted to me by the conflation of engineering with other highly skilled professions such as law or medicine during college.

NDAs
Sometimes I'll get a feeler e-mail about someone who wants to work with me, and they start off right away by saying "if you're interested, let me know and I'll get an NDA out to you right away."

I don't mind working under an NDA (under certain conditions), but some things about being hit up by it right away like that scare me:
  • Once I sign this NDA, if I subsequently complete or publish a project which is remotely similar to this person's idea, there is a legal document which could cause grief for me.  This is why music labels and publishing houses have rules about unsolicited material.
  • If the person e-mailing me is doing so as the classic "garage inventor", the assumption of an NDA feels to me like an assumption of asymmetry of relationship- they value their idea more heavily than my ability to make that idea a reality, and that spells trouble.  The fact is, ideas AND engineering chops are both a dime a dozen.  What's TRULY rare is the wherewithal to bring an idea to fruition in the right place at the right time.
  • I believe in open source hardware and software.  An NDA is pretty much an acknowledgment from the get-go that this project will never see the light of day, EVEN IF there is no "secret sauce" in the project.  If it's good enough to steal, it'll get stolen whether I post details on the net or not.
So, in the end, if the first e-mail is all about the NDA with zero or nearly zero technical detail, I usually assume I'm dealing with a prima donna type that I'm unlikely to be able to satisfy.  It may be unfair, but my time is scarce and it seems like a good pre-filter.

Patents
Don Lancaster has a lot to say about patents (and being an engineer in general- if you're not familiar with his work it certainly a little browsing of his copious online archives certainly won't harm you any) so I'll not do more than touch on it.  In short, all a patent does is give you license to sue someone if they rip off your project.  If your project is good enough for a Chinese manufacturer to decide to rip it off, they'll make enough money to brush off your lawsuit.  If not, you have nothing to fear because nobody will waste their time with your fiddling small change.  The key is not to get overly self important about the matter- it's easy to waste a lot of time and money on patenting something.

Projects
Finally, how I actually view projects that make it through the filter to be considered:

Broadly, I divide commission projects into two groups- one-offs and product development.  A one-off is something like that bathroom hassler that I posted a couple of weeks ago- probably something REALLY fun, where the client is not concerned with bringing something to production, the overall effort is like to be pretty small, etc.  Those I usually negotiate terms on a by-project basis- I ask that they buy extra parts so I can keep some goodies at the end (I make them fully aware of the fact that some of the hardware is part of my payment), or get a little in-kind service (I've done projects for food, laser cutting, and soon, golf driving range access).

Product development is a bit different.  For that I'm more likely to look for hourly rate plus development costs.  Part of the reason for that is because the process is more in depth and difficult- a one-off is basically a jumped-up hobbyist project, whereas product development requires some real knowledge beyond just slapping something together.  Another part is that, if things go well, they stand to benefit a lot from my work and so a steeper up-front cost is reasonable- it's an expense of doing business.


You'll find that a lot of people that come looking for help developing a product have no interest or ability to pay for it- but that's okay, because it's my day job to do that sort of stuff and the one-offs are more entertaining and enjoyable anyway.

Monday, December 6, 2010

The junkbox cyclorama

Adafruit had a post a few weeks ago about building a cyclorama to take nice pictures of your work.  I built one up for the office (we always have horrible pictures of things in our documentation), but for home I can't justify even the $50-75 one would cost me.  So, I did what any good maker will do- hit the junk piles!



First, a word on sourcing:  the local IKEA has a section right before the checkout called "As-is".  (My wife and I frequent IKEA for some reason- we eat breakfast there about once every couple of weeks, and dinner there almost as often.)  As-is is where IKEA goods too good for the trash but too bad to sell as new go- returns, scratch and dent, display models, etc.  Every so often, they'll bundle up a bunch of crap and put it on a "mystery cart" or a "handyman's cart".  The shelves just visible to the right above were a handyman's cart item; the lights all came from a mystery cart.  I've actually bought far too many of both of those; my garage is stuffed with disused cabinet doors and partly assembled furniture along with piles of mystery cart lights.  To be fair, I've also done a lot with the stuff I got out of them, but the piles of junk are probably not worth it.

At any rate, the backdrop lighting is provided by three "Kvart" lamps and the ambient lighting by a six-up "Glimt" light (link is to PDF of the assembly directions; apparently it has been discontinued).


There's a sample image; it's a little blurry around the edges (I don't have a tripod; I'll probably try to hack something together out of another Kvart desktop base) but I am quite happy with the quality of uniformity of the light.


Here we see some limitations; if the board angle is too steep, the picture shows hot spots from the individual bulbs.  I may try to add some diffuser paper (well, office paper) over the lamps- that's going to be tricky because the bulbs are stupid hot halogens.

I'll probably also make a roof and side walls out of  white foamcore (I have a bunch of THAT lying around, too, of course) in an effort to reign in some of the stray light I'm losing to the surroundings.

The backdrop is a blackout rollershade we had custom cut for a window without adequate measurement beforehand.  I couldn't bring myself to throw it out and now I'm glad I didn't!

Tuesday, November 30, 2010

TFPC 33: Booklet printing

33:  Booklet printing

I don't know why I didn't see this feature on printers earlier but I love that I can print out a document designed to be folded in half and stapled in the middle.

Monday, November 29, 2010

Electronics tools you didn't know you needed

Side trip from my regular posts on organizing your work space and taking it with you:  tools that you didn't know you needed.

Most of the tools in the toolkit are obvious- the soldering iron, the tweezers, the "helping hand", etc.  There are a few items that are in my toolbox (or are always close at hand) that I use constantly but somehow never make the lists I've seen for equipping a bench.

1. Cyanoacrylate adhesive- especially the brush-in-bottle "Krazy Glue" brand that I highlighted in my tool kit post.  Useful for "dead-bug" assembly, reattaching lifted pads, and temporarily holding things in place while you work on them (I know many CNC machinists who use CA to hold their workpieces down while they are in process.
2.  Hot glue gun- super useful for low-cost ruggedizing, strain relief, conformal coating and mounting PCBs.  Nothing fancy- a standard low-temperature hobby gun will work fine.  In fact, the high temp type take a little too long to cure for my taste, and tend to be too runny to boot.  A few globs of hot glue will transfer the strain from the solder joint on a wire to, well, the glue gob; if you push a PCB against a surface and squirt a little glue through some available mounting holes, you get top-notch semi-permanent mounting, right where you need it.
3.  X-acto knife- best tool ever for removing the outer jacket from a multiconductor cable.  By bending the cable to a sharp 180° angle and lightly scoring the outer jacket, you can easily cut through only the jacket, leaving the conductors (or foil/braided shield) intact.  Also useful in hacking (cutting traces and scraping off soldermask to create a new "pad") and rework (if the board is more important than the IC, the best way to remove a SMT IC is to cut the pins off at the package with an X-acto).
4.  Scotchbrite pad/steel wool- cheap phenolic protoboards tend to be unplated, so the copper finish gets oxidized.  You can pour a bucket of flux over the board before you start working OR you can rub it down with an abrasive pad of your choice.  Scotchbrite and steel wool both work wonders.  They can be used on old component leads, too, but that's a little harder.
5.  Dental pick-  good for lifting leads while you have the solder melted, if you need to rework a fine-pitch SMT IC.  For larger scale stuff, good for maintaining pressure on a component while you melt away the solder, or for picking off questionable stuff on the board (is it a glob of solder or something else?)
6.  Magnifier- I use a 3x for reading part markings and a 10x for doing board inspection. 
7.  Flashlight- pairs well with the previous item.  It's also handy to be able to readily direct light under components without having to rotate the whole PCB.
8.  Your nose- long a favorite tool of mine, this one would've been left off this list if not for being mentioned in Todd Harrison's excellent power supply troubleshooting blog posts.  I daresay not many people who've spent any time working with electronics DON'T know what the magic smoke smells like; that smell will linger long after the heat is gone, and will often be present even if no damage is visible.  Sniffing around on a board (UNPOWERED) can frequently alert you to a dead or damage component, or at least the region of the board that component is in.
9.  Your fingers- a non-contact IR thermometer works well, too, but for sheer cheapness and immediate availability, nothing beats the fingertips for detecting unreasonably hot components..  NB NB NB GREAT CAUTION IS REQUIRED HERE.  Do not probe circuits under power with your fingertips if there is a chance of them containing high voltages (above 24-30V).

TFPC 32: Internet symptom searching

I was down- hard- yesterday with a bad bout of food poisoning, which brings me to the 32nd item I love about living in the future:

32.  Symptoms of disease are easily available- Of course, this has it's downsides.  While the SYMPTOMS are often widely available, as are the prognoses, sensitivity and specificity are often ignored, as are any kind of information about likely age groups, races, gender types, risk-enhancing behavior, etc etc.

In other words, it's better at ruling things OUT than ruling them IN- but it WAS comforting to know that the very serious food-borne illnesses generally don't have the symptoms I was suffering through.

Saturday, November 27, 2010

TFPC 31- Online travel

I've been obsessing over how I can plan a trip to Maker Faire next year using the train...online travel reservations are pretty spectacular, since I can try different departure dates and travel permutations and find a cheap option.  I should write a Python script that spools out dates and returns prices...

Thursday, November 25, 2010

TFPC Day 30- Web updates from anywhere

Or at least, any PC.  I need to figure out how to do this from my phone...

Wednesday, November 24, 2010

If you can't find it, you don't own it (part 2)

In part 1, I covered my mobile electronics kit.  This time around, I'll look at my mobile electronics toolkit.

While the mobile kit contains (almost) everything I need to do some breadboarding of circuits, more permanent hacks, installations, disassembly of finds and really fun stuff is all bound to require more advanced tooling than the cheesy $5 multimeter (that link shows it for $13, but it's available locally in the Twin Cities at AEI for less than $5, and with a bulk discount option)(yes, I have purchased multimeters in bulk) and adjustable wirestripper in the kit.  After a few scrambling debacles where I realized I didn't have what I needed to finish the job, I decided that I'd best come up with a toolkit that I could use at home and on the road.

After some hemming and hawing at the local Home Depot, I bought a Stanley XL Tool Organizer, which is a nice fold-up unit- essentially, two of the more conventional see-through plastic lid boxes that fold up around a central spine that has a handle and six drawers.  It was only $25 at the Home Depot; I bought the last one that was there and it's not on the website, so I'm wondering if it's been discontinued.  Amazon has another one that's twice as expensive but has more drawers and clear sides rather than black- that's the one complaint I have about it is not being sure where things are all the time.

Here you can see how the drawers slide out; the "back" (relative to us; it's perfectly symmetrical) is folded down and the front is folded up.  When the two halves are folded up the drawers are captive, but can be opened and closed with a bit of effort.  I've not yet had one slide out on me while moving the toolkit around, so I consider it a pretty successful design.

The drawers have two different lengths- one short one at the top, to accommodate the handle in the center of the spine, and two longer ones on the bottom.  The depth of the drawers makes it possible to store larger objects in the drawers than can be stored in the clamshell sides- at least, if you don't want to take a cutting tool to the dividers in the sides.



The image above has tooltips- hover over the image to see the active areas (may not work in feed viewers like Google Reader).  Most of the stuff in the drawers was selected either because it wouldn't fit (comfortably) in the clamshells or because it fits so nicely here.  It's also stuff that I find having access to without having to lay out the side is nice- the precision driver kit, wire strippers, and multimeter are among the most frequently used items in the tool kit.  The butane heat gun is great for heat shrink; some day, when I have some extra cash, I may buy a combo butane heat gun/soldering iron.  That's a long way off, though.



There are a couple of items of note in here- the digital caliper is a ridiculously useful piece of tooling and once you have one you'll wonder how you lived without it.  There's a long-handled flat-blade screwdriver which is for prying apart seams in plastic cases more than anything else.  The USB-serial adapter will probably eventually move to the computer kit.  The solder sucker is a cheapo unit that I got from Marlin P Jones; I've seen it elsewhere as well and, surprisingly, it works substantially better than some that I've seen for five or ten times as much.  Lastly, if you haven't seen the brush/can variety of cyanoacrylate adhesive, let me just take a moment to extol its virtues.  The cap doesn't seem to glue itself on as easily, there's no tip to clog, and the brush is delicate enough to put glue right where you want it.



Nothing terribly unexpected on this side.  I'll mention that, in addition to an Arduino, I usually have a "Thumbino" in here, which is an Arduino clone of my own design that is the size of a USB flash drive and plugs directly into a USB port for programming- no cable needed.  Someday I'll sell them...if you're interested in buying one, let me know and I'll see what I can do.

There are a couple of things I'd like to add- I'd like to replace the sponge for the iron cleaner with a copper poof type tip cleaner.  A small DC power supply would not be out of line, either here or in the electronics kit.  A crimper and header connector kit wouldn't go amiss, either.  So far, I haven't felt a lack of any tool as I've worked away from my home base- of course, I don't expect to be able to do fine-pitch SMT soldering on the road.

TFPC 29- RSS feeds of my favorite blogs

Of course, it kills my productivity, but it's pretty much what I've always dreamed of- someone says, "here, I think this might be interesting to you" and I have all the reading I can manage.

Tuesday, November 23, 2010

TFPC 28- Project sharing on the internet

28.  Projects on the internet

Instructables, Makezine, forums, etc.  I remember a time where you had one option for example projects involving microcontrollers: the PIC16F84.  That persisted well into the 21st century- WAY beyond the point where the F84 was a viable product.

Monday, November 22, 2010

If you can't find it, you don't own it (part 1)

Mr. Jalopy's famous side one, track one of the Maker's Bill of Rights is all well and good, but more basically, if you can't FIND it, you don't own it.

Owning an object has a cost, however minor, associated with it.  You'll have to move it if you change residences, you have to keep your kid/cat/ferret/sugar glider away from things you don't want smashed/pissed on/drug under your couch/scent marked by a weird oily forehead gland, and clutter (IMO) occupies mental real estate we can usually ill-afford to waste.  If you're going to pay these costs, you should take care to keep your gear well organized so these costs aren't wasted when it comes time to use something.

As a hackerspace-going maker, I find myself with an additional constraint- if I want to work on a project at the shop, I need to either bring what I need (tools and materials both) or be darn sure I know what and where stuff at the shop is.  My solution is a robust, scalable, compact group of toolkits broken down by four disciplines:
  • Electronics- since I'm an electron jockey, this one was first.  It's all the standard stuff- breadboards, jumper wires, voltage regulators, diodes, etc.  One Arduino, of course, and a wire stripper, and a small, simple meter, but no real tools to speak of.
  • Electronics tools- this is the first "add-on".  My electronics kit contains everything I'm likely to need to breadboard something up and get it working; this kit contains everything I'm likely to need to make a project permanent: soldering iron, pliers/dikes/screwdriver, more capable wire cutters, some spools of wire, a better meter, etc.  Also, a few batteries and battery holders, a couple of Arduinos, some shields, and a few Xbee modules.  Some cables, too.
  • Computer/custom project stuff- this is my rolling laptop case.  It's a much less well defined kit, because I don't have a spare computer to throw at it right now, but ultimately I expect that it will contain a laptop, a nice assortment of cables (possibly drawing some out of the tools kit), a rich digital library, a nice notebook and several pens, a graphing calculator, and have assigned space for my o-scope and a small box which will be large enough to contain and protect projects in process.
  • Electromechanical parts and tools- enough parts and tools to make a fairly decent little robot (or six).  Several Tamiya gearboxes and associated hardware, an X-acto knife kit, some drivers, belts, gears, motors salvaged from all manner of equipment, wheels, pulleys, etc.  Sculpey, JB-Weld, and a hot glue gun round out the mix.
Below is a nice, tagged image showing the outside storage area of my electronics kit.  If the box looks familiar, it's because it's the same one that the MakerShed electronics components packs are distributed in.  They are sold locally for about $7 (frequently on sale for $5) at Menard's, a fairly stock home improvement warehouse common in the upper midwest.


    Mouse over the buttons for descriptions (you may need to view on the blog site itself for that- Google Reader, at least, doesn't display them); click the image for a larger view.  As you can see, there are some fairly esoteric parts in there (the QT110 touch sensor, pager motors, and the IR receivers spring to mind); I've still got some empty space even WITH those parts so why not?  I feel like I have my bases pretty well covered here.

    This, of course, is just the lid- it lifts up to reveal another set of larger and deeper storage compartments inside.



    Inside, there is a nice assortment of 5% tolerance resistors (65 values) with each different value separately bagged, labeled, and stored in increasing order and segregated by decade for easy access (if you can't find it...).  The Arduino clings to the underside of the lid; it's held in place by a few dabs of Sugru under some old PC motherboard standoffs.  The largest subdivisions has a small, cheap meter, a few breadboards, a cheap wire stripper/cutter, and a largish HD44780 driven LCD (4x20, LED backlight).  There's also a 3x magnifier, because there are a LOT of small numbers in this box, and a standard 5.5mm by 2.1mm barrel jack with wire pigtails that leads to the outside world.

    There are a few other sensors in here, along with some batteries, some largish switches, discrete semiconductor devices, a bag of random LEDs, and some terminal blocks (see my bathroom hassler project for more details on the terminal blocks).  Again, there are probably a few things in here that could go (SCRs?  Really?) but for now and until I have a need for the space I'm going to keep them in.

    I'm interested to hear what other people think I should have in here- maybe some logic ICs?  I'd like to add some variable voltage regulators- I know I have some LM317 parts around here somewhere.  A small variable voltage wall-powered supply would be nice, too.  Some higher power transistors, too- the NMOS parts I have in there are pretty decent as are some of the PNP parts, but I have no PMOS or NPN TO-220 devices.  Maybe some L293D motor drivers?  What else am I forgetting?

    Tomorrow (hopefully) I'll do a write up on my electronics toolkit.

    TFPC 27- Geek culture

    27.  Geek culture

    Growing up geek was hard (I'm not going to claim it was as hard as growing up gay would be, naturally)- especially because my formative years were spent in a small school (less than 90 students from preschool through 7th grade) where a sizable number of the attendees were there as a school of last resort.

    So it does me some good to see the embrace of geek-dom people like Wil Wheaton bring to the world, and to see that being a geek is no longer anathema.  I'm sure it's still hard on teenagers and kids in small schools, but maybe it's getting better.

    Sunday, November 21, 2010

    Hassling the bathroom going public

    Recently I was approached by an architecture/design firm to help with an electronic install at a client site. The client had requested a system that interacts with users in the bathroom- "interacts" meaning, hassles them when they come and go.

    I spent some time debating how to do this; hacking an MP3 player would be easy, but keeping the devices synchronized is a pain- how do you play one sound, at random, then stop until the next input? The Adafruit Waveshield is nice and easy, but the sound quality is poor (22kHz 16-bit mono). Plus, the cost is kind of high for what you get- $30 for the Arduino and another $22 for the Waveshield.

    Searches for a cost-positive MP3 shield failed me (there are some out there but they are really quite pricey) and the MP3 trigger somehow eluded my search.

    It was around this time that Adafruit offered for sale the Chumby Hacker Boards. I decided that I'd do the project with that- it was a bit more expensive but it offered the benefit of playing many types of audio files natively, being programmable in Python (yay!) and being, well, cool. I partly defrayed the cost to the client by offering to do the job in return for enough parts to build a setup for myself (so I have a CHB of my own to play with) and pizza after the opening.
    The electronics are fairly simple (outside of the CHB, of course)- I used a protoshield to interface with the CHB (on these beta release boards, Arduino-ish headers are in place; the final product is likely to have that removed as the compatability with Arduino shields is pretty low due to the 3.3V signal level and the lack of hardware SPI and PWM on the right pins of the header). For ease of installation, I hacked on a terminal block (Altech AK950 5-pos, purchased at Ax-Man for $0.50). The install of that is quite a good hack (IMO)- the AK950 is a 5mm spaced header which is close enough to .2" to line up well with the holes on the protoshield. I pushed some pins that I dug out of a .156" spaced header (also from Ax-Man) into the holes and soldered a right-angle .1" spaced snappable header to that. The right-angle pins drop through the board and Bob's your uncle. I used hot glue to secure the terminal block.

    The cans and inductor on the lower half of the protoshield are a PCB I designed that has a step-up circuit on one side and a step-down circuit on the other. They use the same BOM (apart from the voltage set resistors), and can do step up from 3.3V to 12V or down from up to 30V to 5V. I got the board from Laen's awesome PCB batch buy.


    For door detection I used a work-surplus (people who know me well are snickering at that; I'm infamous for the mountains of stuff I've scavenged from the trash at my office. My co-workers have in fact started bringing things to me instead of the trash bins, much to my wife's dismay.) infrared obstruction sensor. It's got an adjustable range and a nice, easily mounted package. Unfortunately, it runs on 12-30Vdc, hence the step-up supply (the CHB runs on 5Vdc input, and requires a pretty nicely regulated supply, at that). To manage the 12V->3.3V output conversion I used a transistor to make an OC circuit with a 3.3V pull-up resistor.

    For additional state monitoring there's a PIR sensor (from Adafruit). Conveniently enough, that sensor runs off 3.0V-6.0V, and has an on-board regulator to 3.3V, which is the level of the return signal. That meant no signal conditioning needed there.

    As you can see from the picture the sensor box is pretty simple- a black painted aluminum enclosure (bought at AEI in Golden Valley) with a hole drilled in it (the PIR lens is a scoosh too big for any step bit I had access to; I ended up using a boring bar on a vertical milling machine to widen out the hole). Inside the box is a voltage protection diode and a 5V regulator; the room was pre-wired with 4-conductor low-voltage burglar alarm wire, so I sent 12V to the box and regulated it down to 5V for the PIR. For the junction between the wire in the wall and the wire I pre-terminated with the 6-pin DIN connector (chosen because it was the only connector at AEI that they had two males and two females of), I duplicated my trick with the terminal blocks, only this time instead of hot glue I built a body up between the two out of Sculpey (one of these days I'll do a post just about that- it's amazingly useful stuff).

    I coded up the state machine in Python (Python 2.6 has been built for the Chumby) and arranged for the program to run off a USB drive automatically on boot.  The system has three events- enter, exit, and "loiter", and sounds in different folders on the USB drive will be played for each event, allowing users to change the sounds later if they wish.

    It's been installed but it's not running yet; there are still some tweaks to be done to get the thing working reliably.  Sometimes it loses track of what's going on- it stays in loiter when the room is empty, for instance.  I need to tweak some timeouts on the motion sensor, I think.

    If you're interested in seeing it in action, stop by Pizzeria Lola in South Minneapolis (55th and Xerxes) and ask if you can use the bathroom- I'll tweet when I have it up and running.  They do a mean pie there, and the design of the place itself warrants a peak- particularly the spectacular copper-wrapped wood burning oven which is the centerpiece of the dining room.

    TFPC 24, 25, 26 (Wireless Internet, YouTube, Injection Molding)

    24.  Wireless internet

    25.  YouTube
    A million monkeys with a million camcorders will generate more garbage than can possibly be imagined.  Fortunately, there are a million OTHER monkeys pre-sorting it for me.

    26.  Injection molding
    Okay, not new, but the last few years have seen an EXPLOSION of inexpensive goods come from China's vast injection molding farms.  I'm not a big fan of cheap plastic crap, but there is some REAL gold hiding in that sludge.  The inspiration for this was the ease and low cost of putting together some really awesome mobile making kits lately.  Will post more anon, with pictures.

    Thursday, November 18, 2010

    TFPC 23 (Awesome batteries)

    23.  Batteries

    Lithium based rechargeable batteries rock my world, even if they are much harder to hack.

    Wednesday, November 17, 2010

    TFPC 22 (Digital music)

    22.  Digital music

    Compressed digital music, in particular.

    10,000 songs in your pocket.  What's not to like?

    Tuesday, November 16, 2010

    TFPC 21 (Machine vision)

    21.  Machine vision


    There are a surprising number of machine vision applications out there these days- 2D barcodes, out-of-lane detection in cars, and manufacturing.  This is a result of the dramatic increase in available computing power- as data transfer rates go up, image sensor integration gets cheaper and more complete, and processing cycles get cheaper, the number of applications will go up as well.

    Which begs the question- why does the TSA need to people to look at my naked body on the scanner?  Presumably, any thing a person would see could be seen by a computer; if the area of interest were cropped and presented to a human for follow-up, then a more thorough search could be ordered.

    I suspect it's for the same reason voting machine companies have told us it's "impossible" to issue a paper receipt- failure of imagination coupled with hidebound ways of doing business.  And money, of course.  Lots and lots of money.

    Monday, November 15, 2010

    TFPC 20 (Twitter!)

    20.  Twitter

    What I don't like about Twitter is the incessant navel gazing (tweets of the "why hasn't he called?" ilk).

    What I LOVE about Twitter is the ease with which it levels the playing filed for the sharing of ideas and information.  People rich and famous to, well, me, can post something on Twitter, (potentially) gain a following, and disseminate information.  Provided it can be shared in 140 characters or less.

    The bandwidth restriction is something else to love, in the same way as it is for text messaging.

    Sunday, November 14, 2010

    TFPC 17, 18, 19

    I suck at daily blogging.

    17.  Blogging (did you really not see this coming?)


    Both creating and consuming.  It's nice to see what's going on out there, what other people are doing, and to share your ideas and achievements yourself.

    18.  Tabbed browsing

    Despite its attendant, the Wikipedia tab plague.  It seems like such an obvious thing I'm amazed it took so long to come to fruition, although it probably only feels recent to me.

    19.  Super-easy free open-source software development

    I am thinking in particular of Arduino, Python, and Processing (which I have yet to play with).  Between the fact that these can be freely downloaded and used by anyone for anything and the massive culture of sharing tricks, tips, and how-to docs, you can pretty much figure out how to make a computer (either a PC or an embedded system) do what you want, quickly and easily.  And cheaply.

    Thursday, November 11, 2010

    TFPC 16

    16.  Laser cutters

    Cheap laser cutters (well, cheap is relative) can now cut any shape you can imagine out of some pretty useful materials.  Acrylic, thin plywood (say, 1/4" or so), vinyl, and most other types of plastic can be sliced into intricate shapes for your home projects.

    Wish I could afford one...

    Wednesday, November 10, 2010

    TFPC 15 and 16

    I'm struggling to keep up with this every day- it really is hard to carve 5 minutes out for it.

    15.  Ubiquitous cellular connection

    Weak but it's true.  I have no idea how I managed to see my friends before we could connect via cell phone.  Although, for me, pre-cell phone days were college and high school, so I saw my friends around in person far more often.

    16.  E-commerce

    I can buy pretty much anything, anytime.  For someone with slightly esoteric hobbies (electronics still doesn't have enough clout to get really great local stores), that's a must.

    Monday, November 8, 2010

    TFPC 14 and 15

    14.  Online banking

    This one is actually a prime reason why I'm doing this.  I was paying bills, transferring money and generally budgeting our lives when my wife pointed out how amazing it is that I can do that all online.

    It's become so normal, so natural to me that I completely overlooked how incredible cool it is.

    15.  Hackerspaces

    I think that about covers that.

    Saturday, November 6, 2010

    The future's pretty cool 13

    13.  USB

    It seems like it's been here forever, but USB is a relative newcomer when stacked up against things like the parallel interface, serial ports, and PS/2, which are still (relatively) ubiquitous.  We forget the bad old days, before hot swappable input devices were the rule, printers had cables that could actually bend with less than a one-foot radius, and adding more devices was a simple matter of plugging in a hub.

    USB gets some flak from nerds for it's hub and star topology, inefficient use of bandwidth, and relative lack of hackability.  It wasn't that long ago that the people were really worried about what the disappearance of serial ports and parallel ports from PCs meant for hacking; with the advent of product lines like FTDI's USB chips that emulate serial and parallel interfaces, I think all but the most die-hard serial fans will agree that we've come out ahead.

    Friday, November 5, 2010

    The future's pretty cool, 12

    12.  Optical mice

    I'd never thought of it before just now, but there are TEENAGERS out there who likely think "mouse balls" is a euphemism for some social disease.

    Every once in a while, I come across a really old non-optical mouse somewhere in my company at some old, old workstation and I'm reminded anew why I love my optical mouse.  Remember when the ball would hit a grain of crud and just...stop, in one axis?  And you'd have to back it up and give it another run?  Picking it up and jiggling it helped, too, sometimes.  And let's not talk about the cleaning process...

    If you want to have some real sadistic fun, find a friend who is old enough to have spent a lot of time working with a ball mouse but young enough that that time was highly formative (30-35, long term nerd), and put some scotch tape over the optical sensor on his/her mouse.  The result will be a recalcitrant pointer that behaves a lot like a ball-mouse with a fouled roller.

    Then watch as s/he instinctively does the mouse jiggle and back up and try again motion...

    Thursday, November 4, 2010

    The future's pretty cool 11

    11.  LCD monitors

    I honestly never thought I'd see the day when a 19" LCD was not only affordable, but SO affordable that I would have TWO of them sitting side-by-side on my desk.  When I started college my 17" CRT was larger than standard, and we marveled at the 19" that one of my friends brought back after the summer.

    Wednesday, November 3, 2010

    The future's pretty cool 10

    10.  Digital watches

    I still think they're a pretty neat idea.

    Tuesday, November 2, 2010

    The future's pretty cool 9

    9.  Wikipedia

    Any self-respecting information hound will nod in sympathy when you mention the Wikipedia tab plague (which reminds me- tabbed browsing may be number 10): you head to Wikipedia to look up, say, chi-squared tests for random variable distribution, and two hours later you're reading an article about the history of the Boxer Rebellion or the scuttling of the German fleet in Scapa Flowe at the end of WWI.  You've completely forgotten why you pulled Wikipedia up in the first place, and you may have missed a meeting.

    Maginot Line Engineering

    I tweeted on this a couple of weeks (months?) ago, but it's important enough a concept that I think it bears repeating because it applies to a lot of work that engineers (and, really, anyone) does.

    For the less historically-inclined, the Maginot Line was a series of defensive fortifications between France and Germany built between the World Wars.  France, tired of Germans tromping through their country every couple of decades, elected to try keeping them out by putting fortifications, guns, traps, and big, strongly worded signs in several languages all along the border with Germany.

    And it worked- the Germans were utterly and completely repelled by the Maginot Line's defenses.  Of course, they went AROUND them and attacked from the north, but by God, they didn't cross the Maginot Line!


    In the engineering world, there can be a tendency to do the same thing.  If one manufacturer's product has a defective lot, design them out!  A particular technology (e.g, tantalum capacitors) fails you, don't use it again!

    It seems like a simple fix, but I'm here to tell you: at best it is only breeding false confidence.  At worst, it can actually CREATE a problem, because once a company has suffered through a problem (material contamination, process failure, what have you) that company is LESS likely to have that problem again than another company that hasn't yet made the same mistakes.

    The lesson here is simple- learn from past mistakes and problems, but recognize when you're going too far.  Ask yourself: am I spending too much time and effort on solving the problems of the last war?  Because, I promise you, right now, someone somewhere out there is making something RIGHT NOW that is going to blow up in your product and give you a three-month headache.

    Monday, November 1, 2010

    The future's pretty cool 6-8

    Three-for-one today, because I pretty much didn't touch a computer all weekend.  I need to figure out how to pre-post things.

    6.  High resolution dislpays

    As Apple has famously pointed out, our eyes are capable of absorbing much greater detail than digital systems typically provide them with.  "Normal" vision (ie., not SEVERELY color-blind, or capable of being corrected to 20/20 with reasonable glasses/contacts) allows for a tremendous data density in a small package, and displays are finally starting to catch up with that.

    7.  Gaming as a force for good

    Some folks out there have finally recognized that the competitive spirit can be harnessed for good- from MMOs like WoW being used as economic microcosms and social fishtanks to competitions in neighborhoods to reduce power consumption.

    8.  The local food movement

    This is a fave of mine, because it means that it's now possible to buy locally grown food direct from the farmer at prices comparable to the really cheap pre-packaged stuff.  Net result: better food, lower prices. 

    Friday, October 29, 2010

    The future's cool #5- SMT for everyone

    Okay, hardcore nerdery here.  Sorry to the non-believers in the audience, but...


    5.  SMT technology for hobbyists.

    Some will argue the point, looking back with nostalgia at the days when every IC was available in through-hole and sockets abounded, but I for one welcome our minuscule highly integrated overlords.

    Ten years ago, when I bought my first parts from Digi-key, it was inconceivable to me that SMT parts could be usable on an at-home basis.  Now, the proliferation of adapters (such as Capital Advanced Technologies' excellent "Surfboard" series), cheap hot-air and fine-point rework stations, excellent reflow tutorials, and extremely low-cost low quantity PCB fabrication services (like BatchPCB and the DorkbotPDX group buy), it's now completely and totally reasonable for a hobbyist to use SMT parts to realize extremely advanced designs in surprisingly small amounts of space.

    All that's really needed is the right attitude.

    Thursday, October 28, 2010

    Two for one: the future is awesome 3 and 4

    I missed yesterday (inauspicious, missing a goal two days in) but I'll make up by doing two today:

    3.  CPU cycles are so cheap as to be practically free

    While excessive wasting of CPU cycles still bugs me (do I REALLY need something checking to see if updates for Acrobat/Flash/iTunes are available 24/7?), I LOVE the fact that CPU cycles are so cheap that we can waste them on GOOD stuff- operating system eye candy, virtual machines that let me write extremely simple code to do REALLY complex stuff that is highly portable (*cough* PYTHON *coughcough*), and data compression that lets high bandwidth analog come through even fairly narrow (by modern standards) pipes with great quality.

    4.  Text messaging

    I LOVE text messaging.  Not the "omg lol i cant bleve u sed that" kind (as a grammar snob that stuff annoys me, although from a technical standpoint, it shouldn't), but the simple fact that it is (arguably) as information dense a means of communication as I can imagine.

    The 160 character limit (artificial in this world of essentially unlimited bandwidth that's too cheap to meter) as well as the clunky UI (a limit of the small input device) means that we've adapted to pack a lot of information into a short message.  In my case, it tends to be "Pick up milk" or "Missed my bus"- messages that, transmitted by speech over the phone would involve lots of noise (chit-chat about how the day was, greetings, farewells, etc etc- stuff that can wait until I get home).  The ratio of truly important data to time required to read/write it is astronomical; I can read a text message in less time than it takes to dial the phone.

    Tuesday, October 26, 2010

    The future's pretty cool, day 2

    2:  I <3 nearly-free data storage!

    The first hard drive I remember owning was 40MB on the Mac LC my parents got when I was in 6th grade.

    Four years later we upgraded to a Performa with a 500MB drive.

    Two years after that, we hit 1.2GB.  Surely that will never fill up, I thought to myself.  Of course, then I got to college right in the midst of the MP3 boom...

    Now I have two 250GB drives in my PC, and I can add another two terabytes (an unimaginable 50,000 times larger than my first drive) for less than $100.

    Relative to that first drive, that's too cheap to even calculate.