The state of the Arduino ecosystem

*** The following is a “bitter old engineer” rant.  You’ve been warned.

At this ripe old age, I have come to value most the quality of a toolchain. I’ll go a step further and say that the coherency and consistency of the umbrella that toolchain inhabits is a most prized quality.  And what spurred this revelation?  Why the obtuse declaration?

I have seen the other side, brothers and sisters. I have felt the greener grass on the knoll of Arduino, and I’m here to tell you something: it ain’t that green.

My (albeit, limited) experience to date in hacker-friendly Arduino land has been lackluster. It reminds me of another favorite rant of mine: Linux. There are some striking similarities between the two communities of DIY hobbyists and computer enthusiasts.

The Arduino Uno, marvel of electronics enthusiasts.
The Arduino Uno, marvel of electronics enthusiasts.
  1. As soon as something “official” releases, there are half a dozen “forks” that have splintered off. This serves to dilute the overall user experience, causing bewilderment and disorganization.
  2. As a result, newer users aren’t sure where to start to get things up and running.
  3. Knowing where to turn for help is equally difficult. Because the dragon has a dozen heads, you might have to slay them all before you master the thing.

I have on my work bench a handful of Arduino-esque stuff, virtually all of it non-operational hardware (so far):
a) A Pololu AVR programmer
b) A Sparkfun Pocket AVR Programmer
c) A homemade ISP programmer
d) An Arduino UNO
e) A relay development board with ATtiny2313 MCU

a)

This was a replacement for (b), promising to be more better faster. At least this manufacturer’s drivers are self-hosted, i.e., they make their own suite of drivers. It’s not some arcane foreign package, managed by yet another third party, long defunct. And yet… damned if the thing won’t work. I get the dreaded Exclamation Point of Death.

b)

This is a hopeless mess. Sparkfun’s driver link just goes nowhere. After a half an hour of reading and clicking, I stumble over to another vendor’s site and find some hearsay about yet another suite of drivers that allegedly work. Finally this installs, but there’s no COMM port listed in Device Manager. So, none of the software tools can recognized the thing.

c)

I was foolhardy to think I could make my own programmer from scant directions on the interwebz.  That was just a big fail.

d)

My first Arduino dev board, the Uno, does not work. I plug it in, and most of the time no machine will recognize it. No “bonk”, no “ding”, nothing. I took this to my office and gave it to my technicians who are well accustomed to working with QC and microscopes and fancy solder reflow equipment. They found nothing distinctly wrong with it. And yet it clearly doesn’t work.

I found that if I bend the Uno board a bit (yes, bend), I can get Windows Device Manager to wiggle a bit. So there appears to be an inner layer fault, most likely a trace intermittence. Lovely. Another brick for my pile.

e)

To program the AVR chip, I turned to these sprinkling of software tools that purport to do so:

  • WinAVR
  • AVRDude
  • AVRDude-GUI
  • AVR Studio

The top three have been dudes for me so far.  I’m yet to try the gold standard, AVR Studio.  After all, this is published by the manufacturer of the MCU…

The only piece of hardware above that I got to work was the relay I/O board. And you know how I did it? With a Freescale HCS08 dev board. Not an AVR chip or an Arduino board. The S family of chips is simply lovely. It’s soothing. It’s a fresher breath of air, having inhaled the stale aroma from the Arduino “hackerspace”.

But to be fair, Freescale is my comfort zone.  I cut my teeth on the Motorola HC11.  So it stands to reason that I’d favor that flavor.

The uniformity of experience in going from a line of C code to a hex file burned onto silicon is now even more valuable to me. The Freescale “way of doing things” is a much more pleasant thing. One application (CodeWarrior) weighing in at a hefty half gig, published by a single vendor that also happens to design and fab the chip you’re using, is all you need. Start to finish. That’s power.


I should note right here and now that I’m actually the biggest supporter of the Open Hardware Movement and the philosophies that Arduino espouses.  There have been countless amazing creations achieved with this platform.

It’s in the implementation that I’m disappointed.  Frankly, I’m surprised that the masses aren’t as frustrated as I am.  I suspect that this is indicative of a greater public movement: that of DIY culture invading every corner of the marketplace.  The software (or tool, or apparatus) doesn’t work as advertised?  No sweat, just hack it!

And that ethos truly is something to celebrate.  Kudos to the Everyman who fixes something rather than disposes of it, complains, and buys a new one.

But coming from the engineering and product development side of the aisle, I’m forced to side with the philosophies of coherent and esthetically pleasing user experience.  This has value too, just as much (I would argue) as the value of DIY, crowd-sourced electronic hobbyism.

Failure analysis on the HoMedics Lullaby Soundspa

We have one of these little do-dads for our kid: HoMedics SS-3000 Soundspa Lullaby.  It’s a nifty little product, makes different simulated white noise sounds and projects these images from a spinning disk apparatus.  Like I said, nifty.

But also fragile, and prone to breakage.  The company, HoMedics, replaced our first one because its little motor that turns the disk just quite one day.  Well, the replacement now has the same symptom.

So enough was enough!  Time to tear this thing apart.

It’s a complicated little gizmo.  I had some difficulty separating the front from the back housing, but if you shove a flat head screwdriver into the side, it will pop out.

After get the motor assembly all torn apart, with some simple tests, I determined that the motor magically worked again.  In my estimation, the point of failure here is misalignment of the projector disks with the engaging gear drive.

You see, HoMedics is relying on the forgiving tolerances of the plastic gears in the motor drive system, such that when you engage the projector disk into the disk bay, there will be proper alignment.  I believe this isn’t a safe bet.  When you feel resistance flipping the switch, that means the gears aren’t in alignment.  Don’t proceed!  This will dislodge the worm gear and your motor won’t turn anymore.

Or at least that’s my educated guess.

 

IKEA kitchen light mod, part 2

A while ago, I modified my daughter’s little kid kitchen.  In that project, I found my design self teetering on that edge between two goals: get-it-done on the one side, do-it-right on the other.  I had chosen the former and even my 2 year old (at the time) could see that this was a critical design mistake.

As a quick refresher, I had thought Those Thoughts 1.  “Wouldn’t it be cool if her cute little IKEA oven had a light that turned on when the cute little door was opened?”  Well, yes, but perhaps it would have also been cool if I’d considered the very likely fault condition wherein my toddler would leave the door open.  Toddlers do that.

And you guessed what happens next: batteries died.

A very wise engineer once told me, “Rob, there’s never enough time to do it right the first time.  But there’s plenty of time to fix it later.”

Well, here I am, fixing it finally.

I knew that a timer was in order.  So I blew the dust of my Forrest M. Mims III Radio Shack booklets, particularly the indispensible 555 timer book.

MIMS 555
The 555 according to Forrest M. Mims.

When I was done, this is what I cooked up:

output FET circuit
This is the output driver circuit.
truth table
This is my truth table for operation and the switch input circuit.

So to explain the “truth table“, the operation works like this:

  1. user (in this case, the kiddo) opens the oven door
  2. added lights inside oven turn on and remain on for about 10 seconds
  3. if user does not close door within this time, the lights go off to conserve battery life
  4. closing the door within the time frame resets the timer and turns the lights off

One other critical circuit requirement that the above Mims diagram does not account for was with the trigger input.  His classical circuit only triggers on level changes, active low.  In other words, for as long as the input is held low, the timer would be in standby.

That wouldn’t work for me, since I wanted the timer to start when the door opened.  That’s an edge-sensitive requirement.  I found a nice, easy capacitive switch solution:

Screen Shot 2013-08-02 at 9.39.57 PM
edge-sensitive input circuit

The results, finally, were as they should have been: nice well-lit oven that doesn’t wear out the toy batteries. My engineer buddy would agree.

updated timer circuit
Lower left corner is the added timer circuit.

lights on!

AC multi-way light switch

My garage has a single light switch in it for its overhead fluorescent lights. This light switch is not conveniently located; it is situated beyond our freezer, such that one has to walk into the darkened garage in order to turn the switch on. So I made an electronic 3-way switch. “Why?”, you ask. Indeed. My reasons are always convoluted and sometimes irrational. Best not to ask such questions.

But if you must know, our garage is mostly finished with drywall, so adding a second “3-way” switch would have been difficult. I opted for an electronic switching circuit 1.

First, start with the napkin diagram:

AC switch circuit
This is my napkin circuit drawing.
This is the block diagram and truth table for the dual JK flip flop.
This is the block diagram and truth table for the dual JK flip flop.

The core of the design revolved around a JK flip flop. Rockin’ this project with 30 year old technology.

For the mechanical switch, I removed the AC switch and used a surface-mount garage door momentary contact switch. The wiring then can also be garage door opener grade, small current wire (since this input to the circuit is on the low-voltage digital logic chip).

Here are some photos of the final project:

Full Project Album:

Surround Sound Debug

For some reason, this keeps happening to me. I must be doing it wrong. But I’ve either been too stubborn or too distracted to find the better way to do it.

I’ve installed surround sound wiring into my abodes at least five times (twice in my bachelor days at two different apartments 1, and thrice in my married days in all three of Sarah’s and my mutual houses. So I have a fair amount of experience with fishing wires down walls and into ceiling joists, cutting in low-voltage single-gang electrical boxes, and wiring up multi-channel audio speakers.

But the one step in this many-tiered project that I haven’t mastered is this: the differentiation of the channels during the final wiring.

home-theatre-speakers-diagramHere’s what I mean. You get all the four main channels mounted and wiring run from the four corners of your media room 2. Add the center channel and you have five sets of wires coming into a single hook-up junction box near your media center cabinet. Next step: terminate those 10 conductors 3 into speaker lugs, or banana jacks, or binding posts.

But which channel pair goes to which speaker location? Doh!

And it’s not just an accident. I have tried various cable labeling in the past, as I did this most recent installation. But inevitably, my installs have included fish-taping cable down finished walls 4. Therefore, the labels that I’ve used — such as tape or zip ties, etc. — have always come off the cable in the process. Without that identification, it’s hard to know how to hook the cables up.

So what to do? I haven’t found much on the DIY home audio forums on this topic, strangely, which makes me wonder if I’m going about this installation all goofy. Do the pros do it better? Probably.

My first generation surround sound amplifier had a channel test tone utility that was helpful. It would emit a 1KHz tone into each channel for about 2 seconds and automatically increment to the next channel. But this wasn’t ideal for a few reasons: 1) It wasn’t controllable. Once that 2 seconds had expired, you’d have to race to the other speaker to hear the tone. Not very efficient. 2) The tone obviously required that the speaker cable be terminated between the speaker and the amp to be of any use. It’s an audible tone, therefore you need a speaker to hear it. So that’s not too helpful either since I’d rather hook up all the wire after I determine which set of wires goes to which speaker channel.

So here’s how I solved the problem.

Requirements

  • An LED
  • A 1KOhm resistor
  • A 12 battery
  • Some alligator clip leads

Setup

  1. Wire up the LED indicator with the current limiting resistor attached either to the anode or cathode. A more preferred method would be to use a ready-made indicator LED panel lamp that has a built-in resistor. These assemblies come with red (positive) and black (negative) wires. Here’s one from Digi-Key. http://www.digikey.com/product-detail/en/SSI-LXH312ID-150/67-1190-ND/145097
  2. Connect the anode side (red wire) to your unknown speaker wire positive lead.
  3. Connect the cathode side (black wire) to your unknown speaker wire negative lead.
  4. Back at the junction box end with all 5 channels, connect the 12V battery to the positive and negative wires.
  5. If you don’t see the LED light up, first try switching the battery leads on that same channel.
  6. If the LED still doesn’t light, move the battery to the next set of channel wires.
  7. If the LED still doesn’t light, repeat steps 5-6 until you find it.

Theory of operation

The nice thing about this method is that the LED is unidirectional. In other words, it doesn’t light unless (conventional) current is flowing from positive to negative. This is key, because you don’t want to get the positive and negative terminals mixed up to your speakers. Therefore, using a DC incandescent light bulb would be a mistake, since it will light bi-directionally.

Notes

I’m aware that some speaker wire have knurled, striped, or discolored conductor insulators to help you differentiate between the two. This is helpful in most cases. But in two of my installs, I used some Monster brand cable that had little to no helpful indicators. So the above bailed me out.

Project Gallery

Parody Circuits

I ran across this most excellent xkcd comic the other day:

Circuit Diagram
A funny circuit diagram parody

It’s just so funny on so many levels, if you’re a EE.  Let’s just go clockwise around the page, starting at the top left.

  • I love that the battery voltage is a square root.  Just so obscure and mathematically nerdy.
  • Gluing open the switch?  Ha!
  • That PNP transistor has two emitters, look out!  Crashing electrons!
  • I like that the printed value of the resistor isn’t explicit; just the color code is written.  Priceless.
  • Solder blob, yes!  Any engineer worth his salt relies on solder blobs during prototyping. It’s especially funny that this blob is shorting out a bunch of parts.
  • 666 timer.  Why didn’t I think of that one?  The 555 timer has had too much fun for too many years.
  • Magic smoke bottle.  Again, just so funny.
  • Just try to do some nodal analysis on that resistor network!
  • Holy water, tear collectors, and sandals… wow.
  • “Hire someone to open and close switch real fast.”  I laugh out loud each time I read that.
  • Most expensive chip available — I used one of those in my senior design project!
  • Arduino for blog cred.  That’s so trending now.
  • I’m afraid that 50V battery isn’t going to last long.
  • Hot glue.  Man, if I had a nickel for every time I whipped out the hot glue gun…

Insider parodies like these really crack me up.  I’m reminding of the Death Waltz musical score, also comically brilliant in its absurd complexity.  My wife reminded me of some music that her choir performed by ” PDQ Bach” 1.  Here’s a delightful such performance:

In the professional world, it’s always good to have a sense of humor with regard to your work, whether it be circuit design or classical music.

Pro bono blog development

As my wife can attest, I’ve been lost in the world of code again.  It‘s happened before.  This time, I was working on a big project for an NPO for which I do part-time admin work.  The project involved updating their WordPress theme.  I had not selected the previous theme they were using; it was roughly 4-6 years old, so showing its age in a lot of ways.

The CBE Scroll blog
The CBE Scroll blog

The effort was very much a “start from scratch” job.  Since web dev is not my day job, my skill set is somewhat limited in the world of PHP and CSS.  So I knew that I had to start with a good foundation.  In this case, I settled on the amazingly excellent Thematic Framework.  The learning curve is non-trivial, but the rewards are huge.  I’ve learned a lot about PHP filtering, action hooking, and good design principles in general.

The requirements for the project were really twofold:

  1. Freshen up the look.  Make it modern, readable, clean, simple.
  2. Try to make the blog look as close as possible to the parent Drupal-based site.  The blog subdomain existed long before the parent main site migrated its content to a full CMS, hence two different systems. Yeah, it’s not ideal, but not impossible to maintain.

So after about a month of work, I launched this morning… or should I say late, late, late last night?  I’m very pleased and hope the authors and readers enjoy the new playground.  I sure had fun rebuilding it.